LLM Router
What is LLM Router?
An LLM router is a system that decides which language model should handle each request, sending simple requests to cheaper, faster models and complex ones to more capable models, to balance cost and quality.
Updated November 2026 · 2 min read
An LLM router is a system that decides which language model should answer each request, sending simple requests to cheaper, faster models and harder ones to more capable models. Most applications send everything to one model, which means paying top-model prices for simple questions or getting weak answers on hard ones. A router looks at each request and sends easy ones to a small, cheap, fast model and difficult ones to a larger, more capable model. Done well, it cuts costs substantially while keeping overall quality close to that of the best model.
Research such as RouteLLM, published in 2024 by researchers from UC Berkeley, Anyscale and LMSYS, showed that trained routers could substantially reduce costs while keeping most of the quality of the strongest model. Routing is now offered by AI gateways, model platforms and some model providers.
How does LLM routing work?
- Rules: route by feature, request type, user tier or prompt length. Simple and predictable.
- Classifiers: a small model predicts how difficult a request is, or which model will handle it best.
- Cascades: try the cheap model first and escalate to a larger model if the answer fails a quality check or the model reports low confidence.
- Cost and latency targets: choose the cheapest model that meets defined quality and speed thresholds.
- Availability: switch to another provider when one is slow or down.
How to build an LLM router
- Collect a representative set of real requests.
- Run them on several candidate models and score the results. See AI evaluation.
- Identify which requests cheaper models handle well.
- Choose a routing method and tune it to an acceptable quality level.
- Monitor cost and quality by route in production.
An example
Consider a hypothetical online bank's assistant, where all questions go to a frontier model. An evaluation of 3,000 past questions finds that a model costing a fifteenth as much handles 70% of them, mostly balance, card and transfer questions, with equal quality. The team builds a classifier to identify those questions and routes the rest, such as disputes and complex account issues, to the frontier model. It also adds a cascade: if the small model's answer does not cite a relevant help article, the question is retried on the frontier model. Routing 70% of questions to a model at a fifteenth of the price would cut model cost by about 65% on its own. After retries from the cascade and the classifier's own cost, model cost falls by about 60%, and customer satisfaction scores are unchanged.
Common pitfalls
- Routing without evaluation data, which risks sending hard questions to weak models.
- Router overhead: a large routing model can cost more than it saves.
- Not monitoring by route, so quality problems on the cheaper path go unnoticed.
Routing is often built into an AI gateway and is a key technique in AI cost optimization. It depends on having good small models available.
Frequently asked questions
How does an LLM router decide which model to use?
An LLM router can use simple rules based on feature, request type, user tier or prompt length, or a classifier that predicts how hard a request is. Cascades try a cheap model first and escalate if the answer fails a quality check. Routers can also pick the cheapest model meeting quality and speed targets or switch providers during outages.
How much can an LLM router save?
Savings depend on how much traffic cheaper models can handle well. If 70% of requests go to a model costing a fifteenth as much, model cost falls by about 65% before overhead. Escalations and the router's own running cost reduce that somewhat, so measure net savings and quality by route in production.
How do you build an LLM router?
Collect a representative set of real requests, run them on several candidate models and score the results. Identify which requests cheaper models handle well, choose a routing method and tune it to an acceptable quality level. Once the LLM router is live, monitor cost and quality separately for each route.
Related terms
AI Evaluation
Testing models against defined tasks so quality holds as costs come down.
AI Gateway
One control point for routing, metering and limiting every AI model call.
AI Cost Optimization
Getting the same value from AI for less, through models, usage and pricing.
Small Language Models
Compact models that cost far less to run and suit narrower tasks.