Model Routing in depth
Designing a router step by step
A router is only as good as the evidence behind each route. The sequence we follow:
- Inventory the traffic. Sample real requests and group them by task: classification, extraction, short answers, long analysis, code, tool-heavy agent steps.
- Build an evaluation set per group. Include easy, typical and hard cases, with grading rules.
- Score candidate models on each group. Record quality, latency and tokens used. Often a smaller model matches a large one on some groups and falls short on others.
- Write the simplest routing rule that works. Rules by task type or endpoint are easy to explain and debug. Add a learned classifier only if rules leave clear gains on the table.
- Add escalation. When a smaller model's output fails validation, such as a schema check or a confidence threshold, retry on a stronger model.
- Ship with tracing. Record the route, model and reason for every request.
Example: a support assistant with three tiers
Example: a customer support assistant receives a mix of messages. A small model classifies intent and language. Order-status questions, which only need a data lookup and a short reply, go to the small model. General product questions with retrieved passages go to a mid-sized model. Complaints, refund disputes and long multi-part questions go to a frontier model, or to a reasoning model with a modest thinking budget. Requests containing sensitive personal data are pinned to a self-hosted model in the company's own cloud region, regardless of difficulty. If any provider returns errors or rate limits, the gateway falls back to a pre-approved alternative with an equivalent evaluation score.
Measuring whether routing pays off
Compare a routed setup with the simple alternative, everything on one strong model, on the same evaluation set and on live traffic:
| Measure | Why it matters |
|---|
| Quality per task group | Catches regressions hidden by a good overall average |
| Share of requests per route | Shows whether the lighter path is actually used |
| Escalation and fallback rate | High rates mean the first tier is too weak |
| Latency at high percentiles | Cascades add time when they escalate |
| Running cost per completed task | The real economic outcome, not cost per call |
Our agent running cost tool helps estimate how routing choices change the cost profile.
Common mistakes
- Routing on intuition without per-group evaluation.
- Fallback models that were never tested on the task, so an outage silently lowers quality.
- Prompts tuned for one model reused unchanged on another.
- Cache-unfriendly routing: switching models mid-conversation discards prompt cache benefits.
- No record of which model answered, which makes complaints impossible to investigate.
Where routing fits
Routing is part of LLMOps and usually lives in a model gateway. It works alongside prompt caching and token trimming as the main levers on token spend, and alongside data residency rules as a policy tool. Gepton designs routing in AI cost optimization and compares providers in technology and vendor evaluation.