What is LLM Router?

A platform team sends every request to a large language model, even when a smaller model could handle simple tasks. The team wants to cut inference costs without lowering the quality of answers that users receive.

An LLM router is a component that decides, for each request, which large language model or provider should handle it. The router uses rules or a learned model to weigh expected answer quality against cost, latency or data restrictions, and sends each request to the model it expects to meet the team’s requirements for that task.

An LLM router is only as good as the evidence behind its choices. The team needs to run the same test cases on every candidate model to compare their results fairly. An evaluation set, described in CUBIG’s glossary, gives the team a consistent basis for that comparison.

How is an LLM router different from an LLM cascade?

An LLM router picks a model before any model processes the request. A cascade sends the request to a cheaper model first, then moves to a stronger model when the first answer fails a quality check.

FrugalGPT, proposed by Chen, Zaharia and Zou in 2023, describes three strategies for reducing LLM inference costs: prompt adaptation, LLM approximation and LLM cascade. Their cascade learns which combinations of models to use for different queries. In their experiments, FrugalGPT matched the performance of the best individual model, such as GPT-4, with up to 98% lower cost.

The main difference is timing: a cascade adds a second decision point after the first model responds.

How does an LLM router decide where to send a request?

An LLM router can use fixed rules or a learned model to select a destination. A platform team can define rules based on the task type, data classification or latency budget. For example, the team can reserve a stronger model for tasks that need more detailed reasoning and send simpler requests to a smaller model.

A learned router uses data to predict which model can handle a request at an acceptable cost and quality. RouteLLM, proposed by Ong et al. in 2024, uses human preference data and data augmentation to train router models that dynamically select between a stronger and a weaker LLM during inference.

Ong et al. (2024) report that their approach cut costs by more than 2x in certain cases on widely recognized benchmarks, without compromising response quality. They also report that the routers kept their performance when the researchers changed the stronger and weaker models at test time.

The RouteLLM results show that learned routing can work, but the reported savings depend on the benchmarks and models in the study. A platform team still evaluates routing decisions against its own tasks, quality requirements and operating costs.

What should a team check before putting an LLM router into production?

A platform team can verify the routing policy against real task requirements before sending production requests through it:

  • Compare candidate models on the same evaluation cases. Run every candidate model against the same test cases and define acceptance criteria for each task. A model that performs well on summarization may not meet the requirements for classification or complex reasoning.
  • Define which data each model can receive. Decide which data may go to each model or provider before configuring routing rules. Teams can start from which data may leave the company and check what a provider’s zero data retention arrangement covers.
  • Log every routing decision. Record which model or provider handled each request, so the team can trace results, investigate unexpected answers and see which routing decisions affected cost or latency.
  • Repeat evaluations when conditions change. Run the same test cases again when a model, its price or a prompt changes. A routing policy that worked with an earlier model version may no longer meet the team’s quality or cost requirements.

Before estimating savings from any published result, each team measures routing performance on its own tasks.

Frequently asked questions

What is an LLM router?

An LLM router selects which large language model or provider should handle each request, based on expected answer quality, cost, latency or data restrictions.

How is an LLM router different from an LLM cascade?

A router selects a model before processing a request, while a cascade starts with a cheaper model and moves to a stronger one if the first answer fails a quality check.

How can an LLM router reduce costs?

It sends requests to smaller or less expensive models when those models meet the team's quality criteria for the task. Savings reported in research depend on the benchmarks and models studied, so teams measure on their own tasks.

What should teams check before deploying an LLM router?

Compare candidate models on the same evaluation cases, define which data each model or provider may receive, log routing decisions and repeat evaluations when models, prices or prompts change.