Agentix: An Efficient Serving Engine for LLM Agents as General Programs

Michael Luo (University of California, Berkeley, and Google DeepMind), Xiaoxiang Shi (Shanghai Jiao Tong University), Colin Cai (University of California, Berkeley), Tianjun Zhang (University of California, Berkeley), Justin Wong (University of California, Berkeley), Yichuan Wang (University of California, Berkeley), Chi Wang (Google DeepMind), Yanping Huang (Google DeepMind), Zhifeng Chen (Google DeepMind), Joseph E. Gonzalez (University of California, Berkeley), Ion Stoica (University of California, Berkeley)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 3 · Virtualization Revisited

Overview

The AI landscape has shifted dramatically from static, single-turn chatbot interactions to complex, multi-turn LLM agents operating as general software programs. Applications like Claude Code, Cursor, and sophisticated Monte Carlo Tree Search (MCTS) workflows execute dynamic control flows involving parallel sub-agents, tool invocations, and extensive conversation histories. However, existing Large Language Model (LLM) serving engines—such as vLLM and SGLang—remain fundamentally atomized. They treat every incoming LLM generation call as an isolated request, optimizing only for token throughput and single-call latencies while remaining entirely blind to the overarching program structure.

Watch on YouTube · Slides

Visual summary for Agentix: An Efficient Serving Engine for LLM Agents as General Programs by Michael Luo, Xiaoxiang Shi, Colin Cai, Tianjun Zhang, Justin Wong, Yichuan Wang, Chi Wang, Yanping Huang, Zhifeng Chen, Joseph E. Gonzalez, Ion Stoica
Visual summary for Agentix: An Efficient Serving Engine for LLM Agents as General Programs by Michael Luo, Xiaoxiang Shi, Colin Cai, Tianjun Zhang, Justin Wong, Yichuan Wang, Chi Wang, Yanping Huang, Zhifeng Chen, Joseph E. Gonzalez, Ion Stoica

Key moments

  1. 0:00 Introduction and background on LLM agents and serving
  2. 2:05 Anatomy of agent programs and their three key properties
  3. 5:20 Introducing AgentX: stateful LLM serving for agent programs
  4. 7:10 AgentX front end and the process table architecture
  5. 8:30 Load balancer policy for prefix cache hit optimization
  6. 10:15 Addressing head-of-line blocking with multi-level feedback queue
  7. 13:20 Evaluation setup and single/multi-engine performance results

Agentix: An Efficient Serving Engine for LLM Agents as General Programs

Speakers: Michael Luo (University of California, Berkeley, and Google DeepMind); Xiaoxiang Shi (Shanghai Jiao Tong University); Colin Cai (University of California, Berkeley); Tianjun Zhang (University of California, Berkeley); Justin Wong (University of California, Berkeley); Yichuan Wang (University of California, Berkeley); Chi Wang (Google DeepMind); Yanping Huang (Google DeepMind); Zhifeng Chen (Google DeepMind); Joseph E. Gonzalez (University of California, Berkeley); Ion Stoica (University of California, Berkeley)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=uwbqvWR2l6c

Overview

The AI landscape has shifted dramatically from static, single-turn chatbot interactions to complex, multi-turn LLM agents operating as general software programs. Applications like Claude Code, Cursor, and sophisticated Monte Carlo Tree Search (MCTS) workflows execute dynamic control flows involving parallel sub-agents, tool invocations, and extensive conversation histories. However, existing Large Language Model (LLM) serving engines—such as vLLM and SGLang—remain fundamentally atomized. They treat every incoming LLM generation call as an isolated request, optimizing only for token throughput and single-call latencies while remaining entirely blind to the overarching program structure.

This talk introduces Agentix, a novel stateful LLM serving engine designed specifically to treat LLM agents and general agentic programs as first-class citizens. Developed by researchers from UC Berkeley, Shanghai Jiao Tong University, and Google DeepMind, Agentix couples the application program layer with the underlying LLM serving layer. By tracking program-level metadata, maintaining a process table, and employing operating system-inspired scheduling and load balancing algorithms, Agentix optimizes macro-level metrics like program throughput and job completion time. The result is a 4x to 15x improvement in program throughput over vanilla vLLM under identical Service Level Objectives (SLOs), fundamentally bridging the gap between systems infrastructure and complex AI agent workflows.

Background

▶ Watch: Introduction and background on LLM agents and serving (0:00)

In the early paradigm of large language model deployments, workloads were dominated by simple request-response interactions. Users submitted prompts, and engines scheduled tokens using basic First-Come, First-Served (FCFS) policies. As the ecosystem matured into late 2024 and 2025, agentic frameworks like LangChain, LangGraph, AutoGen, and OpenAI Swarm gained prominence. These frameworks allowed developers to construct intricate loops where LLM outputs dictate tool executions, terminal commands, or multi-threaded sub-agent generation.

Despite this architectural evolution in application design, the foundational serving infrastructure remained stagnant. Standard inference engines analyze and schedule individual completion requests without knowing whether a given call belongs to a trivial user chatbot or a massive 160-call MCTS exploration tree. This decoupling creates severe inefficiencies. Long-running agent sessions cause head-of-line blocking for shorter tasks, and distributed parallel calls thrash the KV cache across multiple engine replicas. While systems like FastServe addressed request-level head-of-line blocking, and systems like Preble attempted prefix cache-aware load balancing, no existing framework accounted for the non-deterministic, highly dynamic, and distributed nature of general agent programs as cohesive entities.

Key Findings

▶ Watch: Introducing AgentX: stateful LLM serving for agent programs (5:20)

Agentix demonstrates that treating agent programs as unified workloads rather than disjointed API calls unlocks massive performance gains. The primary findings and contributions include:

  • Exponential Program Throughput Gains: Across diverse workloads—including chatbot interactions, ReAct paradigms using the Gorilla project's BFCL v3 dataset, and resource-intensive MCTS workloads—Agentix achieves 4x to 15x higher program throughput compared to vanilla vLLM at equivalent SLO latencies (seconds per token).
  • Workload-Aware Load Balancing: By tracking data locality at the program level, Agentix's load balancer achieves prefix cache hit rates comparable to complex tree-matching algorithms like Preble while operating with significantly lower overhead.
  • Makespan Reduction: In offline batch settings, Agentix reduces the total makespan—the time required for all program-associated LLM requests to complete—by up to 40%.
  • Mitigation of Head-of-Line Blocking: Empirical evaluations show that short LLM calls and short programs suffer from disproportionately high wait-to-execution ratios under standard FCFS policies. Agentix’s preemptive scheduling successfully eliminates this bottleneck.

Technical Deep Dive

▶ Watch: AgentX front end and the process table architecture (7:10)

Agentix introduces a comprehensive architectural stack that borrows heavily from classical operating system design, adapting OS principles to the constraints of neural network inference serving.

Front-End Interception and Metadata Annotation

When a user executes an agentic program via standard frameworks (LangGraph, AutoGen, or raw Python/TypeScript), it issues LLM calls using standard OpenAI-compatible chat completion endpoints. The Agentix Front-End package transparently intercepts these calls and enriches the request metadata with a Program ID and a Thread ID (to handle parallel or distributed sub-agent branches).

The Process Table

The Agentix back-end maintains a Process Table, directly analogous to an OS process table. It maps each Program ID to critical program-level metadata:

  • Total queuing time across all constituent LLM calls on the inference engine.
  • Cumulative runtime and execution history.
  • The designated Engine ID assigned to the program to ensure KV cache data locality.
  • The count of active parallel LLM calls for distributed execution topologies.

Stateful Load Balancing Policies

Routing requests across multiple engine replicas is governed by a two-tiered load balancing policy optimized for prefix caching:

  1. Short Requests: Characterized by low token generation counts, short requests maintain high prefix cache hit rates regardless of routing destination. Consequently, they are load-balanced to the least-utilized engine to maximize resource utilization.
  2. Long Requests: Heavy system prompts and deep conversation histories experience massive KV cache recomputation penalties if routed blindly. Agentix routes long requests based on program data locality, steering them toward the specific engine where prior calls from the same program were executed.

Preemptive MLFQ Scheduler

To combat head-of-line blocking at both the individual LLM call level and the program level, Agentix discards run-to-completion FCFS scheduling in favor of a Multi-Level Feedback Queue (MLFQ).

  • Least Attained Service (LAS) Approximation: Because program runtimes are non-deterministic and non-clairvoyant, Agentix approximates an optimal Shortest Job First policy by tracking cumulative execution time. A program's first LLM call enters at the highest priority queue. As a program ages and consumes more engine time, subsequent calls are relegated to lower-priority queues.
  • Gang Scheduling: For multi-threaded or distributed agent programs executing parallel calls, Agentix utilizes gang scheduling, forcing concurrent LM calls within the same program to share identical priority levels.
  • Critical Path Prioritization: Priority is assigned based on the program's longest critical path or longest-running thread observed thus far, ensuring that million-token context sessions (such as prolonged Claude Code sessions) do not starve short, interactive user requests.

Experimental Setup & Results

▶ Watch: Addressing head-of-line blocking with multi-level feedback queue (10:15)

The evaluation of Agentix encompasses four distinct workload categories designed to stress-test the system under realistic and extreme conditions:

  • Chatbot Agent Workloads: Simulating standard multi-turn conversational patterns.
  • ReAct Workloads: Utilizing the BFCL v3 dataset from the Gorilla project to test alternating tool execution and model generation loops.
  • Monte Carlo Tree Search (MCTS) Workloads: Operating over the WebShop dataset, representing highly resource-intensive execution graphs where an average program consists of 160 interconnected LLM calls.
  • Heterogeneous Mixed Workloads: Combining all three preceding workload types concurrently to emulate a production multi-tenant serving cluster.

Headline Numbers

  • Single-Engine Throughput: Under identical SLO constraints (measured in seconds per token relative to arrival rates), Agentix delivers a 4x to 15x increase in program throughput over vanilla vLLM, with the most pronounced advantages appearing under heterogeneous mixed workloads.
  • Multi-Engine Scaling: Maintaining consistent single-engine scheduling policies while incorporating program-aware KV cache data locality improves overall program throughput by 1.4x on average, and cuts tail latencies (95th and 99th percentiles) by a factor of 2x.
  • Makespan Efficiency: In offline processing modes, Agentix reduces total job completion time by up to 40%.

Practical Implications

▶ Watch: Evaluation setup and single/multi-engine performance results (13:20)

For infrastructure teams, model deployers, and AI systems architects, Agentix signals a paradigm shift: the boundary between application logic and serving infrastructure must be porous. Treating serving engines as isolated black boxes that only ingest stateless prompts leads to catastrophic resource waste when handling modern agentic loops.

Tradeoffs and Limitations

  • Integration Friction: While the front-end interceptor supports standard OpenAI endpoints and popular frameworks (LangChain, AutoGen), legacy systems tightly coupled to proprietary or non-standard APIs may require adapter layers.
  • Memory Overhead for Metadata: Maintaining the process table and tracking granular thread-level priorities introduces minor bookkeeping overhead within the serving engine, though this is vastly outweighed by the savings achieved through reduced KV cache recomputation.
  • Non-Clairvoyant Adaptability: While Agentix makes no prior assumptions about program runtimes—relying entirely on runtime statistics—its effectiveness depends on the program exhibiting sufficient call density for the MLFQ and LAS policies to accurately gauge priorities.

Key Takeaways

  • Agents as First-Class Citizens: Traditional LLM engines optimize for isolated tokens and calls; Agentix optimizes for macro-level program throughput and completion time.
  • OS-Inspired Architecture: By implementing a process table and an MLFQ preemptive scheduler, Agentix successfully eliminates head-of-line blocking for short tasks caused by long-running agent sessions.
  • Data Locality-Aware Load Balancing: Intelligent routing of long agent requests preserves KV cache locality, matching the performance of complex tree-matching algorithms with significantly lower system complexity.
  • Massive Performance Multipliers: Agentix achieves 4x to 15x higher program throughput and up to a 40% reduction in makespan across diverse workloads ranging from standard chat to complex 160-call MCTS trees.
  • Out-of-the-Box Generalization: Because Agentix intercepts standard API calls and operates non-clairvoyantly without prior workload knowledge, it integrates seamlessly with existing orchestration frameworks like LangGraph and AutoGen.

About the Speaker(s)

Michael Luo presented the work on behalf of a broad collaborative research team. He recently completed his Ph.D. at UC Berkeley SkyLab and holds affiliations with Google DeepMind. The author list features prominent researchers spanning systems and machine learning from UC Berkeley, Shanghai Jiao Tong University, and Google DeepMind, including co-authors Xiaoxiang Shi, Colin Cai, Tianjun Zhang, Justin Wong, Yichuan Wang, Chi Wang, Yanping Huang, Zhifeng Chen, Joseph E. Gonzalez, and Ion Stoica.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)