做LLM Agent服务部署和优化的团队,终于有了一个低成本、高精度的模拟工具来测试调度和缓存策略,不用再烧GPU时间试错,建议直接看论文细节。
多轮LLM Agent服务将无状态请求处理转变为有状态程序执行,需要调度、KV缓存管理和路由策略利用程序级上下文。直接在真实系统上评估这些策略成本高昂,而现有模拟器仅针对无状态请求。AGENTSERVESIM 是一个硬件感知模拟器,通过程序编排器、工具模拟器、会话感知路由器和KV驻留模型等模块,在程序粒度上评估服务策略。在真实部署和硬件配置下,AGENTSERVESIM 在关键性能指标上误差小于6%,且完全在普通CPU上运行。该工具使得无需在昂贵加速器上大规模部署即可进行可控、可重复的Agent服务策略探索。
AGENTSERVESIM: A Hardware-aware Simulator for Multi-Turn LLM Agent Serving
Multi-turn LLM agents interleave model calls with external tool invocations, shifting serving from stateless request processing to stateful program execution. Serving these workloads requires scheduling, KV-cache management, and routing policies that use program-level context, including turn dependencies, tool-induced gaps, and reusable KV state. Evaluating such policies directly on real systems is costly, since each design point may require dedicated accelerator time across arrival rates, model scales, serving-instance counts, and memory hierarchies. Simulation offers a scalable alternative, but existing LLM serving simulators target stateless request-level workloads and therefore omit the core dynamics of agent serving: multi-turn program execution, cross-turn cache locality, and KV-cache residency during tool gaps. We present AGENTSERVESIM, a hardware-aware simulator for multi-turn LLM agent serving. AGENTSERVESIM evaluates serving policies at program granularity through composable modules: a Program Orchestrator preserves program identity and turn order, a Tool Simulator materializes tool-induced gaps, a Session-Aware Router maintains program-to-instance affinity for cache-aware dispatch, and a KV Residency Model tracks policy-defined KV placement across HBM, host DRAM/CXL, and eviction. Across real serving deployments and hardware configurations, AGENTSERVESIM reproduces real-system behavior within 6% error across key performance metrics while running entirely on commodity CPUs. These results show that AGENTSERVESIM enables controlled, repeatable exploration of agent-serving policies without requiring exhaustive deployment on costly accelerators.