Abstract
Modern Large Language Model (LLM) agents frequently interact with external tools, yet current serving systems suffer from high latency due to a sequential "stop-and-wait" execution model. We present Conveyor, an LLM serving system that optimizes tool-aware workloads through "tool partial execution." By pipelining tool execution with the LLM's decoding process, Conveyor reduces request completion latency by up to 38.8%. This paper details the architecture of Conveyor, its novel tool interface, and empirical evaluations across diverse synthetic workloads.
Introduction
As LLMs transition from static text generators to active agents, they increasingly rely on external tools such as code interpreters, search engines, and databases. Standard serving systems treat tool calls as atomic, sequential events: the LLM must finish generating a complete command before the tool begins execution. This approach leads to significant hardware underutilization and increased user-perceived latency. For instance, in code generation tasks, the system remains idle while the LLM generates multiple lines of code that could have been executed incrementally.
Methodology: The Conveyor System
Conveyor addresses these inefficiencies by overlapping tool execution with LLM decoding. The system architecture comprises three primary innovations:
- Partial Execution Tool Interface: Developers define "indicators" (e.g., newlines or semicolons) that mark chunks of data ready for processing. This allows tools like Python interpreters to execute code line-by-line.
- Token-Granularity Scheduler: Unlike traditional batch schedulers, Conveyor monitors the token stream in real-time. Upon detecting a trigger indicator, it immediately dispatches the partial command to a tool executor.
- Stream-Aware Parser: This component manages the assembly of raw tokens into semantic structures and facilitates duplex communication between the LLM and external processes.
To prevent blocking the LLM's GPU-bound decoding iterations, Conveyor spawns tool executions in dedicated processes, bypassing common language-level bottlenecks like Python's Global Interpreter Lock (GIL).
Evaluation and Results
We evaluated Conveyor using Mistral-7B-Instruct-v0.2 and Functionary-Small-v2.2 across six synthetic workloads representing common agentic tasks: CodeGen, Search, Planning, Validation, Database, and Calculator.
Performance Gains
Conveyor demonstrated substantial latency reductions in tasks with significant tool execution times. Specifically, we observed improvements of 38.8% in Planning, 35.8% in Search, and 26.3% in CodeGen. The system effectively masks tool latency by hiding it behind the LLM's token generation time.
Workload Sensitivity
The benefits of partial execution are most pronounced when tool execution time and LLM decoding time are balanced. In workloads like Database and Calculator, where tool execution is near-instantaneous, the overhead of pipelining yields negligible gains. Conversely, the "Validation" workload highlighted a unique advantage: by validating tool arguments mid-generation, Conveyor can "fail fast," aborting hallucinated or malformed requests early. This resulted in a 376% improvement in successful throughput by saving compute resources on invalid requests.
Discussion and Limitations
While Conveyor offers significant speedups, its efficacy depends on tool design. Tools that require a complete, monolithic input (e.g., a full JSON object that cannot be parsed incrementally) cannot benefit from partial execution without refactoring. Additionally, for tools with extreme latency (e.g., long-running simulations), the relative gain from overlapping with a few seconds of decoding is minimal. Future work will explore how these benefits scale with much larger models where decoding times are longer, potentially offering even more room for tool execution overlap.
Summary updated