Inference costs for large language model (LLM) applications are rapidly growing, driven by surging demand and rising infrastructure cost. Users expect high-quality responses, and in commercial settings this is formally codified in Service Level Agreements (SLAs), creating a fundamental tension between cost and quality. Recent progress on cost-aware LLM request routing has shown potential to resolve this tension, but existing approaches rely on complete feedback signals, offline training, extensive per-workload tuning, and most lack SLA guarantees or inference-time adaptivity. We introduce SLARouter, an online routing algorithm that learns a cost-optimal policy from the sparse, one-sided user feedback available in production systems. SLARouter provides theoretical guarantees for both cost optimality and strict SLA compliance. Experiments across a wide range of LLM benchmarks show that SLARouter satisfies SLA constraints without the need for per-benchmark tuning, reducing operating cost by up to 2.2x over existing baselines.
Semi-Gradient SARSA Routing with Theoretical Guarantee on Traffic Stability and Weight Convergence
UM Joint Institute(UM联合研究所);Shanghai Jiao Tong University(上海交通大学);School of Computer Science, Wuhan University(武汉大学计算机学院);School of Electronics, Peking University(北京大学电子学院)
Department of Mechanical and Industrial Engineering, Northeastern University, Boston, MA 02115 USA(东北大学机械与工业工程系);Department of Electrical Engineering, Ulsan National Institute of Science and Technology, Ulsan 44919, Republic of Korea(乌山科学技术研究院电子工程系)