Predict quality. Guard it. Then save.
LinuxAir represents every model by how well it performs on clusters of representative prompts, predicts its quality for each incoming request, and guarantees that quality stays within the limit you set — with uncertainty, answer checks and online learning on top.
A shared map of tasks
A curated probe set — math, code, extraction, JSON, classification, multilingual, reasoning, writing and more — is embedded and grouped into about eight task clusters. This map is shared by every model.
A fingerprint per model
Each model answers every probe once. Its error rate in each cluster, smoothed toward its overall error so small samples don't mislead, becomes a short vector — its fingerprint.
Where each prompt lands
An incoming prompt is embedded and softly assigned to its three nearest clusters. A prompt that is mostly "extraction" with a bit of "code" gets weights like 0.74 and 0.21.
A guarded decision
Predicted quality comes from combining the two. Only models close enough to the best are eligible, and the best value among them wins.
Five lines decide every request.
What the symbols mean
Φk(x) — how much the prompt belongs to cluster k (softmax of cosine similarity, temperature 0.05, top three kept).
Ψk(h) — model h's error on cluster k.
nk — how many measurements back that error.
C — cost on a log scale in [0, 1]; L — latency in [0, 1].
Why it's safe
A cheaper model can only win if its pessimistic quality is within τ of the best model's. τ is halved automatically on hard prompts (best LCB below 0.70), so difficult work goes to strong models. Models that are both worse and pricier never win.
Three modes, one principle.
| Mode | Price weight λ | Tolerance τ | Behaviour |
|---|---|---|---|
| Best quality | 0 | 0.5 pts | The strongest predicted model for this prompt. |
| Best value | 0.35 | 2.6 pts | The cheapest model statistically as good as the best. |
| Economy | 0.8 | 5.3 pts | Accepts a small dip for larger savings. |
By default τ = 0.005 + min(0.12, 0.06 · λ). You can override it, add a minimum-quality floor, or weight latency.
New model? Probe it once.
Because the task map is shared, a new model only needs one pass over the probe set to join the routing space. Nothing else is retrained, and public models already measured by another workspace go live instantly.
Your traffic sharpens the picture.
Feedback and implicit retries update a live per-cluster error with an exponential moving average. It is blended with the probe error in proportion to how many live signals exist, so the router adapts to your prompts without forgetting what it measured.
Stop overpaying for easy prompts.
2,000 free credits on signup. Bring your own keys, change one base URL, and see the savings on your own traffic.