Universal Model Routing for Efficient LLM Inference

Wittawat Jitkrittum, Harikrishna Narasimhan, Ankit Singh Rawat, Jeevesh Juneja, Congchao Wang, Zifeng Wang, Alec Go, Chen-Yu Lee, Pradeep Shenoy, Rina Panigrahy, Aditya Krishna Menon, Sanjiv Kumar

TL;DR

UniRoute is a novel framework for "dynamic" model routing that can handle new, unseen Large Language Models (LLMs) at test time without needing to retrain the router. By representing LLMs as feature vectors based on their error patterns across prompt clusters, UniRoute achieves significant cost savings while maintaining high performance across diverse benchmarks.

The Challenge of Dynamic Routing

Large Language Models are powerful but computationally expensive to run. Model routing has emerged as a popular strategy to mitigate this cost: developers maintain a "pool" of models—ranging from tiny, cheap models to massive, expensive ones—and use a "router" to send each prompt to the cheapest model capable of answering it correctly.

However, existing routers are static. They are trained for a specific, fixed set of models. In the fast-moving world of AI, where new models are released weekly, this is a major bottleneck. Adding a new model to a static router typically requires retraining the entire system, which is computationally expensive and requires gathering a large amount of labeled data for the new model.

This paper tackles the challenge of dynamic routing: building a router that can seamlessly incorporate a brand-new LLM it has never seen before, evaluating its capabilities on the fly.

Introducing UniRoute

The authors introduce UniRoute, a framework that shifts the routing logic from identifying specific model IDs to identifying model capabilities.

Overview of the UniRoute framework, illustrating how prompt embeddings and LLM error profiles are combined to route queries to the most cost-effective model.

UniRoute operates through a few key mechanisms:

  1. LLM Feature Representation: Instead of treating a model as a black-box ID, UniRoute represents each LLM as a feature vector. This vector is created by evaluating the model on a small "validation set" of representative prompts and recording its success or failure (the "prediction error vector").
  2. Prompt Clustering: To make sense of these errors, UniRoute groups prompts into $K$ clusters (using K-means on text embeddings). This allows the system to understand model strengths contextually—for example, recognizing that a model excels at "coding" clusters but struggles with "creative writing" clusters.
  3. The Routing Rule: At test time, when a new prompt arrives, the system calculates the expected error for each available model based on the prompt's cluster. It then chooses the model that minimizes a combination of error and cost, controlled by a penalty parameter ($\lambda$).

The paper details two instantiations of this approach:

  • UniRoute (K-Means): A simple version that routes a prompt to the model with the lowest cost-adjusted average error for the prompt's assigned cluster.
  • UniRoute (LearnedMap): A more advanced version that uses a small neural network (MLP) to learn a better mapping between a prompt’s embedding and its cluster membership, improving overall routing accuracy.

Key Insights

  • Error Profiles as Identity: The core "aha moment" of UniRoute is that an LLM's "identity" for routing purposes isn't its name or architecture, but its error profile across different types of tasks. Two models with similar error vectors are effectively interchangeable for the router.
  • Generalization via Clusters: By training the router on a set of "training models" to recognize which clusters are difficult, the router learns a universal logic that applies even to "test models" it has never seen.
  • Avoiding the Overfitting Trap: Simply retraining a standard router on a few examples of a new model (the naive approach) often leads to overfitting. UniRoute avoids this by using the training models to build a robust backbone of cluster-based knowledge.
  • Theoretical Grounding: The paper provides an "excess risk bound," mathematically proving that the quality of the routing depends on how well the average cluster error represents the error on an individual prompt.

Evaluation and Results

The researchers evaluated UniRoute on an impressive array of benchmarks involving over 30 different LLMs, including EmbedLLM (a massive collection of 112 LLMs), RouterBench, SPROUT, Math+Code, and Chatbot Arena.

UniRoute consistently outperformed existing dynamic baselines like K-Nearest Neighbors (K-NN) and randomized routers:

  • Cost Efficiency: On the EmbedLLM benchmark, UniRoute achieved the same quality as the most accurate model in the pool while only spending 33.1% of the cost (Quality-Neutral Cost).
  • Zero-Shot Capability: The system successfully routed prompts among 30+ models that were entirely absent during the router's initial training phase.
  • Robustness: It remained effective even when the "validation set" used to characterize new models was very small (e.g., only a few hundred prompts), making it highly practical for real-world deployment.

Limitations and Future Work

While highly effective for dynamic environments, the authors note that in a purely static environment (where the model pool never changes), specialized static routers might still have a slight edge because they don't have to generalize. They suggest "hybrid" routers as a future direction.

Additionally, UniRoute's performance depends on the validation prompts being representative of actual traffic. Currently, random sampling is used, but "coreset selection" (finding the most informative prompts) could further improve the LLM feature vectors. Finally, while embedding a new LLM is a one-time cost, it still requires initial black-box access to the model's outputs to generate its feature vector.

Summary updated

BibTeX
@inproceedings{jitkrittum2026universal,
  author = {Wittawat Jitkrittum and Harikrishna Narasimhan and Ankit Singh Rawat and Jeevesh Juneja and Congchao Wang and Zifeng Wang and Alec Go and Chen-Yu Lee and Pradeep Shenoy and Rina Panigrahy and Aditya Krishna Menon and Sanjiv Kumar},
  title = {{Universal Model Routing for Efficient LLM Inference}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=ka82fvJ5f1},
}
Figure