arXiv(opens in a new tab)cs.DCSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.06940

Unified AI Gateway: A Framework for Joint Model Routing and KV Cache Management

Jiaxun Lu, Xiang Zhang, Yunfeng Shao

Jiaxun Lu, Xiang Zhang, Yunfeng Shao

Abstract—Large language model (LLM) inference increasingly spans models that differ in size, capability, price, and provider. This shift creates two costs for developers. One is the integration cost of choosing among and switching between many models. The other is the inference cost of rebuilding a KV cache when it is unavailable or incompatible with the selected model. We define and analyze the Unified AI Gateway as a system setting for an edge-deployed AI traffic hub. It coordinates model routing, KV cache management, and compute placement across end devices, edge resources, and cloud model services. At request time, the gateway jointly selects a target model, an execution site, and a KV cache action under task-quality, latency, cost, and resource constraints. In parallel, background cache-management actions optimize KV cache placement, replication, retrieval, and lifecycle decisions for subsequent requests. We synthesize existing evidence on KV cache reuse, compression, cross-model mapping, distributed storage, and transfer, and discuss the remaining challenges of integrating these capabilities into one system. Across eight typical workload profiles, our workload-level analytical simulation reports TTFT speedups of 1.25×–13.28× and input-cost benefits of 1.20×–6.16×.

Index Terms—AI Gateway, KV Cache Management, Edge Computing, Model Routing, Transmission Optimization, LLM Inference

1 INTRODUCTION

As the model ecosystem expands, developers increasingly choose among models that differ in size, capability, price, and provider. Consider a long-context coding agent. Its planning, coding, execution, and review steps may favor different models, while conversation history, tool outputs, and repository state recur across turns [1]. Existing AI gateways provide unified interfaces and routing functions such as load balancing and failover, but they do not coordinate the KV cache with provider and model selection. When routing switches the target model, the accumulated cache may be unavailable or incompatible, forcing the target model to repeat full-context prefill. This repeated work can outweigh the capability or price advantage of switching models. Model routing and KV cache management must therefore be coordinated at the gateway.

Current support remains fragmented across gateway services, inference engines, and cache systems. Unified APIs reduce provider-integration overhead, while runtimes such as vLLM and SGLang and systems such as LMCache and Mooncake support runtime reuse, cache lifecycle management, cross-engine sharing, or distributed cache storage [2], [3], [4], [5], [6]. However, these capabilities are not jointly coordinated with provider and model selection across devices and services. A routing decision can therefore discard useful state, increase time to first token (TTFT) and input cost, and create cache-induced model lock-in. To address this issue, this paper proposes the Unified AI Gateway, which couples provider and model routing with KV cache handling across participating runtimes. Figure 1 previews the resulting benefits. Across the typical workloads and model-

Figure

Fig. 1: Across eight workload profiles, the Unified AI Gateway yields modeled TTFT speedups of 1.25×–13.28× and input-cost benefits of 1.20×–6.16×. This End-Edge–Cloud setting coordinates model routing, compute placement, and KV cache handling across end devices, edge resources, and cloud model services, so that available caches can be reused, mapped, or transferred instead of fully recomputed. Marker shapes denote model-switching probabilities of 25%, 50%, and 75%, defined as the probability that a request with an available KV cache is routed to a different model. Points farther toward the upper right indicate larger benefits.

switching rates considered in this study, our workload-level simulation reports modeled TTFT speedups of 1.25×–13.28× and input-cost benefits of 1.20×–6.16×.

To realize these benefits, the gateway coordinates routing, KV cache storage, prefill, and cache transformation along the user-to-service path. Its placement at the edge supports authorized cache sharing across devices and users,

Corresponding author: Yunfeng Shao. Jiaxun Lu, Xiang Zhang and Yunfeng Shao are with Huawei, Shenzhen, China (e-mails: lujiaxun@huawei.com; zhangxiang239@huawei.com; shaoyunfeng@huawei.com).

while edge compute can perform local prefill or map KV caches between models subject to fidelity constraints [7], [8], [9], [10]. This coordination raises three system challenges involving KV cache compatibility and fidelity, the choice between transfer and recomputation, and cache placement, replication, and isolation under capacity and privacy constraints. The Unified AI Gateway therefore considers one joint routing control layer with four KV cache management capability groups, namely cross-granularity reuse, adaptive compression, cross-model mapping, and distributed storage and transfer. Figure 2 contrasts this coordination with the request-routing scope of a conventional AI gateway.

The four capability groups are grounded in active research lines, but their support remains fragmented across inference engines, cache systems, and model-serving services. Mainstream inference engines support exact prefix caching, while recent studies have extended KV-cache reuse to semantic, non-prefix, workflow-aware, and agent-oriented settings [8], [11], [12], [13], [14], [15], [16], [17], [18]. Distributed systems have also advanced KV-cache storage and transfer [5], [19]. The unresolved gateway-level problem is to jointly decide whether to reuse, map, transfer, or recompute a cache while selecting the provider, model, and placement under quality, latency, cost, and resource constraints.

To address these issues, this paper introduces the Unified AI Gateway, which jointly coordinates model routing and KV-cache management across the End-Edge-Cloud continuum. We evaluate its potential benefits through analytical simulation. The contributions are as follows.

  • Unified gateway abstraction and joint control. We introduce the Unified AI Gateway as an End-Edge-Cloud abstraction that coordinates model routing, KV-cache management, and compute placement. We formalize it through a Global Control Plane that jointly selects models and cache actions under latency, cost, quality, and resource constraints, providing a basis for gateway-wide optimization.

  • Coordination taxonomy and systems gap. We organize cache reuse, compression, mapping, storage, transfer, prefill, and routing into an end-to-end taxonomy. Our analysis shows that existing methods optimize individual stages but do not coordinate cache handling, model selection, and compute placement across models and system tiers.

  • Quantified benefits and deployment guidance. Across eight workload profiles, analytical simulation shows modeled TTFT speedups from 1.25× to 13.28× and input-cost benefits from 1.20× to 6.16×. In particular, the long-horizon coding-agent workload achieves TTFT speedups from 5.01× to 12.87×. Sensitivity analysis shows that future deployments with higher cache hit rates and greater available bandwidth could further broaden the benefit range.

The remainder of this paper is organized as follows. Sections 2–5 define the system setting, formulate the control plane, analyze component requirements, and synthesize existing evidence, respectively. Section 6 evaluates workload-level benefits through analytical simulation, while Section 7

discusses deployment readiness and future directions. Section 8 concludes the paper.

References (91)