RouteLLM
Framework for routing queries between strong and cheap LLMs to cut costs with minimal quality loss.
About
The LMSYS team behind Chatbot Arena built RouteLLM on a simple observation: most queries do not need the most expensive model. The framework serves and evaluates learned routers that send each prompt to either a strong or a weak model, and its paper reports cost reductions up to 85 percent while preserving 95 percent of GPT-4 performance on MT-Bench, matching commercial routing products while being over 40 percent cheaper. Four pretrained routers ship out of the box: matrix factorization (the recommended default), Elo-based similarity-weighted ranking, a BERT classifier, and an LLM-based causal classifier, all trained on preference data released alongside the router models on Hugging Face. It installs with pip install routellm[serve,eval], acts as a drop-in replacement for the OpenAI client or runs as an OpenAI-compatible server, and includes an evaluation harness for MMLU, GSM8K, and MT-Bench. The code is Apache-2.0 licensed with about 5.3k GitHub stars, and the accompanying paper is on arXiv (2406.18665) for teams weighing routing against fine-tuning for cost control.
Should you use RouteLLM?
Pick it when
Your app spends heavily on a frontier model and many prompts are easy, so a learned router that sends each query to either a strong or a cheap model can cut cost; it also suits teams benchmarking routing on MT-Bench or GSM8K.
Look elsewhere when
Skip it if you need multi-provider failover, spend tracking, or more than a two-model choice, where LiteLLM fits better. It routes, it does not serve, and its routers learn from general preference data, so test them on your traffic.
Alternatives to RouteLLM
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- LLM Inference & Serving
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Intermediate (3/5)
- License
- Apache-2.0
- Added
- Jul 29, 2026