Manuscript Offprint

arXiv:2610.19822

JointServe: Serving Multi-Model Agents on Memory-Constrained GPUs

Daijin Hu

Abstract

LLM agents are evolving from a single model calling tools to planners that orchestrate multiple expert models whose capabilities live in distinct weights. This shift breaks a hidden assumption of today's serving systems—that the working set of models fits in GPU memory. On the memory-constrained GPUs typical of private and edge deployments, naive whole-model swapping serializes weight transfer with computation and, without host-backed KV restoration, discards session state at a switch.

We present JointServe, a serving system that treats weight shards and KV blocks as residency objects competing for one unified memory budget. JointServe exploits three structural properties of agent workloads—directed calls, gapped execution, and dual-state residency—to prepare models before they are called: an intent signal parsed from the caller's own output stream triggers prefetch during generation, partial k* residency reduces switching to incremental layers, and a preemptive transfer scheduler protects live-session KV with a guaranteed bandwidth share. A carve-out control step adjusts the weight/KV allocation as workload demands change.

Evaluations show that JointServe reduces session completion time by 21.7% over the strongest whole-model swap baseline and stays usable in a crash regime where every whole-model swap baseline fails to finish (a 46× gap). On replayed SWE-bench, τ-bench, and OSWorld traces, it cuts session completion time by up to 49% and lifts SLO attainment from 2.8–24.5% to 76.8–100%.

Keywords: Large Language Model Serving, Multi-Model Agents, GPU Memory Management, KV Cache

1 Introduction

Large language models are moving beyond single-turn question answering toward multi-agent systems that plan, act, and revise over long horizons [24, 29, 52, 60]. Agents resolve repository issues end to end [23, 42, 49], and multi-agent systems distribute planning, coding, and reviewing roles across collaborating models [13, 19, 32, 40, 44]. A recurring architecture has emerged from these systems: a general-purpose planner model orchestrates a pool of domain-specialized expert models [36], invoking an expert much as earlier agents invoked an external tool [31, 34, 41]. The difference is where the capability lives. A tool exposes an interface; an expert's

Figure

(a) Naive loading

(b) INT4 co-residency

(c) JointServe(Ours)

Figure 1. (a) Naive loading: the request waits for the model weights to be transferred sequentially before prefill begins. (b) INT4 co-residency: all quantized model weights remain simultaneously resident in GPU memory. (c) JointServe: intent-guided shard prefetch before request arrival eliminates the waiting phase.

coding, mathematical, or multimodal competence is baked into its weights, and no prompt can elicit a capability from a model that is not loaded. Serving these workloads therefore means serving many models on demand, not one model well.

Serving an expert pool requires memory for both model weights and the state of active agent sessions. Private, edge, and shared-GPU deployments typically offer one or two 80 GB-class accelerators, while the combined weights of even a modest expert pool overflow a single GPU. Session state compounds the pressure: as an agent task deepens, the key-value (KV) cache of each session grows with every turn, so weights and KV blocks contend, physically and unavoidably, for the same bytes of HBM. The cost of this contention lands on two user-visible metrics that we use throughout the paper: time to first token (TTFT), which governs the interactivity of each model call, and session completion time (SCT), the wall-clock duration of an entire agent task. The core challenge is not raw capacity; it is deciding which bytes should reside in scarce memory, and when they should move.

What happens when the planner calls an expert that is not resident? In a naive whole-model swap path, the serving stack must first make room in HBM, and then the entire weight footprint of the target model streams in before prefill can begin. This is a load-all barrier: until the last layer is in place, the first token cannot be produced (Figure 1(a)). Loading is not the only tax. When the session later switches back to a model whose KV blocks were evicted to make room without a host copy, that state is gone, and the context must be re-prefilled from scratch. A single cross-model call therefore pays twice: once in serial weight transfer on the way out, and once in KV recompute on the way back. The first tax alone reaches second scale on current hardware and grows linearly with model size, with the GPU idle throughout; we quantify both taxes precisely in §2. These costs characterize the naive path in Figure 1(a): weights move at whole-model granularity, and evicted KV is not preserved for fast restoration.

Prior work addresses different parts of this trade-off. Whole-model loading and session-aware placement reduce switch and return costs. ServerlessLLM [11] accelerates checkpoint loading. Talaria [28] routes continuations using model residency, KV locality, and instance pressure; soft reservations, host-restorable KV, and staged weights preserve session continuity across model switches. Talaria's cold pool still switches at model granularity. JointServe instead selects resident weight layer groups and KV blocks within one constrained GPU and prefetches missing groups before a named call. Quantized co-residency (Figure 1(b)) removes swaps by shrinking weights [6, 8, 16, 35, 46], but merely relocates the contention: the bytes freed by quantization are reclaimed by growing KV, the scheme fails outright when even compressed weights do not fit, and it carries accuracy risk. Same-family compression shares a base model across adapters or deltas [5, 7, 14, 37, 53], an assumption that breaks in heterogeneous expert ecosystems whose architectures, vocabularies, and tokenizers differ. Passive caching, from LRU eviction to prefix reuse [58], decides what to keep from past reference statistics alone; blind to which model comes next, it discards the call-graph priors that agent workloads expose for free. These approaches improve different scheduling and memory costs, but leave open how one memory-constrained GPU should jointly select weight shards and session KV as demand changes.

This paper tackles exactly one question: under a single GPU’s tight memory budget, which bytes, weight shards or KV blocks, should reside, when should they move, and on whose signal? Our goal is to have both: the capacity headroom of aggressive swapping and the interactivity of full residency, without paying for one with the other.

Talaria uses session-aware placement and admission across serving instances [28]. JointServe instead manages weight shards and KV blocks within one constrained GPU, using the caller's named target to move bytes ahead of demand. Two insights make this possible. First, residency is one problem, not two. Weight shards and KV blocks compete for the same memory pool, so we model both as residency objects under a single budget with explicit restore costs, and show that a fixed partition can become infeasible under the measured crash budget. Second, agent call structure supplies signals that passive statistics cannot. A planner reveals its target model while it is still generating the tool call, tool execution leaves idle gaps between calls, and 96.4–99.9% prefix reuse makes preserved KV state highly valuable. Together these observations turn the question of when to move from a prediction problem into a read-off problem.

JointServe occupies a point that complements, rather than competes with, recent serving systems. BlitzScale [56] scales model instances at the cluster level; Pensieve, HCache, and MORI [12, 45, 54] tier the KV state of a single model across the memory hierarchy; NanoFlow [61] overlaps compute, memory, and communication within an operator pipeline; and DeltaZip [53] compresses families of same-base fine-tunes. JointServe manages the unified residency of heterogeneous weights and KV within a single instance.

Concretely, this paper makes three contributions.

• Unified residency formulation and adaptive split. We formulate weight shards and KV blocks as same-domain residents of a single memory budget under an explicit cost model ci=α+s/BW+r(n)c_i = \alpha + s/BW + r(n), use a carve-out step to adapt the split during serving, and prove a (1−ε)(1 - \varepsilon) recovery-value approximation for one selection snapshot of independent, additive objects.

  • Caller-generation proactive prefetching. We extract agent call-graph semantics into residency signals. The planner’s streaming tool-call header deterministically identifies the target model, moving the swap window from after request arrival to the caller’s generation phase and tool gaps; a preemptive, chunk-granular transfer scheduler with a κ\kappa-floor bandwidth share keeps weight movement from starving KV restoration of live sessions.

• Partial-shard streaming hot-swap and dual-state KV tiering. Each of N heterogeneous models keeps an analytically derived resident shard of k∗k^{*} layers with per-group readiness checks, so a swap streams only the remaining L−k∗L - k^{*} layers; the evaluated prototype switches by in-place overwrite, and a dual-state KV tier substitutes host-RAM reload for GPU recompute at a 20×20\times cost advantage.

We implement JointServe on top of SGLang [58] and evaluate it across a range of real-world traces and datasets. Compared with the strongest whole-model swap baseline, JointServe reduces SCT by 21.7% in the tight memory regime, stays feasible in a crash regime where every whole-model swap baseline fails to finish (a 46× gap), and on real agent traces lifts SLO attainment from 2.8–24.5% to 76.8–100% while cutting SCT by up to 49%.

References (48)