Amazon Web Services introduced KV cache-aware routing for Amazon SageMaker AI real-time endpoints on November 17, 2026, directing requests based on container-reported GPU cache state. In long-prompt tests under load, AWS reports up to 97% lower median time to first token and 234% higher throughput compared with random routing. The gain matters for businesses running chat assistants, retrieval-augmented generation and agents with long system prompts.
How KV-aware routing changes request placement
The KV cache stores prior prompt computations in GPU memory, allowing a model to reuse them instead of repeating prefill processing of matching input tokens. Sending a request to an instance that lacks the relevant context forces recomputation that another GPU may already hold. SageMaker AI previously offered prefix-aware routing, which infers cache location from a fixed request prefix but cannot detect evictions. Early turns in a growing conversation can also hash differently and land on separate instances.
The new mechanism relies on events emitted by the model container whenever cache entries are stored or evicted. The service maintains a managed index of one-way truncated hashes mapped to instances or inference-component copies, without storing prompts, token IDs, payloads or KV tensors. Each incoming prompt is tokenized and matched against that index, with the endpoint weighing the longest cached match against current instance load. Candidates that are too busy are skipped in favor of less loaded capacity.
AWS validated the approach on Llama 3.1 70B Instruct running on seven ml. p5.48xlarge instances during 30-minute tests with 20 or 100 simulated users. Workloads included multi-turn chats and document question-answering sessions, with prompts reaching about 64,000 tokens. Cache hit rates rose from 3-48% under random routing to 80-93% with KV-aware routing. Short prompts gained least, since they leave less prefill computation available for reuse.
What this means for AI operating costs and latency
For companies serving long reusable contexts, the practical effect is lower waiting time for the first token and higher throughput from the same endpoint footprint. Document assistants, support copilots and agents that repeat large system instructions can recover GPU prefill work that random distribution would discard. The benefit scales with prompt length and repetition, while short-context workloads see limited change. Small deployments with stable prompts may still find prefix-aware routing sufficient under moderate load.
Limits center on overhead, fallback behavior and observability. Routing lookup adds tokenization and index processing of a few milliseconds for short prompts and more for longer ones, with standard text-only requests passing computed tokens to the model to avoid repeated tokenization. In a two-instance Qwen3-4B-Instruct-2507 comparison, CloudWatch OverheadLatency was 14 to 19 milliseconds higher even as model latency improved. If lookup is slow, no match exists or matched instances are busy, requests fall back to least-outstanding-requests routing without an exposed signal in console or metrics.
Adoption requires specific configuration and capacity. The feature needs the AWS vLLM Deep Learning Container with vLLM 0.33.0 or later, or Amazon Linux server-sagemaker-cuda-v2.8.0 or later, plus enabled prefix caching and KV cache events. Customers set SM_VLLM_KV_EVENTS_CONFIG and RoutingStrategy to KV_AWARE without changing client calls. It supports GPU-backed single-model and inference-component endpoints, including dynamic Low-Rank Adaptation adapters, but needs at least two destinations and OpenAI-compatible Completions or Chat Completions payloads. InvokeEndpointWithBidirectionalStream is unsupported, and the option is available at no additional charge beyond endpoint instances.
