xRouter: Training Cost-Aware LLMs Orchestration System via Reinforcement Learning

Cheng Qian, Zuxin Liu, Shirley Kokane, Akshara Prabhakar, Jielin Qiu +8 more
10/9/2025
cs.LGcs.AIcs.CL

No official code found. Best implementation: SalesforceAIResearch/xRouter (33 stars, Apache-2.0, last commit 2025-10-10).

Abstract

Modern LLM deployments confront a widening cost-performance spectrum: premium models deliver strong reasoning but are expensive, while lightweight models are economical yet brittle on complex tasks. Static escalation rules and keyword heuristics under-utilize this spectrum and fail to adapt across task types. We present xRouter, a tool-calling-based routing system in which a learned router can either answer directly or invoke one or more external models. The router is trained end-to-end with reinforcement learning using an explicit, cost-aware reward that encodes cost-performance trade-offs, eliminating the need for hand-engineered routing rules. Our implementation encompasses the full reinforcement learning framework, including reward and cost accounting, as well as the deployment and evaluation pipelines. Across diverse benchmarks, xRouter achieves strong cost-performance trade-offs (e.g., substantial cost reductions at comparable task completion rates), and provides empirical insights into what reliably helps learned routing and what does not, ranging from model trainability to the difficulty of eliciting sophisticated orchestration behaviors in small open models. We hope these findings and our open implementation will serve as a practical substrate for advancing learned, cost-aware LLM orchestration.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

xRouter: Training Cost-Aware LLMs Orchestration System via Reinforcement Learning

332C++, JinjaOct 6, 20251 years agoApache-2.0

Cite this paper

@article{qian2025xrouter,
  title  = {xRouter: Training Cost-Aware LLMs Orchestration System via Reinforcement Learning},
  author = {Cheng Qian and Zuxin Liu and Shirley Kokane and Akshara Prabhakar and Jielin Qiu and Haolin Chen and Zhiwei Liu and Heng Ji and Weiran Yao and Shelby Heinecke and Silvio Savarese and Caiming Xiong and Huan Wang},
  year   = {2025},
  eprint = {2510.08439},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.08439v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.08439.svg)](https://codeofpaper.com/paper/2510.08439)

Discussion