Cut LLM bills by routing the easy stuff elsewhere
It exists to stop you from paying flagship-model rates for prompts that a smaller, cheaper model can handle just as well.

What it does RouteLLM is a framework that acts as a drop-in replacement for the OpenAI client—or as a standalone server—routing incoming prompts between a strong, expensive model and a weaker, cheaper one. It judges each query and sends routine prompts to the budget model, reserving the premium engine for work that actually needs it. The goal is to lower API costs without opening the quality trapdoor.
The interesting bit The framework ships with pre-trained routers, including a recommended matrix-factorization model, that were trained on GPT-4 vs. Mixtral preferences but generalize to other model pairs without retraining. You calibrate a cost threshold against your own query distribution to set exactly how much quality you are willing to trade for savings, turning routing from a guess into a dial.
Key highlights
- Claims up to 85% cost reduction while retaining 95% of GPT-4 performance on MT Bench.
- Provides five built-in routing strategies, from a lightweight
mfclassifier to a random baseline. - Presents an OpenAI-compatible API, so existing clients and tools can plug in without structural changes.
- Bundles an evaluation harness for MMLU, GSM8K, and MT Bench to compare strategies head-to-head.
- Supports a wide range of providers and local models through LiteLLM integration.
Caveats
- The
mfandsw_rankingrouters require an OpenAI API key for embeddings even when neither endpoint is OpenAI. - Threshold calibration depends heavily on how closely your query distribution matches the calibration dataset; out-of-the-box settings may drift in production.
Verdict Teams running high-volume applications with a clear split between a strong and a weak model will get the most mileage. If you are already committed to a single model or your traffic is too heterogeneous to threshold cleanly, this adds complexity without clear payoff.
Frequently asked
- What is lm-sys/RouteLLM?
- It exists to stop you from paying flagship-model rates for prompts that a smaller, cheaper model can handle just as well.
- Is RouteLLM open source?
- Yes — lm-sys/RouteLLM is open source, released under the Apache-2.0 license.
- What language is RouteLLM written in?
- lm-sys/RouteLLM is primarily written in Python.
- How popular is RouteLLM?
- lm-sys/RouteLLM has 5.2k stars on GitHub and is currently holding steady.
- Where can I find RouteLLM?
- lm-sys/RouteLLM is on GitHub at https://github.com/lm-sys/RouteLLM.