TAI BUI
Back to curriculum
LearnPython

Multi-Region LLM Serving and KV Cache Locality

Round-robin load balancing is harmful for cached LLM inference. A request that does not land on the node holding its prefix pays full prefill cost: roughly 800 ms at P50 on a long prompt versus ~80 ms with a cache hit. In 2026 the production pattern is a cache-aware router (vLLM Router in Rust, llm-d router) that consumes KV-cache events and routes on prefix-hash match. Recent research (GORGO) makes cross-region network latency an explicit term in the routing objective. Commercial "cross-region inference" offerings (Bedrock cross-region inference, GKE multi-cluster gateways) treat inference as opaque, so they handle availability and not TTFT. JPMorgan and Mayo Clinic ran us-east-1 failover in Nov 2024 at ~22 minutes. The DR reality: 32% of LLM DR failures come from teams backing up weights but forgetting tokenizer files or quantization configs.

TIME: ~60 minutesPREREQUISITES: Phase 17 · 04 (vLLM Serving), Phase 17 · 06 (SGLang RadixAttention)

Learning Objectives

  • Explain why round-robin load balancing breaks cached inference and quantify the TTFT penalty.
  • Diagram a cache-aware router: inputs (KV-cache events), algorithm (prefix-hash match), tie-breaker (GPU utilization).
  • Name the 32% DR failure driver for LLMs (missing tokenizer files / quantization configs) and state a three-file DR checklist.
  • Distinguish commercial cross-region offerings (Bedrock CRI, GKE Multi-Cluster Gateway) from KV-aware routing.

The Problem

Your service runs in us-east-1, us-west-2, and eu-west-1. You put an ALB in front with round-robin. Prefix cache hit rate in production drops to 8% and TTFT P50 triples. Your vLLM logs show requests paying full prefill cost almost across the board.

Round-robin is optimal for stateless services. LLM inference is stateful by design, because the KV cache encodes what the model has already seen. Routing blind means routing into the wrong cache.

Separately, your team has a DR plan. You back up model weights to S3 cross-region. A regional outage hits, you attempt failover, and the replica refuses to start. The tokenizer.json, the quantization config, and the RoPE scaling config lived in a separate bucket you didn't sync.

Multi-region LLM serving is a cache problem, a routing problem, and a DR-hygiene problem. The load balancer is the smallest part of it.

Warm-up0/3
1. Which kind of service is round-robin load balancing a good fit for?Warm-up
Four numbered request dots above four boxes labeled Server A, B, C, D, each dot pointing straight down into the server below it in left-to-right order.
Everyday setup, typed. No service type is named.
2. In vLLM or SGLang, what does a prefix cache hit let the server skip?Warm-up
A row of 12 token cells, the first 8 shaded as prefix (cached) and the last 4 marked suffix (new). An arrow runs only from the suffix cells into a box labeled prefill step. A dashed question mark box over the prefix segment reads question mark milliseconds of work.
Generic prompt split, typed. What happens to the prefix segment is left blank.
3. What does time to first token (TTFT) measure for an LLM request?Warm-up
A horizontal timeline with five labeled points in order: request sent, queued, prefill begins, first token, generation ends. No interval between any two points is bracketed or highlighted.
Generic event sequence, typed. TTFT is not drawn as a span here.
Check: The Problem0/3
1. Why is round-robin load balancing harmful for cached LLM inference?Explain
A card for a round-robin ALB across three regions listing cache hit rate 8 percent and TTFT P50 tripled, with a blank line for root cause.
The stem's own numbers, typed. The cause is left blank.
2. After you put a round-robin ALB in front of three regions, prefix cache hit rate falls to 8% and TTFT P50 triples. What is the best first fix?Analyze
A card for a round-robin ALB across three regions listing cache hit rate 8 percent and TTFT P50 tripled, with a blank line for best first fix.
The stem's own numbers, typed. The fix is left blank.
3. Failover starts and the weights are present in the standby region, but the replica refuses to start. Which gap is the likeliest cause?Analyze
A card stating weights are present in the standby region but the replica fails to start, with a blank line for the likely gap.
The stem's own facts, typed. The gap is left blank.

The Concept

Cache-aware routing

A request arrives with a prompt. The router hashes the prefix (say, the first 512 tokens) and asks each replica whether it has that prefix cached. Replicas publish KV-cache events on a pub/sub channel as they allocate and evict blocks. The router picks the replica with the match and falls through to a GPU-util-based tie-breaker if none has it.

vLLM Router (Rust, 2026 production-stack) subscribes to kv.cache.block_added events, maintains a prefix-hash → replica index, and routes with an O(1) lookup. It falls through to least-queue-depth when nothing matches.

llm-d router follows the same pattern but is Kubernetes-native. It publishes events via the ControlPlane API.

SGLang RadixAttention (Phase 17 · 06) is the intra-replica equivalent. Cross-replica routing sits upstream of it.

Numbers

TTFT P50 on a 2K-token prompt, Llama 3.3 70B FP8, H100:

  • Cache hit (same replica, prefix resident): ~80 ms.
  • Cache miss (cold prefill): ~800 ms.

That is a 10x gap. If your router hits 60-80% of prefix cache across replicas, you approximate single-replica performance at N-replica capacity. At 10% you approximate naive scaling.

Cross-region adds a constraint: network latency

Inter-region RTT:

  • us-east-1 ↔ us-west-2: ~65 ms.
  • us-east-1 ↔ eu-west-1: ~75 ms.
  • us-east-1 ↔ ap-southeast-1: ~220 ms.

Say routing sends a request from us-east-1 to a hot prefix in ap-southeast-1. On a 2K-token prompt the hit still wins: 80 ms plus a 220 ms RTT is 300 ms, against 800 ms for a cold prefill. On a short prompt where a cold prefill costs 250 ms, the 170 ms saved does not cover the round trip, and the remote hit loses. GORGO (2026 research) makes this explicit: minimize prefill_time + network_latency jointly, not prefill alone. Often the answer is to keep routing regional, and cross regions only for very long prefixes where prefill dominates.

Commercial "cross-region inference" does not help here

AWS Bedrock cross-region inference routes requests to other regions during capacity pressure. It optimizes availability, not TTFT, and treats inference as opaque. GKE Multi-Cluster Gateway does the same at the service level: failover with no awareness of the KV cache.

You still want an app-layer cache-aware router on top of these. They cover the "us-east-1 is on fire" case, and cache-aware routing covers the TTFT case.

DR hygiene: the 32% missing-files problem

A widely cited 2026 stat says 32% of LLM DR failures happen because teams backed up weights but forgot:

  • tokenizer.json or tokenizer.model
  • Quantization configs (quantize_config.json, AWQ scales, GPTQ zero-points)
  • Model-specific configs (RoPE scaling, attention masks, chat templates)
  • Engine config (vllm_config.yaml, sampling defaults, LoRA adapter manifests)

The fix is a three-file minimum DR manifest:

  1. All files under the HF model repo (weights + configs + tokenizer).
  2. Engine-specific serving config.
  3. Deployment manifest (K8s YAML, Dockerfile, dependency lock).

Then run a DR drill quarterly. The JPMorgan us-east-1 failover in Nov 2024 recovered in 22 minutes against a 30-minute SLA, and a rehearsed playbook is what makes a number like that possible.

Data residency is orthogonal

EU customer PHI is not allowed to leave the EU. If your cache-aware router sends a Paris-originated request to us-east-1 for a prefix match, you have violated GDPR regardless of the TTFT gain. Partition routers by residency boundary before you optimize for cache.

Numbers to remember

  • Cache hit vs miss TTFT gap: ~10x (80 ms vs 800 ms on a 2K prompt).
  • Inter-region RTT US-EU: ~75 ms.
  • DR failure: 32% miss tokenizer/quant configs.
  • JPMorgan us-east-1 failover, Nov 2024: 22 minutes (30-min SLA).
Check: The Concept0/25
1. What is cache-aware routing?Define
A box labeled request, prefix hash h, an arrow into a dashed box marked routing rule question mark, then arrows fanning out to three replica boxes each marked cache with no contents shown.
Setup only, typed. The matching rule is left blank.
2. What are KV-cache events in a cache-aware router?Define
A box labeled replica with a dashed arrow pointing to a box labeled router's index, the arrow labeled event question mark.
Setup only, typed. The message content is left blank.
3. What is the prefix hash in a cache-aware router?Define
A row of 12 token cells with the first six highlighted and labeled first N tokens, for example 512, with an arrow into a dashed box marked question mark value.
Setup only, typed. What the value is used for is left blank.
4. What does a product like AWS Bedrock cross-region inference provide?Define
A box labeled AWS Bedrock cross-region inference with an arrow into a dashed box marked provides question mark.
Setup only, typed.
5. What is a DR manifest?Define
A box labeled DR manifest with an arrow into a dashed box marked contains question mark.
Setup only, typed.
6. What is data residency?Define
A box labeled data residency with an arrow into a dashed box marked constrains question mark.
Setup only, typed.
7. Which statement about inter-region RTT from us-east-1 holds?Define
Two boxes labeled Region A and Region B connected by two opposite-pointing arrows marked RTT, with a note reading x milliseconds, illustrative, no real figure shown.
Generic illustration of round-trip time, typed.
8. Which pair of tools are examples of the cache-aware, LLM-aware load balancer category?Define
A box labeled LLM-aware, cache-aware load balancer, a category of load balancer, with an arrow into a dashed box marked example tools question mark.
Setup only, typed. No tool names are given.
9. What is GORGO, per the Key Terms table?Define
A box labeled GORGO with an arrow into a dashed box marked is question mark.
Setup only, typed.
10. What two inputs does a cache-aware router consume?Explain
A box labeled cache-aware router with two arrows entering from two boxes labeled input 1 question mark and input 2 question mark.
Setup only, typed. Neither input is named.
11. A request arrives and no replica holds its prefix. What does a cache-aware router do?Explain
A request with prefix hash h and three replica boxes each marked cache does not contain h, with a blank line for what the router does next.
Setup only, typed. Every replica lacks this prefix.
12. Roughly what is the TTFT gap between a cache hit and a cold prefill on a 2K-token prompt for Llama 3.3 70B FP8 on an H100?Explain
Two boxes, cache hit where the replica holds the prefix and cache miss, a cold prefill, each with a blank cost in milliseconds.
Setup only, typed. Neither cost is filled in.
13. What does a router achieve by hitting 60-80% of prefix cache across replicas?Explain
Two boxes, one for 60 to 80 percent prefix cache hits across replicas and one for about 10 percent hits, each with a blank outcome.
Setup only, typed. Neither outcome is filled in.
14. Why does SGLang RadixAttention not remove the need for a cache-aware router?Explain
Two boxes, SGLang RadixAttention and cache-aware router, with a dashed question mark box between them.
Setup only, typed. The relationship is left blank.
15. A us-east-1 request could hit a prefix in ap-southeast-1 (~220 ms RTT). When does that remote hit lose to a local cold prefill?Explain
A card listing remote region ap-southeast-1, RTT about 220 milliseconds, and two blank cost lines for local cold prefill and remote hit.
The stem's own given RTT, typed. Both costs are left blank.
16. Which situation do Bedrock cross-region inference and the GKE Multi-Cluster Gateway cover, and which do they leave to a cache-aware router?Explain
Two boxes, Bedrock cross-region inference plus GKE Multi-Cluster Gateway, and cache-aware router, with two blank labels reading covers question mark and leaves question mark.
Setup only, typed. Neither relationship is filled in.
17. What is the 32% LLM DR failure driver?Explain
A box labeled 32 percent of LLM DR failures with a blank line for cause.
The stem's own statistic, typed. The cause is left blank.
18. Which three items make up the minimum DR manifest?Explain
A table with three rows, item 1, item 2, item 3, each with a blank value.
Structure only, typed. No items are filled in.
19. The JPMorgan us-east-1 failover in November 2024 recovered in 22 minutes against a 30-minute SLA. What does the lesson credit for that?Explain
A card for the JPMorgan us-east-1 failover in November 2024 with a result of 22 minutes against a 30 minute SLA, and a blank line for what it is credited to.
The stem's own event, typed. The credit is left blank.
20. A 2K-token request in us-east-1 can hit a hot prefix in ap-southeast-1 (220 ms RTT) or pay a cold prefill locally. Which choice wins?Apply
A card for a 2000 token prompt originating in us-east-1 with a hot prefix in ap-southeast-1, RTT about 220 milliseconds, CACHE_HIT_MS of 80, and CACHE_MISS_MS of 800, with a blank line for winner.
The Concept section's own numbers for this case. The winner is left blank.
21. A teammate says Bedrock cross-region inference is enabled, so TTFT is handled. What is wrong with that assumption?Analyze
A box stating the claim that Bedrock cross-region inference is enabled so TTFT is handled, with a blank line for the flaw.
The teammate's claim from the stem, typed. The flaw is left blank.
22. A Paris-origin request matches a hot prefix in us-east-1 and the match would save 700 ms. Under an EU residency rule, what should the router do?Design
A card listing a Paris-origin request with a matching prefix in us-east-1, a 700 millisecond saving if routed there, and an EU residency rule, with a blank line for decision.
The stem's own facts, typed. The decision is left blank.
23. You serve US and EU users with strict TTFT SLOs and EU residency rules. Which routing design fits?Design
A card listing US and EU users, strict TTFT SLOs, and EU residency rules, with a blank line for routing design.
The stem's own requirements, typed. The design is left blank.
24. You must write the DR manifest for a 70B AWQ model on vLLM with 5 LoRA adapters. Which list is complete?Design
A card listing a 70 billion parameter AWQ-quantized model served in vLLM with 5 LoRA adapters, with a blank line for files needed.
The stem's own model description, typed. The file list is left blank.
25. Your prompts are short, with a ~250 ms cold prefill, and the hot prefix sits only in ap-southeast-1 (220 ms RTT) while the user is in us-east-1. Which policy fits?Design
A card for a short prompt, cold prefill cost about 250 milliseconds, a hot prefix in ap-southeast-1, RTT about 220 milliseconds, and the constant CACHE_HIT_MS of 80, with a blank line for policy.
The stem's own numbers for this case. The policy is left blank.

Use It

code/main.py simulates three routing strategies (round-robin, cache-aware regional, cache-aware global) on a multi-region workload. It reports cache hit rate, TTFT P50/P99, and the cross-region bill.

Check: Use It0/6
1. In main.py GLOBAL routing, a eu-west-1 request finds its prefix only on a us-west-2 replica. With the file's constants, what TTFT does it record?Apply
A card for GLOBAL strategy listing request origin eu-west-1, matching replica region us-west-2, the constant CACHE_HIT_MS of 80, and the constant RTT between eu-west-1 and us-west-2 of 130, with a blank line for TTFT recorded.
Constants are real, read straight from main.py. The recorded TTFT is left blank.
2. Under REGIONAL in main.py, a us-west-2 request has no match in us-west-2, but a us-east-1 replica holds its prefix. What happens?Apply
A card for REGIONAL strategy listing request origin us-west-2, no match in us-west-2, a match in us-east-1 noted as out of region, and the constant CACHE_MISS_MS of 800, with a blank line for served by and TTFT.
The stem's own facts, typed. What REGIONAL does with the out-of-region match is left blank.
3. Set CACHE_MISS_MS to 200 in main.py. Under GLOBAL, a us-west-2 request's only match is in eu-west-1. Where does it go?Apply
A card for GLOBAL strategy with CACHE_MISS_MS set to 200 for this question, request origin us-west-2, matching replica region eu-west-1, CACHE_HIT_MS of 80, and RTT of 130, with a blank line for routing destination.
CACHE_MISS_MS is changed to 200 for this question. Routing destination is left blank.
4. A run of main.py reports cross=250 for a strategy. What does report() print for its cross_cost?Apply
A card listing crossregion_count of 250 for this run and the constant CROSSREGION_COST_PER_REQ of 0.0004, with a blank line for crossregion_cost.
Both numbers are given directly. The product is left blank.
5. In main.py, GLOBAL almost always crosses regions when a remote match exists. What explains this?Analyze
A code excerpt of the condition that falls back to the local region when best_cost exceeds CACHE_MISS_MS, with the two constants CACHE_HIT_MS 80 and CACHE_MISS_MS 800, and a blank line for the RTT needed to trigger it.
Real condition and constants from main.py. The required RTT is left blank.
6. A reader sees a higher hit rate under REGIONAL than ROUND_ROBIN in main.py and credits routing alone. What does that miss?Analyze
Two boxes, ROUND_ROBIN marked lower hit rate and REGIONAL marked higher hit rate, with a blank line for another factor besides routing.
The stem's own comparison, typed. No specific percentages are shown.

Ship It

This lesson produces outputs/skill-multi-region-router.md. Given regions, residency constraints, and an SLA, it designs a routing plan.

Author's Note

I'd run main.py before trusting any of the numbers above. It is stdlib Python with 4 replicas in each of three regions and a 1000-request workload, and it prints hit rate, mean, P50, P99, cross-region count, and cost for each strategy. The 80 ms and 800 ms figures and the RTT table are constants at the top of the file, so what you are testing is the routing logic and not real hardware.

The part worth poking at is the GLOBAL branch. It prices a remote match as hit cost plus RTT and only falls back to the local region when that total exceeds the miss cost. With an 800 ms miss, that takes an RTT above 720 ms, which no pair in the table comes near. So this toy tilts toward crossing regions. The regional-wins case from the Concept section only shows up if you shrink CACHE_MISS_MS toward a short-prompt prefill, closer to CACHE_HIT_MS plus an RTT.

Two places the toy departs from the prose. The tie-breaker is queue_depth, a counter nudged by a random draw, not GPU utilization. And each replica holds at most 12 prefixes against 40 hot ones, evicting arbitrarily, so cache capacity shapes the hit rate as much as routing does. Residency partitioning and the DR manifest are not modeled at all. If I were building this for real, the residency split would come first, before any cache tuning.

Exercises

  1. Run code/main.py, then lower CACHE_MISS_MS (a stand-in for shorter prompts) until the GLOBAL strategy stops beating REGIONAL on mean TTFT. At what miss cost does cross-region routing stop paying off, given the RTT table?
  2. Your cache hit rate drops from 70% to 12%. Diagnose three possible causes and the observables that would confirm each.
  3. Design a DR manifest for a 70B AWQ-quantized model served in vLLM with 5 LoRA adapters. List every file and config.
  4. Argue whether Bedrock cross-region inference is "enough" for a fintech with strict TTFT SLOs. Cite specific behaviors.
  5. A Paris-origin request matches a prefix in us-east-1. Do you route it? Write the policy.

Key Terms

TermWhat people sayWhat it actually means
Cache-aware routing"smart LB"Route on prefix-hash match to KV-cache-holding replica
KV-cache events"cache pub-sub"Replicas publish block add/evict; router indexes
Prefix hash"cache key"Hash of first N tokens used as router lookup
GORGO"cross-region routing research"arXiv 2602.11688; network latency as explicit term
Cross-region inference"Bedrock CRI"AWS product; availability failover, not TTFT awareness
DR manifest"the backup list"Every file needed to restore, not just weights
Data residency"GDPR boundary"Legal constraint on which region sees user data
RTT"round-trip time"Network latency; 75 ms US-EU, 220 ms US-APAC
LLM-aware LB"cache-hit LB"Cache-aware router as a product category

Further Reading

Code

Ships With