LearnThatStack Ace your next interview
AI System Design · question
Question 7 of 54

What is model routing, and what is a "cheap-first" cascade?

beginner
← All AI System Design questions
Re-explain

Model routing sends each request to the model that fits what the request needs. Small, cheap models handle easy work, and large models handle the hard cases. The router decides before the call, using rules, request length or a small classifier.

A cheap-first cascade decides after the fact instead. You always call the cheap model first and check its answer. You escalate to the stronger model only when that check fails.

async function cascade(prompt) {
  const draft = await call('small-model', prompt);
  if (passesCheck(draft)) return draft;   // most traffic stops here
  return call('large-model', prompt);     // escalation pays twice
}

The tradeoff is that an escalated request pays for both calls and both latencies. A cascade saves money only while the escalation rate stays low. The check must also be cheap, because a check that calls a big model to grade defeats the point.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for AI System Design One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens How interviewers actually use this question

Likely follow-ups

  • What would you use as the check in a cascade, given that it has to be cheap? Name cheap signals like schema or format validation, a refusal or empty-answer test, log-prob confidence, or a small classifier. Not a big-model grader.
  • At what escalation rate does a cascade stop saving money? Compare the cheap call plus the check on every request, plus escalation rate times the large call, against always calling the large model.
  • How does a cascade work with streamed responses? You can't stream a draft you might throw away, so users wait for the check. Say how you'd limit that, like cascading only calls that aren't streamed.
  • How would you build the router that picks a model before the call? Rules and request features first, then a small classifier trained on which requests the cheap model got right. It must cost less than it saves.
  • How do you check that routing isn't hurting answer quality? Run evals per route against a large-model baseline, sample drafts the check passed to catch false passes, and track quality, cost and latency together.

What you can say

  1. Model routing means sending each request to the model that fits it, so small cheap models take the easy work and large models take the hard cases.
  2. A router makes that choice before the call, using rules, the request length or a small classifier.
  3. A cheap-first cascade decides after the fact. It always calls the cheap model first and checks what comes back.
  4. If the answer passes the check, it goes straight back to the user, and most traffic should stop there. Only the failures escalate to the large model.
  5. The catch is that an escalated request pays for both calls and waits for both, so a cascade saves money only while the escalation rate stays low.
  6. The check also has to be cheap. If you grade every draft with a big model, you've lost the savings.

Weak answers to avoid

  • Treats routing and cascading as the same thing A router picks the model before the call. A cascade calls the cheap model first and escalates only when a check fails. Say which one decides when.
  • Claims a cascade always saves money Escalated requests pay for both calls and both latencies. Say the savings hold only while the escalation rate stays low.
  • Uses a big model to grade the draft That adds a large-model call to every request, so the cascade saves nothing. Name a cheap check, like format validation or a small classifier.
  • Talks only about cost, never quality A cheap model can give worse answers that still pass the check. Say how you'd measure quality per route, not just the bill.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the AI System Design cheatsheet.

← Back to all AI System Design questions
Pro · $10/mo

47 of 54 AI System Design answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime