GoodServe: Towards High-Goodput Serving of Agentic LLM Inferences over Heterogeneous Resources
arXiv:2605.16867v1 [cs.DC] 16 May 2026
Boxiao Du1 Boning Huangfu1 Yizhou Luo1 Chen Chen1∗ Zijun Li1 Minchen Yu2 Xiaoyi Fan3 Minyi Guo1 1
2
Shanghai Jiao Tong University The Chinese University of Hong Kong, Shenzhen 3 Shenzhen MSU-BIT University
Abstract Large Language Models (LLMs) play a critical role in emerging agentic applications, where the timely completion of each entire inference is critical. Meanwhile, agentic LLM inferences are increasingly served on heterogeneous GPUs in operators’ resource pools. Therefore, it is crucial to route incoming inference requests to appropriate GPUs so that their end-to-end latency requirements are satisfied whenever possible, thereby achieving high goodput. In this paper, we propose GoodServe, a goodput-optimized serving system for agentic inferences over heterogeneous resources. GoodServe performs inference routing in a predict-and-rectify manner. It estimates the request output lengths as well as the GPU serving status in an accurate and also practical manner. Based on information from both the demand and resource sides, it then makes high-quality routing decisions using a just-enough instance selection heuristic. It also periodically monitors SLO-violation risks of active requests and triggers runtime request migrations to address unexpected dynamics. Our evaluations show that GoodServe improves goodput by up to 27.4% over existing routing methods.
1
Introduction
Agentic applications driven by Large Language Models (LLMs), like code generation [18] and database management [22], are increasingly popular. Unlike chatbot-style inference serving [23], agentic applications often require a fully-formed output before downstream tasks can proceed [39, 15]; therefore, service quality is crucially affected by the end-to-end inference latency rather than time-tofirst-token or time-per-output-token latency. Users often associate end-to-end latency requirements with agentic LLM inferences [37, 39, 5, 3, 1], and it is desirable for the serving system to attain high goodput, i.e., to complete as many inferences within their E2E-SLOs as possible. In the meantime, agentic LLM service providers often aggregate all GPUs they own—even across heterogeneous generations—into a resource pool to serve a massive number of requests [20, 1]; each request, upon arrival, is routed by the service proxy to a specific GPU instance for execution. Given the output uncertainty and resource heterogeneity, it is challenging to make routing decisions that achieve the best goodput performance. Regarding multi-instance request routing, existing methods are not designed to optimize the end-toend SLO performance of agentic LLM inferences, failing to attain high goodput. For example, some routing strategies, like random [25], round-robin [25], least-request [25] and Llumnix [30], seek to balance the loads on different instances; some other methods, like prefix-cache [25] and Preble [29], seek to maximize the local execution efficiency of individual requests. In essence, without awareness ∗ Chen Chen is the corresponding author.
Preprint.
of end-to-end request SLOs, those methods lack the flexibility to route less-urgent requests to inferior instances; that is, they are incapable of making locally-suboptimal yet globally-optimal routing decisions. Therefore, when serving agentic LLM inferences, we need to exploit information from both the demand and resource aspects, so as to perform SLO-adaptive routing to optimize overall goodput. In this paper, we propose GoodServe, a goodput-centric routing system for agentic LLM inferences over heterogeneous GPUs. To that end, we need to acquire the SLO performance of each request if it were routed to any GPU instance, which requires several pieces of future information such as the request decode length, the expected GPU queuing time, and the prefill/decode speed. While it is possible to estimate such information, it is, however, impossible to make fully accurate predictions due to the built-in algorithm and system dynamicity. Therefore, we adopt a predict-and-rectify methodology. Specifically, GoodServe consists of three core designs. First, to predict request decode length in an accurate yet also light-weight manner, given that the agentic task type is essentially an implicit precondition crucially affecting the output length, we design a Mixture-of-Experts style prediction model, which ensembles multiple simple-yet-professional MLPs to make a weighted prediction. Second, in estimating request execution efficiency after being routed to a given GPU, for practicality, we design an EMA-smoothed, black-box profiling method, which turns out to be sufficiently accurate for production use. Third, given the estimated demand and resource information, to work out a high-goodput request routing scheme, we propose the just-enough instance selection heuristic, which is efficient and also of high quality; to further address the potential demand-prediction error and system-status drift, GoodServe periodically re-evaluates the SLO-violation risk of active requests, and launches light-weight, token-ID based request migration when necessary. We have implemented GoodServe in 2.5k LoC, and further evaluated its performance with both testbed measurements and large-scale simulations. Our measurements over heterogeneous GPUs show that, when serving popular agentic LLM workloads, GoodServe consistently achieves the best goodput performance under diverse SLO scales, surpassing the second best by up to 27.4%. Meanwhile, our deep-dive experiments do confirm the effectiveness of each GoodServe innovation. Moreover, large-scale simulations emulating a 512-instance cluster show that GoodServe’s routing overhead is still negligible even under a very high load intensity (5 ms at 10,000 requests per second).
2
Background and Motivation
2.1
Serving Agentic LLM Inferences in Multi-Instance GPUs
In the coming era of agentic AI, LLM inference has become a workhorse workload supporting emerging agentic applications like mathematical reasoning [35], code generation [18] and database management [22]. Compared with conventional LLM inferences supporting chatbot conversations [2], the LLM inferences supporting agentic applications—which we call agentic LLM inferences— exhibit two distinct characteristics. First, agentic LLM inferences typically have much longer decode lengths than chatbot inferences, which is highly uncertain a priori. For instance, reasoning models like DeepSeek-R1 [6] generate itecture GPU Arch extensive Chain-of-Thought tokens, where decode lengths vary significantly depending on task difficulty. Second, Figure 1: Inference latency across four while for chatbot inferences it is the Time-to-First-Token GPU architectures under varying batch (TTFT) or Time-Per-Output-Token (TPOT) that matters sizes, for a fixed sequence comprising most, for agentic LLM inferences it is the end-to-end in- 100 input tokens and 200 output tokens. ference latency (i.e., Time-to-Last-Token or TTLT) that truly matters for the application-level performance. This shift arises because the downstream agentic executors require fully formed outputs for execution, making their utility binary upon completion [39, 15]. In practice, agentic LLM inferences are often associated with explicit end-to-end latency (i.e., E2E-SLO) requirements [37, 39, 5, 3, 1]. When 10
Latency (s)
8
6
4
h
tc
Ba
64 32 16 8
ze Si
2
4
2
1
A40
V100
A800
H800
serving agentic LLM inferences, it is increasingly significant for the serving system to maximize goodput (i.e., the number of requests that satisfy their E2E-SLO requirements). Meanwhile, confronting booming LLM inference demands, production service providers often maintain a pool of LLM serving instances for parallel request processing; upon the arrival of each LLM inference request, the LLM service proxy needs to route it to one inference backend for execution. In particular, the inference serving capabilities across different instances are often inconsistent—due to static hardware heterogeneity and dynamic resource fluctuations. Regarding hardware heterogeneity, since LLM service providers need to persistently purchase new GPUs and the available GPU types keep evolving, the resultant GPU resources available for agentic LLM serving naturally become heterogeneous [20, 1]. For example, Microsoft reports maintaining a heterogeneous cluster comprising diverse (e.g., NVIDIA H100, A100 and AMD MI300X) GPUs to serve its LLM inference workloads supporting Office 365 Copilot function [1]. Regarding resource fluctuations, depending on the instantaneous request intensity (which affects the request batch size served in one iteration), the inference serving speed on a GPU instance is also inconstant at runtime. We note that both the GPU hardware type and batch size configuration do affect the per-iteration inference time; this can be demonstrated by Fig. 1, which shows the per-iteration LLM inference latency across different GPU architectures (A40, V100, A800, and H800) under varying batch sizes. In summary, when serving agentic LLM inferences in typical multi-instance clusters, given the potential service-backend heterogeneity and the inherent decode-length uncertainty, it is crucial yet also challenging to optimize the request routing policies for the best E2E-SLO goodput. Next, we study the effectiveness of existing request routing methods with regard to that objective.
Lessons Learned from Existing Request-routing Methods
For request routing, in practice a series of methods has already been proposed. For example, the random (Power of Two Choices) [24] and round-robin [38] strategies are classical routing methods that seek to evenly distribute requests across instances. Meanwhile, least-request and prefix-cache are also core routing strategies supported in production frameworks like AIBrix [31]: the former routes incoming requests to the backend with the minimum number of pending requests, and the latter preferentially routes requests to the server with a high cache hit ratio. Besides, the lowest-TPM strategy, which is adopted by the LiteLLM system [4], dispatches requests to the backend with the minimum Tokens-Per-Minute (TPM) utilization. The Preble-style method [29, 23] further jointly considers prefix cache hits and compute load when selecting the best-performing instance for a request. Moreover, Llumnix [30] is a more advanced scheduler that preferentially routes requests to the instance with the maximum available memory, which also supports runtime migration to alleviate load imbalance during the execution process.
7.51
8
Goodput (RPS)
2.2
6
5.04
4.75 3.82
4 2 0
Least Requests
Round Robin
Llumnix
Oracle
Figure 2: Performance inferiority of existing routing strategies. In total, 600 requests (with an arrival rate of 10 requests per second) are jointly served by four heterogeneous (V100, A40, A800, H800) GPUs. Each request has 100 input tokens and has its output token length randomly sampled from [100, 500]. The E2E-SLO is set to 6s.
However, the above routing strategies all fall short for our problem in that they are agnostic to the end-to-end SLO requirement of agentic LLM inferences. Specifically, given the highly-uncertain inference output length as well as the dynamic backend status, existing strategies essentially choose to implement simple heuristics that are hardware-aware only (e.g., for balanced hardware utilization). In that sense, they treat all the incoming requests indiscriminately, failing to identify and prioritize those requests that have more urgent SLO requirements. Consequently, given a set of agentic LLM requests with their respective SLO requirements, greedily routing each request to the currently most efficient (lightly loaded) serving instance often leads to suboptimal performance in terms of the overall goodput. To demonstrate this, we conduct a testbed experiment with 4 heterogeneous GPUs. As shown in Fig. 2, compared to an oracle request router that has the ground-truth knowledge of 3
the inference generation length and hardware processing capability (routing policy detailed later in Sec. 3.4), those existing routing policies perform substantially worse as measured by goodput. Given the above study, we learn that to attain good SLO performance for agentic LLM inferences, instead of relying on fixed heuristics, we need to perform SLO-aware request-adaptive routing—by properly exploiting auxiliary information from both demand (i.e., request decode length) and resource (i.e., GPU inference capability) aspects. However, given the inherent dynamicity of inference length and GPU capability aforementioned, it is challenging to make near-optimal routing decisions in practical systems. We next present our solution to address that challenge.
3
Solution
3.1
Overview
Problem formulation. For clarity, we first mathematically formulate our research problem (a detailed symbol table is included in Appendix A.1). Given the request set R and the GPU instance set G, we let xr,g ∈ {0, 1} indicate whether request r is routed to GPU-g, and also let T (r, g) be the end-to-end inference latency of request-r when served on GPU-g. Then our optimization objective is to maximize the overall goodput, i.e., X X max I xr,g T (r, g) ≤ Dr , (1) {xr,g }
r∈R
g∈G
where Dr is the E2E-SLO of request-r. P Meanwhile, there are two types of constraints. First, a request can only be served by one GPU, i.e., g∈G xr,g = 1, ∀r ∈ R. Second, the number of requests that can be concurrently served on each GPU is bounded by its memory capacity [32] (for symbolic clarity we skip the formula here, but this constraint is always complied with in our system). We further take a closer look at T (r, g), which is jointly affected by the demand volume of request-r as well as the execution status of GPU-g. Specifically, regarding the request demands, we let Lin r and Lout respectively be the input and output lengths of request-r; regarding the GPU status, we r let pg and dg respectively be the average per-token prefill/decode latencies on GPU-g, and qg be its average request queuing delay. We also take the effect of prefix caching into consideration, which can eliminate the prefill delay upon a cache hit and is therefore commonly adopted in production systems [23]. Suppose Hr,g is the hit prefix token length, then we obtain out T (r, g) ≜ qg + pg · (Lin r − Hr,g ) + dg · Lr .
(2)
GoodServe workflow. To solve the above optimization problem, a prerequisite is to obRequest Flow Client Control Flow tain the coefficients in T (r, g), i.e., qg , pg , dg Migration ① User Request out and L . We note that it is possible to estiProxy Router (Control Plane) mate the demand volume and hardware status GPU Status Request Status Predictor Estimator Monitor Monitor in advance [14, 33, 7], yet, on the other hand, GPU ( , , ) Req ( Prompt , , , SLO ) it is impossible to make 100% accurate prediction. Therefore, in this paper we propose ( , , ) GPU Req ( Prompt , , , SLO ) GoodServe, which routes agentic LLM infer③ Update ③ Update ences in a predict-and-rectify manner for the Request / GPU Request / GPU ② Route / Re-route Status Status highest goodput. As shown in Fig. 3, GoodRequest Instance 1 Instance N Serve introduces a RequestStatusMonitor Request Queue Request Queue and a GPUStatusMonitor on the proxy router ⑤ Output ④ Migrate ⑤ Output Inference Engine Inference Engine (GPU) (GPU) that respectively maintain the demand- and resource-side information. In particular, the RequestStatusMonitor predicts request out- Figure 3: GoodServe architecture and workflow. put token lengths (Lout ) with an accurate and light-weight Mixture-of-Expert-style predictor (Sec. 3.2); the GPUStatusMonitor estimates the average execution status of each GPU (qg , pg , dg ) in an EMA-smoothed, black-box manner (Sec. 3.3). For each incoming request, the proxy first routes it to the GPU following an effective just-enoughselection heuristic, and may also trigger request migrations later based on the refreshed demand and 4
1
1
n
m
resource status to ensure SLO attainment (Sec. 3.4). Next we will elaborate on each component in greater detail. 3.2
Mixture-of-Expert-style Output-length Prediction
Output-length prediction is essential for goodput optimization; while 100% accurate prediction is impossible, it is still important to predict as accurately as possible. Compared with conventional chatbot inferences, agentic inferences typically have a much broader output length range (due to diverse task types); meanwhile, given the high request-arrival rate on a proxy router, output length prediction must be simultaneously made light-weight. In the literature, multiple output-length prediction methods have already been proposed. The S 3 work [14] predicts with another fine-tuned large language model (DistilBERT), the Past-Future work [7] predicts by referring to historical requests, and the STAR work [33] predicts with a 4-layer MLP model. However, all those works fall short for our problem: the DistilBERT-based prediction method incurs high training and inference overheads, whereas history-based and single-MLP-based methods fail to attain high prediction accuracy; to predict the output length of agentic inferences, we need to avoid introducing complex Transformer-like architectures, yet at the same time maintain the flexibility to adapt to diverse task types. To that end, in GoodServe we design a Mixture-of-Experts-style predictor. Given the remarkable impact of the inference task type on the output-length distribution, for accuracy we need to treat the task type as a prediction condition: for example, inferences generating database-operating commands [22] usually have short outputs, whereas those for code-generation [18] usually have long outputs. Moreover, such preconditions (sensible from prompts) should be handled implicitly, without assuming the recurrence of a fixed task set. Therefore, for high accuracy and efficiency, we use an ensemble of small models and automatically select the best ones for runtime prediction. We note that this aligns well with the design philosophy of Mixture-of-Experts architecture [27], which has been widely adopted in modern LLMs [6] given its Pareto-superiority in model capability and compute efficiency. As shown in Fig. 4, our output-length prediction model contains a gating router (R(·)) and multiple (K) experts. Given the feature vector hr (obtained by conducting TF-IDF vectorization [28] over the token window so far) for request r, the router outputs a probability distribution pr ∈ ∆K over experts: pr = softmax(R(hr )), and the final prediction is obtained via a weighted combination of expert outputs: PK ŷr = k=1 pr,k Ek (hr ). Specifically, the gating router is a two-layer MLP and each expert is a fourlayer MLP; in total there are only 45.1M parameters.
Prompt: Solving this problem ... TF-IDF 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Gateway
... Route
...... MLP1
MLP2
MLP n
output length: 500
Moreover, that predictor is trained in two phases. In the first phase, we partition one half of the dataset into Figure 4: MoE-style output-length predictor. K distinct subsets—by discretizing query (input) and √ answer (output) lengths into K tiers (in practice we set K to 9), with each MLP expert trained separately using a specific data subset. In the second phase, with expert parameters frozen, we train the router on the other half of the dataset. Our later evaluations in Sec. 4.3 demonstrate that such a MoE-style predictor can perform well in terms of both accuracy and efficiency. 3.3
EMA-smoothed, Black-box Instance-Capability Estimation
Apart from request-demand prediction, for goodput-optimal serving, we also need to estimate the average execution efficiency after a request is routed to a GPU instance. Specifically, we need to perform comprehensive instance status monitoring, covering all the hardware-related coefficients in Eq. 2: qg , pg and dg . However, there are essentially two challenges. First, given the batched serving mode in mainstream LLM frameworks like vLLM [32], the actual execution efficiency of request-r on GPU-g is jointly affected by the shape (i.e., Lin and Lout in Eq. 2) of request-r and the competing requests on GPU-g, making it hard to calculate precisely with the instance configuration 5
information. Second, an agentic LLM inference may have many decode steps, during which the processing capability of the instance is usually not a constant. We note that execution efficiency estimation does not need to be highly accurate (it suffices if the instance preference order is valid), but must be practical, i.e., easy to implement and adopt in a production environment. Therefore, we make some necessary approximations, trading accuracy slightly for much better practicality. First, since a GPU instance batches many inferences in one iteration and its local configuration rarely changes, given the Law of Large Numbers [26], we can view a GPU’s per-iteration time as relatively stable during a short period. Therefore, the estimation of qg , pg and dg can be made in a black-box manner—directly from their recent past values, instead of relying on runtime request specifics or engine configurations (e.g., batch size, GPU type and queuing policy). That said, to tackle temporal system jitter, we still adopt exponential moving average (EMA) to obtain a smoothed estimation. As shown in Fig. 5, when replaying the realistic Mooncake trace [23] with a mixed BIRD-bench [16] and LiveCodeBench [10] dataset on an NVIDIA A40 GPU, such an EMA-smoothed, black-box estimation method indeed works quite well. This way, we can achieve comprehensive and practical estimation of instance serving efficiency.
3.4
Just-enough Instance Selection with Runtime Migration
TPOT (ms)
Queue Time (ms)
Even after we have obtained both the demandand resource-side information, it is still challengActual Predicted ing to find the goodput-optimal request routing 100 scheme. First, the exact optimization problem behind Eq. 1 is NP-hard: with binary routing variables and bounded GPU memory/compute capaci0 0 20 40 60 80 100 120 ties, it becomes an integer linear program that couples request assignments across GPUs, and thus 100 cannot be directly solved in polynomial time [39]. Second, our previous request length prediction and resource capability estimation may not be per0 0 100 200 300 400 sistently accurate, and a one-shot routing scheme Time (s) may turn out to fail to meet the E2E-SLO requirement. Now we address these two challenges in Figure 5: Effect of the EMA-smoothed, blackturn, with the overall algorithm summarized in box estimation method on queuing time and Appendix A.2. TPOT. First, we propose the just-enough heuristic for instance selection to efficiently obtain a near-optimal solution to Problem 1. In fact, while we notice from Fig. 1 that higher-end GPUs in general yield better efficiency for all the requests, completing a request faster than its E2E-SLO requirement, however, does not help improve the overall goodput, which is essentially a waste of high-end resources. Therefore, among the set of candidate instances that can all meet the E2E-SLO requirement of a request, GoodServe chooses to route that request to the instance with the worst computing capability, thereby opportunistically facilitating the fast completion of other SLO-urgent requests. The per-request routing-decision complexity in this way is only O(M ) in an M -instance cluster. Second, to tackle the demand prediction error and runtime resource drift, after making the initial routing decision, we continuously track each active request’s SLO-violation risk. Specifically, after every τ (set to 50 by default) inference iterations, we re-estimate the future generation length as well as the GPU processing speed with the methods respectively in Sec. 3.2 and Sec. 3.3. For each ongoing request, if its expected finish time based on the latest estimations exceeds the E2E-SLO, the LLM proxy reroutes that request to another GPU with stronger processing capability (still following the just-enough heuristic). In particular, when migrating a pending request to another instance, we choose to transfer the token IDs instead of the intermediate KV cache states. Since typical agentic LLM inferences have large context lengths and massive decoding iterations [34], the KV cache volume is substantial yet the prefilling time portion is negligible. Therefore, by transferring token IDs instead of the KV cache, we can trade a small prefill overhead for substantially lower communication cost and achieve higher migration efficiency (which we will confirm later in Fig. 9). 6