TokenRouter:面向Token级LLM路由的高效服务系统

·

研究论文 · 2026/10/09

大语言模型(LLM)路由将推理工作分配到不同模型,推进LLM服务的成本-质量帕累托前沿。尽管会话或查询级别的粗粒度路由已在生产系统中广泛采用,但近期算法工作表明,细粒度的令牌级路由可带来显著的效率和质量提升。然而,高效服务令牌级路由推理对现有系统构成重大挑战。基于单LLM假设的当前系统在令牌级路由下遭受严重的步骤不同步和频繁的批处理准入延迟,并且对开发者施加高实现复杂度。为解决这些挑战,我们设计了TokenRouter,一个高效且开发者友好的令牌级路由LLM推理服务系统。TokenRouter遵循请求中心编程、模型中心执行的原则:开发者从单个请求的角度描述路由逻辑,而运行时为每个LLM启动一个子服务器并异步分派请求。每个子服务器采用延迟批处理调度器,其最优超参数从系统的数学吞吐量模型推导得出。在多样的路由算法、工作负载和模型对中,TokenRouter实现比现有系统高2.01-64.15倍的解码吞吐量,显著推进了令牌级LLM路由的服务效率。我们的代码可在https://github.com/thu-nics/TokenRouter获取。

该工作解决了令牌级LLM路由服务中的关键系统挑战,显著提升了解码吞吐量,并提供了开源实现,对LLM服务系统领域的研究者和工程师具有重要参考价值。

Large language model (LLM) routing distributes inference work across different models, advancing the cost-quality Pareto frontier of LLM serving. While coarse-grained routing at the session or query level has been widely adopted in production systems, recent algorithmic work shows that fine-grained token-level routing can yield substantial efficiency and quality gains. However, efficiently serving token-level routed inference poses significant challenges to existing systems. Built on single-LLM assumptions, current systems suffer from severe step desynchronization and frequent batch admission delays under token-level routing, and they also impose high implementation complexity on developers. To address these challenges, we design TokenRouter, an efficient and developer-friendly serving system for token-level routed LLM inference. TokenRouter follows the principle of request-centric programming, model-centric execution: developers describe routing logic from the perspective of a single request, while the runtime launches a subserver for each LLM and dispatches requests asynchronously. Each subserver employs a delayed-batching scheduler, whose optimal hyperparameters are derived from a mathematical throughput model of the system. Across diverse routing algorithms, workloads, and model pairs, TokenRouter achieves 2.01-64.15x higher decoding throughput than existing systems, substantially advancing the serving efficiency of token-level LLM routing. Our code is available at https://github.com/thu-nics/TokenRouter.

阅读原文

参与讨论