LLMRouter

LLMRouter

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

LLMRouter is an open-source library for intelligent LLM routing: instead of sending every query to one expensive model, it dynamically selects the most suitable model for each request based on task complexity, cost, and performance requirements, so you pay frontier prices only for questions that need them.

Overview

LLMRouter comes from researchers at the University of Illinois Urbana-Champaign and is developed on GitHub, where it has earned more than 3,000 stars under the MIT license, with active development through October 2026. The library formulates routing as a unified decision process spanning single-turn, multi-turn, and personalized scenarios, and ships more than 16 routing models organized into five categories: single-round, multi-round, multimodal, agentic, and personalized routers. Implementations range from KNN, SVM, and MLP routers to matrix factorization, Elo-rating, graph-based, and BERT-based approaches, plus hybrid probabilistic methods. A unified command-line interface covers training routers, running inference, and interactive chat through a Gradio UI. For researchers, LLMRouter includes a complete data generation pipeline that builds routing training data from 11 benchmark datasets with automatic API calling and evaluation, and it introduces xRouteBench, a benchmark covering generic LLM, memory-augmented, vision, time-series, and personalized routing, with joint evaluation of response quality and inference cost. It is equal parts production utility and research platform.

Key Features

  • Smart routing that balances response quality against inference cost per query
  • 16+ router implementations across five routing categories
  • Unified CLI for training, inference, and interactive chat with a Gradio UI
  • Data generation pipeline drawing on 11 benchmark datasets
  • xRouteBench benchmark for comparing routers on quality and cost jointly
  • Support for multimodal, multi-turn, agentic, and personalized routing scenarios

๐Ÿ’ณ Pricing

LLMRouter is free and open source under the MIT license. It can reduce your model API spend, but you still pay your providers for the calls it routes.

Who Is It For

LLMRouter is for platform engineers serving many models, researchers studying model routing, and product teams whose LLM bills would shrink if easy queries stopped going to the most expensive model by default.

๐Ÿš€ Visit LLMRouter Official Site

๐Ÿšฉ Report an issue