1:1 mentoring with Big Tech AI engineers
System Design

Model Routing

Choosing a model tier per request: the tier table at current prices, the bill by mix, the operating point where a cheap wrong answer costs more than the price gap, the cascade's escalation break-even and the fail-over target.

Last updated

Production12 min readFirst readYour First Agentic SystemSemantic Caching

After this section you can

  • Price a routed mix from one tier table
  • Find the operating point and the cascade break-even
  • Choose a fail-over target by the cause of the failure
08

Model Routing

Price a routed mix, find where a cheaper tier stops paying, and pick the fail-over target by cause.

Key idea

Spend the cheaper levers first: cache, then effort. Route down only while the extra wrong answers cost less than the price saved.

One router, four tiers: the first step up costs 20 times
ONE CALL, 800 IN, 250 OUT PRICE PER CALL, TO SCALE Request one call 800 in, 250 out Router one tier per call Cheap Haiku 5.5 $0.000205 Main Sonnet 5.5 $0.0041 Hard Opus 5.5 $0.0082 Top Fable 5.1 $0.0205 ×20 ×2 ×2.5 $0 $0.005 $0.01 $0.015 $0.02

Per call at 800 input and 250 output tokens, list price. Thinking left out. Pans sideways on a phone.

Related

More in System Design

Get full access to all 149 sections with code examples, diagrams, and interactive animations.

Unlock Premium