AIToday
Large Language ModelsAI Business & IndustryAmazon AI BlogPublished: Sep 11, 2026, 10:00 JST2 min read

AWS launches prefix-aware routing for SageMaker Inference

AWS launches prefix-aware routing for SageMaker Inference

3 Key Points

  1. What happened

    Amazon SageMaker Inference launched prefix-aware routing, which sends requests that share a prompt beginning to the same instance. On Llama 3.1 70B, AWS measured up to 77 percent lower P50 time-to-first-token and KV cache hit rates above 80 percent.

  2. Why it matters

    When one endpoint spans many machines, the same prefix previously landed on different instances that each recomputed it, keeping cache hit rates at roughly 25 percent. Routing on the shared prefix now lets that cached computation be reused, and AWS reports throughput gains of up to 16 percent.

  3. What to watch

    The gains depend on your serving framework having prefix caching enabled, and you must set PrefixLength carefully, since inconsistent request formatting can split identical prompts across instances. It is available today on SageMaker real-time endpoints.

WHO IT HITSThis matters most to teams running LLM applications on Amazon SageMaker, such as RAG services, multi-turn chat assistants, and coding assistants, where many requests repeat a long shared prompt.

Ask the AI about this article →

Summaries like this, in your inbox every morning.

Context & Analysis

Prefix caching already existed in LLM serving frameworks like vLLM and TensorRT-LLM, storing the computed key-value pairs for prompt beginnings seen before so repeated text is not reprocessed. The catch appeared only at scale: behind an endpoint spread across a fleet of machines, the same 3,000-token instruction block was landing on different instances, and none of them saw it often enough to build a reliable cache, leaving the caching feature present but largely ineffective.

Prefix-aware routing closes that gap at the routing layer rather than in the model container. The endpoint inspects the start of each payload and directs identical beginnings to the same instance, with two safeguards: overflow routing to a less busy instance once a concurrency limit is reached, and stable placement when instances are added or removed so caches are not invalidated on every scaling event. It joins two existing strategies, RANDOM and LEAST_OUTSTANDING_REQUESTS, and AWS measured it across 16 test configurations on 7 ml.p5.48xlarge instances with vLLM.

The benefit is uneven by workload, which is the practical reading for anyone weighing it. The longer the shared prefix, the larger the payoff, so long-context workloads with 8,000-token shared prefixes gained far more than short, variable ShareGPT-style conversations. Whether a team actually captures those gains is likely to hinge on following AWS's operational guidance: prefix caching must be enabled in the serving framework, and request serialization must stay consistent, because JSON whitespace and key ordering can change routing decisions and scatter requests that should have stayed together.

FAQ
How do I turn prefix-aware routing on?
Set RoutingStrategy to PREFIX_AWARE with PrefixAwareRoutingConfig in your endpoint configuration, then create the endpoint as usual. You can also switch strategies by updating the endpoint configuration without redeploying your model.
What do PrefixLength and ConcurrencyThreshold control?
PrefixLength (1024–65536) sets how much of the request is used for routing; for the native Invoke API it counts bytes and for the OpenAI-compatible API it counts extracted message characters. ConcurrencyThreshold (1–1024) is the maximum in-flight requests on the target instance before overflow sends the request elsewhere.
Does prefix-aware routing work with multi-tenant setups?
Yes. To keep cache contexts independent, pass an optional ID using the X-Amzn-SageMaker-Prefix-Aware-Id header for the native Invoke API, or the prompt_cache_key field for the OpenAI API.
Amazon AI BlogRead Original Article

Get the latest Large Language Models news every morning

For example, today's edition would include:

  • Dynatrace acquires Arize AI as observability shifts to actionSiliconANGLE AI · 4h ago
  • Shared base cuts 100 fine-tunes from 1.5 TB to 19.3 GBDaily Dose of Data Science · 4h ago
  • OpenAI agents hit RubyGems, undisclosed since May 12thSimon Willison's Weblog · 4h ago

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. Q&As are published on this page for other readers too.

Related Articles

Next articleP&G CFO Schulten: Growth Rebound 12 to 18 Months Out