Route easy → cheap, hard → premium.
Two patterns: classifier-first picks a model up front, confidence-based escalates only when needed. Both cut spend by 80%+ vs naive routing to a single premium model.
Why bother — Most requests are easy
Production traffic distributions are wildly skewed. Across most chatbot + support traffic, ~60% of requests are factual lookup or simple formatting — a budget-tier model handles them perfectly. Routing those to claude-sonnet-4-6 is paying ~15× more than necessary.
The trick: a tiny model to decide which model to use. Or: try the cheap one first and escalate on low confidence.
Pattern 1 — Classifier first — Pick the model up front
A 7B model classifies the question difficulty. The classifier adds ~$0.000_05 per request — negligible compared to a sonnet call at $0.012.
Classifier-first routing
Failure mode: classifier mis-routes a hard question to the cheap model. Tune the system prompt to err on the side of escalation, or use the hybrid pattern below.
Pattern 2 — Confidence escalation — Try cheap, escalate on bail
Instructs the cheap model to respond with ESCALATE when uncertain. The cheap model gets a chance to handle every request; we only pay premium when it explicitly bails. ~5% escalation rate is typical for well-prompted setups.
Confidence-based escalation
Pattern 3 — Hybrid — Classifier + escalation
Use the classifier as a fast gate to route obvious hard requests directly to premium (no double-call overhead). For everything else, the cheap-with-escalation path applies. Best of both.
Hybrid — classify then escalate
Economics — Back-of-envelope
Economics — back-of-envelope per 10K requests
Production tips
- Track metadata — pass
metadata: {difficulty, path}on every call so the dashboard Usage page shows the routing distribution. Helps you tune the classifier prompt. - Monitor escalation rate — if it's >15%, your classifier is mis-routing too often. Tune the prompt or move to the hybrid pattern.
- Latency-conscious paths — the classifier adds ~200 ms. For latency-sensitive UX, prefer confidence escalation (single call cheap path, escalate only when needed).
- Cache the classifier — same question gets same classification. Run the classifier at
temperature: 0with the response cache on for its API key (opt-in, exact match, rolling out) so exact repeats can be served from Anoman's cache; hits are billed at the normal rate. - A/B test the threshold — split 5% of traffic to "always use premium" as a quality control. Compare end-user thumbs-up rate vs the routed cohort.
Track your routing distribution in the dashboard.
By-model breakdown with cost per route.