Skip to main content
Can a router reason about what will happen to a pod in the next few hundred milliseconds — rather than only observing the instant it was sampled? Yes. Predictive routing uses per-request learning to estimate latency before you send your request, and routes to minimize the delay you actually experience. Scenario: you have multiple decode pods. At sampling time Pod A looks best — its queue is empty and half its memory is free — so the EPP (edge pick-and-place) routes your request there. What the EPP can’t see is that 80 ms earlier another user started parsing a 40‑page document on Pod A. That work is still in prefill, hasn’t yet shown up in the scraped queue depth, and
A dark dashboard-style infographic titled "What It Can't See" showing "-80 ms" and "40 pages" with a stacked-pages icon, a "pod A" progress box at 50%, an "EPP" pod, and a "queue" indicator.
it hasn’t claimed the pod’s memory yet — but it will. So you were routed to the pod that looked emptiest but is about to be the busiest. This isn’t a metric bug: the snapshot was accurate for the sample moment. But sampling is reactive by nature — always one step behind events that are already in flight.
A dark-themed slide titled "Always One Step Behind" showing a horizontal timeline with a "Live metrics" badge on the left and icons labeled "EPP" and "overloaded" further right. An orange bracket beneath marks "one step behind," indicating a lag between EPP and the overloaded state.
Instead of chasing heuristic signals like queue depth or memory pressure, ask the question that actually matters for user experience: how slow will this pod be for my request? Distill latency into two actionable numbers: Queue depth, memory pressure, and batch size are all proxies for these two measures.
A dark presentation slide titled "Only a Stand-In" showing two pill-shaped buttons labeled "Queue depth" and "Memory pressure." The slide has a deep teal background with a small "© Copyright KodeKloud" note in the corner.
llm-d (the routing system) therefore routes on predicted TTFT and predicted TPOT for each candidate pod, not on the stand‑ins. That raises the key question: how can you know those two numbers in advance?
A dark teal presentation slide titled "How Would Anyone Know?" showing a small table comparing three pods (pod A, B, C) with millisecond latency values. The phrase "how would anyone know that" appears large near the bottom and a © KodeKloud credit is in the corner.
You can’t compute TTFT and TPOT exactly from first principles — they depend on GPU model, how much of your prompt is already cached (KV cache), inflight requests, batching behavior, token counts, and many small hardware and workload interactions. But every completed request is an example: inputs in, TTFT/TPOT out. So llm-d learns to predict those numbers from live examples. How the predictive loop is built
  1. The EPP pod gains two tiny sidecars:
    • a latency training server that converts every completed request into a training sample (prompt features, pod state at request time, measured TTFT and TPOT), and
    • a latency prediction server that reads the trained model and answers: “Given this prompt and this pod state, what are TTFT and TPOT?”
A diagram titled "The Training Server" showing a green container labeled "Latency training server (container 1)" with an arrow labeled "every completed request" pointing to a dark "training sample" box on the right. It illustrates completed requests being sent from the server to a training sample.
The training sample encodes:
  • pod telemetry (GPU type, approximate cache occupancy, inflight and queued work, recent batch sizes),
  • request features (token counts, prompt attributes),
  • and the measured TTFT/TPOT that resulted.
Those samples train an XGBoost model — a stack of decision trees that together form a fast, interpretable regressor. XGBoost (eXtreme Gradient Boosting) is a distributed, open‑source library for gradient‑boosted decision trees. For structured telemetry features like these, boosted trees often train faster and are easier to interpret than deep neural nets, while delivering accurate predictions.
A dark-themed slide titled "XGBoost, Unpacked" that highlights "eXtreme Gradient Boosting." It shows badges reading "Distributed," "Open source," and "Machine learning library" along with icons of decision trees and a network diagram.
The training server writes the latest model to a shared volume. The prediction sidecar loads that model and serves only one endpoint: given a candidate pod + prompt, return predicted TTFT and TPOT.
A dark-themed diagram titled "It Answers Questions" showing a left box labeled "given this prompt / this pod, right now" with an arrow to a green "Latency prediction server" container. The server is shown reading a purple "shared volume (model)" below and labeled "it does exactly one thing."
Operationally, the prediction server is a tiny sidecar inside each EPP pod. It serves per‑pod predictions from the XGBoost model that the training sidecar continuously retrains on live traffic. With per‑pod TTFT/TPOT estimates, the scheduler can compute an expected end‑to‑end latency and pick the pod that minimizes it — without hand‑tuning weights for queue depth, memory, and batch size.
A diagram titled "A Small Sidecar Service" showing an EPP pod with three containers — the picker, a latency training server, and a latency prediction server — with an arrow routing to "pod C" by predicted latency.
On each incoming request, before selecting a target, the EPP asks the prediction server for each candidate pod and chooses based on the predicted TTFT and TPOT.
A dark-themed diagram titled "On Every Request" showing a blue "EPP" pod (marked "you") sending a request down to a green "Prediction server" container. To the right is a large panel labeled "pod A" with column headers "TTFT" and "TPOT."
The loop then closes: the request runs, its real TTFT/TPOT are measured, and that measurement becomes a fresh training sample. The model continuously adapts to the live workload and hardware, removing the need for brittle manual tuning.
A dark-themed infographic titled "The Loop Closes" showing a circular workflow with nodes labeled predict, run, measure and train. A glowing metrics panel on the right displays a fresh sample's token count and performance numbers (e.g., 1,840 tokens, 392 ms).
Measured impact Google tested this predictive routing against heuristic scorers (queue depth and memory scoring) and reported roughly 40% lower TTFT and ITL (inter‑token latency).
An infographic on a dark teal background labeled "40% Lower" comparing heuristic scoring (long purple bar showing 910 ms) with a smaller latency prediction (546 ms). It also includes a Google logo and a "Heuristic scorers" element displaying 0.9.
ITL is the same gap TPOT measures; the key difference is that the router predicted future latency instead of reading present metrics.
A dark presentation slide titled "Predicting, Not Reading" showing a row of glowing green squares (tokens) with a bracket labeled "the gap" and callouts on the right reading "ITL — inter-token latency" and "TPOT — same measurement."
Prediction also enables policy‑driven routing: once the router can say Pod A ≈ 400 ms and Pod B ≈ 900 ms, you can attach latency targets and route toward SLOs rather than implicit heuristics. Prediction decides where a request should go. But this entire approach depends on one fragile resource: the KV cache — the saved state (your conversation, attention key/values) that lives in GPU memory. GPU memory is finite; when it fills, eviction happens.
An infographic titled "What It All Rests On" showing a purple "Latency prediction" box (with a green check and the caption "fixes where a request should go") stacked above a turquoise "Your saved work / the KV cache" box.
Your conversation from four minutes ago can be evicted to make room for another user’s state.
A slide titled "A Hard Limit" showing a diagram of GPU memory with several small memory tiles, one highlighted and labeled "yours." Captions at the bottom read "lives in GPU memory" and "never enough of it."
If you route perfectly to a pod whose KV cache has already been evicted, you’ve routed perfectly to nothing.
A dark teal slide titled "Perfectly, to Nothing" shows a green arrow labeled "A perfect route" pointing to a rounded box labeled "pod C." Below the pod is an orange trash icon with the red caption "already evicted."
So what happens when the scratchpad overflows?
Prediction improves routing by estimating end-to-end latency (TTFT and TPOT) from live, per-request signals, but it depends on cached state (the KV cache) being present on the chosen pod. Cache eviction remains a hard constraint: routing can only be as effective as the cache retention policy and available GPU memory allow.

Watch Video