Model Routing
Send easy tasks to cheap models and hard tasks to strong ones automatically.
In plain words
Easy questions go to a cheap, fast AI, and hard ones go to the expensive, smart AI, so you save money without lowering the quality much.
Think of it like…
A hospital triage desk: minor complaints go to a nurse practitioner, complex cases go to a specialist, and a wrong triage is costly in either direction, so the desk is audited against outcomes.
Where you’ve seen it
Illustrative prices: large model $2.50 / $10 per million input / output tokens, small model $0.15 / $0.60. A typical request (3,100 input, 420 output tokens) costs $0.01195 on the large model and $0.000717 on the small one. The team labels traffic: 65% is easy (the small model resolves 94% of these versus 97% on the large model) and 35% is hard (large model 77%). Large-only quality is 0.65 × 0.97 + 0.35 × 0.77 = 90.0%. A trained classifier router (about $0.0002 per request) sends the easy 65% to the small model: blended LLM cost 0.65 × 0.000717 + 0.35 × 0.01195 = $0.00465, plus the router, $0.00485, a 59% saving. Quality becomes 0.65 × 0.94 + 0.35 × 0.77 = 88.1% (down 1.9 points), so cost per resolved request falls from $0.01328 to $0.00551 (−58.5%). The team decides the 1.9-point drop is acceptable for support, but keeps billing-dispute questions on the large model by rule.
Words you’ll hear
- Router
- A component that picks a model for each request before generation.
- Cascade
- Try the cheap model first and escalate to a stronger one when a check fails.
- Escalation rate
- The share of requests that cascade up to the strong model.
- Misrouting cost
- The quality loss when a hard request is sent to a weak model.
Visual diagram
Theory & deep dive
Router designs and signals
Rule-based routers use cheap signals: intent from the UI (a button versus a free-text box), input length, presence of code or tables, language, customer tier, and risk category (payments, legal, medical). They're transparent and fast. Classifier routers train a small model (logistic regression on embeddings, or a fine-tuned small transformer) on labelled examples of which model succeeded, predicting difficulty or the probability that the small model is good enough. LLM routers ask a small model to rate difficulty, which is flexible but adds latency and cost. Learned routers (trained on preference or outcome data) can tune the cost-quality trade-off with a single threshold.
A cascade runs the cheap model first and escalates when a check fails: invalid JSON, a refusal or "I don't know", low token log-probabilities, disagreement between two cheap samples, a failed rule, or a verifier model's low score. Expected cost = c_small + p_escalate × c_large (+ verifier cost), and latency is paid twice on escalations. Cascades suit tasks with cheap, reliable verifiers (code that must pass tests, extractions that must match a schema); routers suit tasks where difficulty is predictable from the input.
Small $0.000717, large $0.01195. If 25% of requests escalate: expected cost = 0.000717 + 0.25 × 0.01195 = $0.00370, plus a verifier at $0.0003 = $0.00400, about 67% cheaper than large-only, while escalated requests take roughly 1.3 to 2 times longer.
Evaluating and operating a router
Evaluate the whole system, not each model in isolation: replay a labelled golden set (with difficulty and risk tags) through the router and report quality per route and per tag, the escalation or misrouting rate, cost per request and cost per successful request, and latency percentiles. Examine the confusion matrix of the router itself: hard requests sent to the small model (the costly error) versus easy requests sent to the large model (wasted money). Choose the threshold on the cost-quality curve, setting a minimum quality floor per risk tier rather than one global number.
In production, monitor drift (the mix of easy and hard traffic shifts, models change versions), sample a few percent of cheap-route outputs for judge and human review, and keep a manual override and a kill switch that sends everything to the strong model. Keep prompts compatible across models (tool schemas, output formats) or maintain per-model prompt variants and test each. Remember the hidden costs: router latency, maintenance of labels, and engineering complexity; below a modest spend, a single mid-sized model may be simpler and good enough.
Router sends 8% of hard requests to the small model, where success drops from 77% to about 50%. On 35% hard traffic, that is 0.35 × 0.08 × 0.27 ≈ 0.8 points of quality lost, a number that appears in the per-bucket report but not in a blended average.
How it works, step by step
Step 1 of 41. Segment and label traffic
Tag a golden set by difficulty and risk and measure each model's quality per segment.
- Large
- 97% easy · 77% hard
When to use it & trade-offs
What it is
Model routing sends each request to the cheapest model that can handle it well: easy, high-volume requests (classification, extraction, FAQ answers) go to a small, fast, inexpensive model, and hard ones (multi-step reasoning, ambiguous or high-stakes cases) go to a strong model. Two main designs exist: a router that decides before calling any model (rules, a trained classifier or a small LLM), and a cascade that calls the cheap model first and escalates if a verifier, confidence signal or format check says the answer isn't good enough. The goal is to cut cost and latency while keeping quality within a measured tolerance.
Why it matters: Model prices differ by one to two orders of magnitude, and most production traffic is easier than the hardest case. Sending everything to the biggest model overpays for the majority of requests; sending everything to the smallest one fails the hard minority. Routing captures the savings without a blanket quality drop, but only if you measure the quality of each route, because a bad router silently degrades the hard cases.
When to reach for it
- High-volume mixed-difficulty workloads
- Cost control without moving everything to a weaker model
- Risk-tiered handling of sensitive intents
When to avoid or be careful
- Routing without per-route quality measurement
- Sending high-stakes topics down the cheap path
- Building a router for low-volume traffic where the complexity outweighs savings
Routing approaches
Strengths: Transparent, instant, no extra model.
Watch out: Brittle for subtle difficulty differences.
Strengths: Tunable threshold; cheap inference.
Watch out: Needs labelled outcomes and retraining.
Strengths: Catches failures by construction.
Watch out: Extra latency on escalations and verifier cost.
Interview signals & numbers to know
When this topic comes up
- “Do we need the biggest model for everything?”
- “Our LLM bill is dominated by simple requests”
- Cheap-to-strong cascade
- Escalation rate
- Cost per successful request
Benchmarks & rules of thumb
- $0.01195 vs $0.000717
- per-request cost on large vs small model in the example
- −59%
- cost saving with a router
- 1.9 pts
- quality given up for that saving
Common mistakes & follow-ups
Common interview mistakes
- Reporting only the blended quality and missing a hard-case collapse.
- Forgetting that a cascade pays latency twice on escalations.
- Letting prompts diverge so the fallback model behaves differently than tested.
Likely interviewer follow-ups
- How would you decide which requests go to the cheaper model?
- What are the trade-offs between a router and a cascade?
- How would you monitor a router in production?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply Model Routing with generative AI interview Q&A and hands-on practice.