Amazon SageMaker AI Adds KV Cache-Aware Routing for Inference
Amazon SageMaker AI real-time endpoints now support KV cache-aware routing, optimizing inference performance by directing requests to instances with the highest KV cache hit rate, reducing TTFT and increasing throughput for LLM workloads.
KV Cache-Aware Routing Mechanism
Amazon SageMaker AI real-time endpoints now support KV cache aware routing, a mechanism designed to optimize inference performance by leveraging cached key-value (KV) data. According to AWS Machine Learning, KV-aware routing operates in three parts: the model container reports its cached state, SageMaker AI maintains a managed cache index, and the endpoint uses this index to route requests efficiently. This strategy is active only when there are at least two instances or copies of an inference component, as noted in AWS Machine Learning. The kvaware strategy directs incoming requests to the inference instance with the highest KV cache hit rate and currently supports only vLLM-based images with the /completions API as the invocation endpoint. Users must set invocationEndpoint to /completions in their deployment manifest, as stated in docs.aws.amazon.com. Notably, the /v1/chat/completions endpoint is not supported with kvaware routing, as indicated in docs.aws.amazon.com.
Performance Benefits and Use Cases
Amazon SageMaker AI real-time endpoints now support KV cache-aware routing, a feature designed to improve performance for large language model (LLM) workloads with repeated prompts. This system routes requests to the instance holding the longest matching prompt cache, reducing the time to first token (TTFT) and increasing throughput. According to AWS Machine Learning, compared with random routing, KV-aware routing reduced p50 TTFT by up to 97 percent and increased throughput by up to 234 percent under long prompts and high load. The technology also implements a multi-tier caching strategy (L1 and L2) to alleviate GPU memory pressure during long-context processing, alongside intelligent routing that directs requests with shared prompt prefixes to the same instance to maximize KV cache reuse, as noted in datasciencepost.com.
Implementation Requirements and Configuration
Implementing KV cache aware routing in Amazon SageMaker AI real-time endpoints requires specific configuration steps. First, ensure that the container image used meets the requirements, such as AWS vLLM Deep Learning Container with vLLM 0.33.0 or later, or Amazon Linux build server-sagemaker-cuda-v2.8.0 or later. Next, set the RoutingStrategy to KV_AWARE in the RoutingConfig of the production variant. If using a CUDA 13 container, select an AMI that supports it, such as al2023-ami-sagemaker-inference-gpu-4-1. Additionally, enable KV caching by setting enableL1Cache and enableL2Cache to true, and configure the l2CacheBackend to either redis or tieredstorage. If using Redis, ensure the cluster is within the same Amazon VPC as the HyperPod cluster to guarantee encryption for data in transit. Finally, enable intelligent routing by setting enabled to true under intelligentRoutingSpec and specify the routing strategy under routingStrategy.
Compatibility and Limitations
Amazon SageMaker AI real-time endpoints now support KV cache aware routing, but with specific compatibility and limitations. KV-aware routing does not apply the multi-tenant prefix isolation from earlier implementations, as it ignores the prefix-aware ID header and the prompt_cache_key field. Additionally, it introduces two error cases: a request referencing a model not served by the container results in a ModelError, and a request with a non-null cache_salt is rejected with a 400 error. The kvaware strategy directs incoming requests to the inference instance with the highest KV cache hit rate and currently supports only vLLM-based images with the /completions API as the invocation endpoint. The /v1/chat/completions endpoint is not supported with kvaware routing. Supported images include vLLM, LMCache, and AWS Deep Learning Container versions with specific version requirements outlined in the support matrix.
Verification and Monitoring
Verification and monitoring of KV cache-aware routing in Amazon SageMaker AI real-time endpoints requires manual checks since the endpoint does not deliver logs about its routing decisions to the user’s account. According to AWS Machine Learning, users should use metrics such as cached_tokens per request and KV cache hit rate to assess routing behavior. docs.aws.amazon.com outlines steps to validate KV cache-aware routing after deployment, including checking Grafana metrics when metrics are enabled (metrics.enabled: true). These metrics, available from the vLLM worker /metrics endpoint, confirm cache hits and provide insights into performance. Additionally, datasciencepost.com highlights that Inference Observability and CloudWatch Dashboard (June 2026) emits over 100 detailed inference metrics via native OpenTelemetry, including KV cache utilization, time-to-first-token (TTFT), and inter-token latency (ITL). These tools help users monitor and optimize the performance of their models with KV cache-aware routing enabled.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.