Mind the Delay: Latency-aware Query Routing for Heterogeneous LLM pools
Shivam Patel, Akaash R. Parthasarathy, Akash Dhasade, Ankur Mallick, Gauri Joshi
Abstract
Large language model (LLM) query routers typically assign each query to a suitable model that balances response accuracy and monetary cost. Subsequently, separate system-level load balancers based on policies such as join-the-shortest-queue or round-robin distribute the queries across replicas of each model to reduce latency. However, decoupling accuracy-cost and latency considerations can lead to suboptimal routing decisions. We introduce the Batch Evolution Aware (BEA) estimator to provide a fine-grained estimate of the latency, that is, the time-to-first-token (TTFT) experienced by an arriving query. Unlike existing load balancers that rely on coarse signals such as queue lengths, per-model processing rates, or historical average latencies, BEA replays the serving framework's token-batch formation using a snapshot of an instance's current workload, stopping when the incoming query's first token is generated. Taking into account the compute and memory requirements of the prefill and decode phases of language queries as well as the contention between multiple queries that are served in the same batch, BEA predicts TTFT within an error of approximately 5%. Each prediction takes about 0.1 ms, which is fast enough to run on the critical routing path. We also design an analytical framework for a model instance under a limited processor-sharing scheme that calculates expected TTFT in closed form and captures the qualitative trend of latencies as the load increases. The TTFT estimates produced by BEA are then used in our latency-aware router, BEAR, which simultaneously balances accuracy, cost, and latency to select the best model instance from a heterogeneous pool of LLMs. Against seven baselines, BEAR improves the utility of responses delivered within their targets by 63% on average over existing latency-aware routers, and by 30.5% over the best baseline at each arrival rate.
Create a lesson
Related papers
MeterRouter: Budget-Aware Dynamic Routing for Multi-Agent Systems
Shared title terminologycs.AIYue Xu, Leikun Yin, Ruiming Min et al.
TableRouter: Query-Aware Evidence Construction for Long-Table Question Answering
Shared title terminologycs.AIAnahita Bolourani, Xiaofeng Lin, Tung Sum Thomas Kwok et al.
STAR: Failure-Aware Markovian Routing for Multi-Agent Spatiotemporal Reasoning
Shared title terminologycs.AIRuiyi Yang, Lihuan Li, Hao Xue et al.
What Does Skill Lift Actually Measure? A Source-Code-Level Audit and Noise-Aware Reanalysis of SkillsBench
Shared title terminologycs.AIHaozhe Zhang, Zhen Long
Spectral Optimal Transport for Dynamics-Aware Sign Language Generation
Shared title terminologycs.AINabeela Khan, Bowen Wu, Runwu Shi et al.
P-FedSkill: A Personalized Federated Skill Learning Framework under Task Heterogeneity
Shared title terminologycs.AIZehang Lin, Jiayi Ji, Rongrong Ji