LinuxAir
How it works

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.

The math

Five lines decide every request.

q(x, h) = 1 − Σk Φk(x) · Ψk(h)predicted quality of model h on prompt x
σ²(x, h) = Σk Φk(x)² · Ψk(1 − Ψk) / (nk + 1)uncertainty — fewer measurements, wider range
LCB(h) = q − κ · σpessimistic quality, κ = 1
A = { h : LCB(h) ≥ maxg LCB(g) − τ }quality guard — τ is your tolerance
h* = argmaxh ∈ A [ LCB(h) − λ · C(h) − μ · L(h) ]best value among near-equals

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.

Choosing your trade-off

Three modes, one principle.

ModePrice weight λTolerance τBehaviour
Best quality00.5 ptsThe strongest predicted model for this prompt.
Best value0.352.6 ptsThe cheapest model statistically as good as the best.
Economy0.85.3 ptsAccepts 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.

Zero retraining

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.

Online learning

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.

Honest limits. Predictions are only as good as the probe set and the embedding model. For the sharpest results, configure a real embedding model and a judge model — see Routing & policy.

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.