Home icon

Reduce LLM latency with prefix-aware routing on Amazon SageMaker Inference

Machine Learning Blog



Amazon SageMaker Inference introduces prefix-aware routing, a new strategy that sends requests sharing the same prompt prefix to the same instance to maximize KV cache reuse and reduce latency.

  • Routes requests with identical prompt beginnings to the same instance for consistent cache hits
  • Reduces P50 time-to-first-token by up to 77% and increases throughput by up to 16% on Llama 3.1 70B
  • Improves KV cache hit rates from ~25% to over 80% in long-context workloads
  • Includes overload protection and stable scaling behavior to prevent cache invalidation
  • Configured via PrefixLength and ConcurrencyThreshold parameters in endpoint configuration
  • Works with vLLM, TensorRT-LLM, inference components, and LoRA adapters
  • Ideal for RAG applications, multi-turn conversations, templated bots, and code completion

Prefix-aware routing enables significant performance gains for LLM workloads by ensuring shared prompt context is cached efficiently across distributed inference endpoints.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Sep 8
2026
Benchmarking small LLM inference on SageMaker AI: G7 vs G5 and G6
Sep 10
2026
Reduce inference cold starts on Amazon SageMaker HyperPod with model caching
Aug 6
2026
LLM optimization integration for Amazon SageMaker Python SDK
Dec 24
2025
Optimizing LLM inference on Amazon SageMaker AI with BentoML’s LLM- Optimizer

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.