All Glossary Terms

Router

A router is a specialized classifier that determines which model, prompt template, or specialized expert should process a specific input to optimize for performance and cost.

Listen to this definition

Uses a voice available on your device

Audio options
On this page 5 sections
Related concepts 4 concepts

What it is

A router is typically a lightweight model, such as a small neural network or a regressor, that sits in front of your inference pipeline. When a request arrives, the router analyzes the input vector or text to predict which downstream model will provide the best result. This prevents wasting tokens or GPU cycles by routing simple queries to small models like Llama-3-8B and complex queries to larger models like GPT-4o. These routers often add less than 5 milliseconds of latency to the total request lifecycle.

Why it matters

Using a router allows you to decouple your feature requirements from a single monolithic model dependency. If you ignore routing, you likely overspend by using large, expensive models for tasks that a simple model handles with equal accuracy. Implementing this logic enables you to dynamically balance your operational budget against performance requirements without changing your application code.

In practice

In production, you define routing logic via conditional blocks or dedicated routing services like RouteLLM or custom classification heads. You monitor the accuracy and latency of the router itself, typically using metrics like classification precision and the cost savings realized per thousand tokens. When the router mispredicts, you observe sub-optimal responses or unnecessary latency spikes.

The tradeoff

The primary tradeoff is between the routing latency added to the request and the cost savings gained, with the risk that a poor routing decision forces a fallback to a higher-cost model.

Where it appears

Research summaries that use Router, each linked to its source paper.

  • Dynamic Routing for Efficient LLM Agents
    ProgRouter: Online Progress-Guided Orchestration for Multi-Agent LLM Workflows under Quality-Cost Tradeoffs

    ProgRouter optimizes multi-agent workflows by dynamically selecting models based on progress and cost to maximize task completion rates within defined energy budgets.

  • Improving MoE Model Steering Control
    RARE: Decoupling Representation Steering from Expert Routing in Mixture-of-Experts Language Models

    The paper introduces RARE, a method to steer Mixture of Experts models by decoupling control interventions from the model router mechanism to maintain performance and reliability.

  • Selective Safety Routing for Language Models
    CLEAR: Continuous Latent Adapter Routing for Utility-Preserving LLM Safety Alignment

    The paper introduces a routing mechanism that applies safety interventions only when harmful inputs are detected, preserving model utility for benign prompts.

  • Efficient AI Model Routing with Value Estimation
    Pandora's AI Model Routing Box: Efficient Allocation with Costly Value Estimation

    The paper introduces a routing framework that reduces computational costs by intelligently deciding when to pay for accurate model value estimates rather than using cheaper, noisier alternatives.

  • Dynamic Workflow Routing for Generative Agents
    GenRouter: Unified Workflow Routing for Agentic Image Generation

    GenRouter optimizes agentic image generation by dynamically routing prompts through a library of primitive operations to reduce latency and execution costs.

  • Removing Unwanted Concepts in Image Models
    MapRoute++: Surrogate-Guided Semantic Routing for Visual Concept Unlearning

    MapRoute++ provides a system for removing specific visual concepts from diffusion models using input-conditioned routing to redirect target tokens toward safe surrogates.

  • Intelligent Routing for Image Classification Models
    MLLM-Routed Heterogeneous Ensembles for Robust Cross-Dataset Image Classification

    The paper introduces ARMDIL, a system that uses an MLLM router to dynamically assign images to specialized vision backbones to improve classification accuracy.

  • Optimizing Model Routing for AI Tasks
    SCOPE-Router: Cost-Aware Open-Set VLM Routing for Execution-Oriented Tasks

    The paper introduces SCOPE-Router, a cost-aware system that assigns tasks to the most suitable vision-language models for execution-oriented workflows.

  • Efficient Multilingual Routing for Short Texts
    A Cost-Efficient Routing Pipeline for Multilingual Short-Text Classification Using Small Language Models

    The paper introduces a cost-aware routing strategy that selects between direct multilingual processing and translation-based English classification to optimize performance for weaker languages.

  • Distributed Training Without Sharing Private Data
    DistMoE: Private-data Rehearsal-free Routing in Mixture-of-Experts for Distributed Instruction Tuning

    DistMoE enables visual instruction tuning across distributed systems using a mixture of experts approach that eliminates the need to rehearse or share private datasets.

  • Optimizing LLM Inference Through Intelligent Routing
    CoBa: Cost-Effective Test-Time Scaling via Compute-Balanced Routing

    The CoBa framework maximizes LLM inference accuracy by intelligently routing compute resources between candidate generation, verification, and final selection.

  • Improving Multi-turn AI Agent Training Guidance
    When Privileged Guidance Misaligns: State-Matched Routing and Contextualized Self-Distillation for Multi-Turn Agents

    The paper introduces a routing method for multi-turn AI agents that selectively applies reference guidance only when the agent's current state aligns with known valid task paths.

  • Optimizing OCR for Multiple Historical Scripts
    Multi-Expert Routing for Multi-Domain Low-Resource OCR: A Manchu Case Study

    The authors implement a domain routing system that dispatches page images to specialized OCR models, enabling accurate text extraction across varied historical Manchu writing styles.

  • Standardizing LLM Router Development and Deployment
    LLMRouter: Unified Infrastructure for Developing, Evaluating, and Deploying LLM Routers

    LLMRouter provides a unified framework and automated data pipeline to build, evaluate, and deploy routers that select the most cost-effective LLM for a given task.

  • Optimizing Model Routing for AI Tasks
    SCOPE-Router: Cost-Aware Open-Set VLM Routing for Execution-Oriented Tasks

    The paper introduces SCOPE-Router, a cost-aware system that assigns tasks to the most suitable vision-language models for execution-oriented workflows.