Amazon SageMaker AI now supports KV cache-aware routing for real-time inference endpoints
Amazon SageMaker AI introduces KV cache-aware routing for real-time inference endpoints, reducing token generation latency for large language models by optimizing cache utilization under high load.
Amazon SageMaker AI now supports KV cache-aware routing for real-time inference endpoints, a feature designed to reduce the time to first token for large language model workloads with long or repeated prompts. Serving engines like vLLM store key-value (KV) cache for shared prompts, documents, or conversation history to avoid redundant computations. Without this routing, requests may recompute the cache if they land on an instance where it is missing, while high load can force evictions of cached blocks to free GPU memory.
KV cache-aware routing addresses these challenges by directing each request to the instance holding the longest matching portion of its prompt in cache. The vLLM container reports cache storage and eviction events to SageMaker, which uses this live data to make routing decisions. If the lookup is slow or yields no match, the endpoint defaults to load-aware routing to ensure the request is still processed.
The feature is enabled by setting the `RoutingStrategy` parameter to `KV_AWARE` on a production variant and adding an environment variable to allow the container to report cache events. Customers can invoke endpoints using the same APIs and OpenAI-compatible payloads, with support for single-model endpoints and inference components, including LoRA adapters, on GPU instances.
KV cache-aware routing is available at no additional charge in all AWS Regions where Amazon SageMaker AI is supported. Customers must use the AWS vLLM Deep Learning Container version 0.33.0 or later and deploy at least two instances or inference component copies. Detailed observability metrics, including KV cache hit rate, are provided to monitor performance.