When to reach for it
- Request volume is high with mixed difficulty.
- Cost is a first-order constraint.
- A cheaper model handles a meaningful share of traffic without quality loss.
/pattern/resource-aware-optimization/
A router scores each request's complexity and dispatches it to the cheapest model that still meets the quality bar, under explicit token, time, and cost budgets, using prompt caching and model cascades.
When to reach for it
When it backfires
The tradeoff
Large cost savings are gained against the effort of tuning and continuously validating the complexity rubric.
A router scores request complexity and dispatches to the cheapest model that meets the quality bar; a failed quality check cascades up to a stronger model.
Asking the LLM 'how confident are you, 1–10?' to decide routing is hallucination-prone and unstable; the router itself becomes the weakest link.
Fix · Score complexity with a deterministic / statistical classifier (length, task type, historical difficulty) and validate routes against a quality signal rather than self-reported confidence.
Once most traffic is routed to the cheap model, regressions there go unnoticed — nobody is watching the cheap path.
Fix · Sample and evaluate cheap-path outputs continuously (golden tests / LLM-as-judge) and fall back to the strong model when the quality bar is missed.
A complexity rubric tuned for one model pair silently misroutes once a new, cheaper model matches the old expensive one — or a price change inverts the cost math.
Fix · Pin the rubric to a fixed evaluation set and re-benchmark whenever the model fleet or pricing changes; treat the rubric as versioned configuration, not a constant.
Keep going
Search patterns, frameworks, and pages.