AWS Artificial Intelligence Blog title card for Amazon SageMaker AI real-time endpoints now support KV cache aware routing, with the AWS logo on a blue side panel.
Featured image from the 17 November 2026 AWS Machine Learning Blog post on KV cache-aware routing., Amazon Web Services

On 17 November 2026, Dmitry Soldatkin, Apoorva Chandra, Shashi Kiran, and Shijie Lyu wrote on the AWS Machine Learning Blog that Amazon SageMaker AI real-time endpoints now support KV cache-aware routing. The feature sends each request to an instance that already holds a long cached match for its prompt and is not too busy, using cache state the model container reports rather than inferring location from the start of the request alone.

Chat, retrieval-augmented generation, and agents with long system prompts often send many requests that start with the same text. The model keeps the work it has already done on that start in GPU memory, a store called the KV cache, and skips that work when the same start reaches the same instance again. Time to first token, how long the user waits for the first word, rises when the router sends the next turn elsewhere and that work is redone. AWS reports a large gain against random routing, for long prompts under load, in its own benchmarks. Under cache eviction, that gain is a live cache-index problem. Prefix-aware routing guesses where the cache is. KV-aware routing asks the container what it still holds.

[1]

The benchmarks, and their baseline

The large-scale test used Llama 3.1 70B Instruct on seven ml.p5.48xlarge instances, in 30-minute runs, with 20 or 100 simulated users holding multi-turn chats and document question-and-answer sessions, and with prompts of up to about 64,000 tokens. Compared with random routing, and with long prompts under load, AWS reports that median time to first token fell by up to 97 percent, throughput rose by up to 234 percent, and the KV cache hit rate, the share of prompt work served from cache rather than recomputed, rose from 3-48 percent to 80-93 percent. Long prompts gained even at lower load. The gain was smallest with short prompts, where there is less prefill to save. Prefill is the work of reading the prompt and filling the KV cache before the model writes the first new word.

A smaller comparison on two ml.g5.xlarge instances serving Qwen3-4B-Instruct-2507, against random routing, showed a lower median time to first token on questions 2 to 4, 237 and 245 milliseconds against 1,284 and 1,632 milliseconds, and a higher cache share, 90 percent against 76 and 70 percent. OverheadLatency, the time SageMaker spends outside the model container, was 14 to 19 milliseconds higher on average.

[1]

Guessing a prefix, or asking the cache

SageMaker AI now offers four routing strategies for a real-time endpoint. RANDOM is the default. LEAST_OUTSTANDING_REQUESTS sends each request to the instance with the fewest requests still in flight. PREFIX_AWARE hashes the start of the request, up to a configured PrefixLength and sends matching starts to the same instance, overflowing at a ConcurrencyThreshold. It never sees what an instance actually has cached, so it can keep sending work to a machine that has already evicted the entry. In a multi-turn chat still shorter than PrefixLength, each new turn also changes the text being hashed.

Once SM_VLLM_KV_EVENTS_CONFIG is set, the container publishes a KV cache event each time it stores or evicts entries, and SageMaker keeps a managed cache index of that state. The index holds only pointers, one-way, truncated hashes of cached content, mapped to the instance that holds it. It never stores prompts, token IDs, request payloads, or KV tensors. The endpoint tokenizes the prompt, looks up the longest cached match, and weighs match length against load. If the best match is busy, the request goes to the next-best available candidate. If no useful match exists, or all candidates are busy, it falls back to load-aware routing, the same behavior as LEAST_OUTSTANDING_REQUESTS.

In the post's example, three instances share a 6,000-token excerpt. Instance A evicts most of it under memory pressure. Instance B still holds the first 4,000 tokens. Prefix-aware routing would send the next turn back to A. KV-aware routing has already been told of the eviction, so the request goes to B. The strategy is active only with at least two instances, or two copies of an inference component. It is turned on with the environment variable and RoutingStrategy set to KV_AWARE. Client APIs do not change. At launch it needs a supported AWS vLLM Deep Learning Container (vLLM 0.33.0 or later, or the Amazon Linux build server-sagemaker-cuda-v2.8.0 or later), prefix caching, and OpenAI-compatible Completions or Chat Completions requests. Prefix-aware routing added 1.3 to 1.9 milliseconds of latency in the earlier part of this series, the post says. KV-aware routing adds a few milliseconds for short prompts, and more for long ones, mostly for tokenization.

[1]

What the 97 percent figure does not claim

AWS is shipping a real router, not a design that exists only on the blog. The fairest reading is that the 97 percent and 234 percent figures describe long prompts under load, compared with random routing, in AWS's own tests. The post itself says prefix-aware routing can be all you need with very short prompts, and that it is a good fit, with no container changes, when requests share a stable system prompt or document at the start, prompts are short, or load is moderate. In those conditions, instances have enough GPU memory to keep the shared text cached, so both strategies find it. The authors say that if you are not sure which fits, start with prefix-aware routing and compare time to first token, throughput, and hit rate on your own traffic. "Up to 97 percent" is not a typical saving.

[1]

What the console will not show

Fallbacks are not reported in the SageMaker console or metrics at launch, so a silent fall back to load-aware routing will not announce itself. New instances start with empty caches, so latency can be higher after a scale-out or an update. The first request with new context has nothing cached on any instance, and the router speeds up the requests that follow, not the first one. The post says the feature is available in all commercial AWS Regions that support SageMaker AI real-time inference, at no additional charge beyond the instances the endpoint uses.

The number to watch is whether a customer's own traffic, once GPU memory is under pressure and entries start being evicted, keeps a high hit rate and a lower wait for the first word than a prefix-aware router on the same fleet.

[1]

The test over the next six months

Over the next six months, the useful test is whether production hit rates stay near the 80 to 93 percent band once eviction starts, and whether KV-aware routing still beats a tuned prefix-aware router, not only a random one. If the index is stale, or if fallbacks are common and silent, the published ceiling will not show up in the time a user waits for the first word.

[1]