Public beta Sharding enclave attested on Intel TDX. Real models answer through the API. Relay exits are planned. See what is live

Routing · · 3 min read

A router that picks the cheapest model measured to answer as well as the best.

Every model in the catalogue was sent the same 75 prompts and scored. The router reads a request, works out what kind of task it is, and picks the cheapest model whose measured accuracy on that kind of task is within 5% of the best. On 150 held-out prompts that gave 102% of the frontier model's quality at up to a 40% discount. It is live for every auto pick, through the API and in the dashboard, and the code, the measured figures and the benchmark are public.

What shipped

wispr-router is a library with no model in the loop and no dependencies. Given a request and a catalogue of models with prices, it classifies the request by its words, numbers, code and length (math, code, extraction over material, knowledge, writing, chat) and scores how hard it looks. The threshold for the task is the best measured accuracy minus a tolerance that shrinks as the request looks harder; the pick is the cheapest model at or above the threshold, or the fastest with prefer: 'speed'. If the answer comes back empty, as a refusal, cut off, or without a final number for a math task, escalate() says so and nextUp() names the next model up the ladder.

The quality figures in the catalogue are measured, not copied from vendor pages. bench/run.mjs --calibrate sends the same prompts to every model, scores the answers and writes the results into the catalogue. The router is as good as the measurement behind it, so the measurement ships with it.

It is live in WISPR. From today an auto pick, through the API and in the dashboard's Auto tab, takes the cheapest model measured to answer that kind of request as well as the model the gateway would have used, never a dearer one, with each figure taken at its lower bound for the number of prompts behind it; the same code runs inside the enclave for sharded requests. A pinned model, the frontier rule and the hosts a private shard may run on never change. X-Wispr-Route: speed takes the fastest measured model, off the catalogue order pick, and every routed shard on the receipt says which task it saw, which model measured best and what the pick saved.

Measured through the live API on 120 of the same held-out prompts, route on against route off: the one-call path kept 99% of its quality (-0.7 points, 95% CI [-2.2, +0.5]) at 86% of the cost: same answers, 14% cheaper, on the first day. On the sharded path, which the dashboard's Auto tab uses, a pick is also never more than twice as slow as the default, which keeps the explain shards on the default model; measured again with that guard live, the Auto tab answers at the default's cost, and the saving on that path grows as more families are measured. The gateway's defaults were already cheap models, which is why the live saving is smaller than the library's against a frontier model always.

routing
const r = route({ messages }, catalogue.models, { tolerance: 0.05 });
// r.model       'qwen3-32b'
// r.task        'extract'   r.difficulty 0.18
// r.estimateUsd 0.000091
// r.reason      'extract (difficulty 0.18): cheapest of 6 models measured at or above 0.92 on extract'

How we measured it

Calibration: seven catalogue models, 75 prompts each, 25 GSM8K maths problems, 25 SQuAD questions with their paragraph, and 25 of the same questions closed book. Evaluation: 150 different prompts from the same families, four arms, every call billed and timed by the API, temperature 0. The whole run cost $0.64.

ArmMathsExtract (F1)KnowledgeOverallCostQuality vs frontier (95% CI)
Frontier model always88%95.236%73.1$0.153100%
Cheapest model always88%94.426%69.5$0.08595%, -3.6 [-7.9, +0.8]
Router90%95.638%74.5$0.096102%, +1.5 [-1.6, +4.7]

The router sent 94 of the 150 prompts to the cheapest model and 55 to the frontier model. Every model measured near perfect on maths and extraction, so those went to the cheapest at no loss: a 58% saving on the maths prompts and 41% on extraction. Closed-book knowledge separated the models, so those went to the frontier model at its full price. Across the whole set that is 37% less money for the same quality, slightly better on this sample and inside the interval. Sending everything to the cheapest model saved more and lost 3.6 points, nearly all on knowledge. The full tables, per model and per family, are in the repository.

How to check it

terminal
npm i wispr-router                       # the library, MIT, no dependencies
node bench/run.mjs --dry                 # classify and route only: no model call, no cost
node bench/run.mjs --calibrate --write   # measure your own catalogue, write the figures in
node bench/run.mjs --eval                # router against always-frontier and always-cheapest

The code, the catalogue with its measured figures and every result file are at github.com/wisprxyz/wispr-router. The benchmark data is public and downloaded at run time, the sample is seeded, so a run can be repeated against any OpenAI compatible endpoint.

What it does not do

The classifier reads English and is heuristic; the benchmark measures the router end to end, mistakes included. The families measured are short-answer tasks with a gold answer, because those can be scored without a judge model, so the figures hold for those families and a new one (long-form writing, agentic tool use) needs its own calibration first. The cheapest model was also the slowest on this run, 8.8 seconds a prompt against 1.5 for the frontier model, which is what X-Wispr-Route: speed is for. Open-ended writing, code and chat are not measured yet, so those requests keep the default pick until they are; a quality figure is only worth the measurement behind it.