Inference routing is about pooling compute to serve LLM inference. Given a bunch of GPUs, possibly heterogeneous and spread out across data centers, we want to serve inference with speed, reliability, and low cost (= high utilization).
An increasing amount of focus is not on GPU kernel development itself, which is done for individual models and mostly automated – but on the systems that route requests and scale compute. These systems need to support new hardware, parallelism strategies and have creative economics to smooth out load.
Inference performance model
There are two main inference engines: vLLM and SGLang.
The standard API1 is POST /v1/chat/completions, which takes the prefix of a conversation and generates a completion from it. This is a usual JSON endpoint with text, but the text is immediately converted into tokens, which is how the model operates.
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.2-sol",
"messages": [
{"role": "user", "content": "What’s the largest city in Texas?"}
]
}'
Usually models have around 1 million tokens of maximum context, with the average length for “agentic” traffic (coding agents) being 128K.
LLM inference has two phases: prefill and decode. The engine runs a loop, switching between prefill and decode steps - each executing the entire model. Prefill involves processing big chunks of request input, usually at least 8192 tokens at a time. Decode processes one token at a time and generates the following token as output.
KV cache allows prefill to reuse already-computed work on prefixes.
People measure inference latency in terms of time to first token (TTFT), and time per output token (TPOT / ITL). Prefill affects TTFT, and decode affects TPOT.
Inference traffic is dynamic. New requests can come in at any time, we’re not sure how long each request will take, and we need to handle bursts. Instead of fixed capacity, engines use continuous batching where running requests will decode together. Low-batch size decode is memory-bound2, so as the batch grows and shrinks, we see an interactivity-throughput curve like the one below.

This means that decode is elastic: as more traffic comes into your service, continuous batching lets the batch size naturally settle to a point on the curve at that throughput. If you get a burst of traffic, it will slide your engine left on the curve; a period of less traffic will put you further right on the curve. Processing speed is dependent on workload.
In contrast, prefill is inelastic. It already processes big chunks of tokens at a time. You’ll generally see it cap out pretty quickly at a fixed token throughput, and if you get a burst of traffic it’ll start falling behind. Requests get queued, and TTFT explodes.

PD disaggregation (”disagg”) allows engines to run prefill and decode separately and specialize for each workload. Some analyses indicate it also improves mean TPOT.
If we program the GPU correctly3, well-tuned inference engines can be modeled as black-boxes that respond to prefill inelastically and decode elastically, according to measured curves. You then use data parallelism (DP) by running multiple replicas and routing requests between them. For large models that don’t fit on a single GPU, we also need to set inference parallelism:
The default in most engines is to do TP for everything, which is the simplest strategy. This tends to not be optimal though, except at low batch sizes. One common strategy is DPA+EP, or “DEP” for short, used by DeepInfer. However, DPA introduces some tricky problems for routing imbalance. DCP is also a promising strategy, but it’s hard to get it working for complex architectures.4
Wide EP refers to scaling large domains of expert parallelism, mostly for MoE models above 500B params. This allocates more memory for KV cache and gives the MoE kernels friendlier shapes. It’s how people primarily use big GPU domains like NVL72 for inference.
Speculative decoding (aka. MTP, EAGLE3, DSpark, DFlash) is a common optimization for inference. With a trained draft model, it reduces the number of decode steps and increases compute per step. Almost all inference is memory-bound, even at large batch size, so this greatly improves interactivity and throughput (usually 1.5-4x).

Local routing and KV cache systems
Once an inference engine is tuned, it’s usually scaled out within a data center. This is similar to a normal web service: you run multiple copies behind a load balancer. Traditional services call this replication; in ML this is also called “data parallelism” – so we’ll call the copies replicas or DP replicas for clarity.
To start, we ignore KV cache and DPA, so each replica operates independently. Classical load balancing algorithms also apply to inference:
Random. Route each request randomly. This distributes load poorly. If you have 1000 requests to 20 engines, they’ll get a range of [37, 64] concurrency.
Round-robin. Route requests exactly alternating between engines. This distributes load evenly if requests are equal, but when requests have varying size, it will lead to imbalance as well.
Least-load. Route requests according to the engine with the current least-load measurement, by concurrency, KV cache, or some weighted mix. This is good except can cause “herd behavior” with many engines – a cold engine can suddenly get all the requests and become very hot. Use power of two choices to avoid this. If you have 1000 requests to 20 engines, power-of-two gives a range of [48, 51] concurrency.
KV cache systems
Inference has some different characteristics though. To start, KV caches are shared between requests. Normally they’re stored in HBM on each DP replica, with an LRU (recency-based) eviction strategy. When you’re doing an agentic session, each tool call or follow-up message in the conversation becomes a subsequent request, and you want to route that to the same engine so it doesn’t need to be recomputed.

Agentic serving patterns refer to this case, where the vast majority (95%-99%) of tokens in requests on average are cached input. We typically need to route each request of the session to the same replica to avoid re-processing all of the prefix in prefill.
Cache-aware is a routing policy where the router keeps state of previous prompts and uses that to consistently route prompts with a shared prefix to the same engine. Typically this is done in-memory for ZDR compliance, and some routers will also use vLLM-style hash chains rather than storing the entire request’s content. Settings to tune:
Overload threshold: If the desired engine is overloaded, we should detect this and spill over the request to a different engine instead. In other words, “sticky until saturated”. This can be measured by KV cache, concurrency, queue size, …
Routing tree size: Generally you should try to keep requests, but there’s a tradeoff with CPU RAM to store these patterns.
Assignment policy: If a request doesn’t match any prefix, which worker do we assign it to?
Workers joining/leaving: As new workers join or leave the system, we want to make sure they get a fair share of the load, but we also want to avoid overloading them with spikes of uncached prefill at first startup.
KV cache tiering (HiCache, vLLM, Mooncake, LMCache). Cache-aware routing helps, but we’re still limited by GPU HBM to store all of the live sessions. What if the total amount of live sessions exceeds GPU HBM size? All inference engines have systems to offload storage of KV to different layers on the cache hierarchy. Generally “L1” refers to GPU HBM, “L2” refers to host DRAM, and “L3” refers to NVMe SSD / distributed filesystem.
DeepInfer is the most extreme example of this. DeepSeek’s production inference engine is known to solely keep KV cache in 3FS, an in-house distributed file system. In this way they are “L3-only” and skip the L1 and L2 layers. They are able to achieve predictable performance this way and skip cache-aware routing, improving load balancing and queue times on prefill with DPA parallelism.
A recent blog post from vLLM also advocates for skipping the L2 cache tier, solely using NVMe-backed KV cache. They are able to run a system with enough cache read bandwidth to avoid saturating the NVMe links. In their case, they size for SSDs being rated for a limited P/E cycle count rather than capacity. Using SSDs they improve cache hit rates from 93% to 96%, roughly halving the amount of FLOPs required for prefill compute.

LMCache’s recent blog post from August introduces security features around L3 KV cache storage. Placing KV cache on the SSD is a clear issue for ZDR compliance, so they encrypt the KV cache with key = HKDF(master key, cache salt). They acknowledge that this does not provide cross-tenant isolation though, as each tenant should have its own key.
PD Disaggregation
DistServe (OSDI ‘24) introduced a serving pattern called prefill-decode disaggregation, where the prefill and decode stages of inference are separated. KV are transferred via high-bandwidth networking (e.g., scale-out Infiniband) between prefill and decode nodes. Prefill-decode disaggregation is now a common way to deploy large-scale LLM inference.
The best way I have for thinking about PD disagg is that it improves mean per-token latency, i.e., interactivity on requests. This is based on a “time-sharing” argument that I’ve made in the past.
The time-sharing argument for PD. Assume that most of the time you spend for a single request is during the decode phase, as that is sequential (this isn’t always the case, but usually…). Prefill may take a second (TTFT or first token), but decode usually takes 10-50 ms per token of output. In this case, the main thing we care about is maximizing apparent interactivity to the user.
If you have N colocated engines, they will naturally spend some percent of their time on P and some percent of their time on D, given the load experienced by them. Let’s say that these fractions are p and d, such that p + d = 1. Then the equivalent, ideal PD disaggregated deployment with Np prefill and Nd decode replicas, using the same parallelism and kernels and with the same concurrency per decode replicas – except each request would finish 1/d times faster due to the decode engines not having to time-share with prefill. Applying Little’s law shows that this system has 1/d increased request speed and d reduced total concurrency, so it handles the same request rate and thus throughput.
PD disaggregation introduces other opportunities as well: you can run decode with wide EP while keeping prefill in smaller domains (as DPA introduces synchronization points) or even use other parallelisms like DWDP to remove multi-rank synchronization entirely.
However, PD disaggregation adds another layer of complexity to the routing and load-balancing question. The two phases use separate load balancing strategies: decode being least-load, prefill being cache-aware. And you’ll need a cross-node KV cache aggregate system like Mooncake to retain the same total cache capacity in HBM.
PD scaling also is heavily traffic-dependent. Now instead of getting a single replica count correct - you have two replica counts to tune. Depending on where you are in these two replica counts, you can end up in different states, akin to a phase diagram in physics.
Generally though, PD disaggregation helps us reason about inference engines better, as the two phases are analyzed and scaled independently. Prefill TTFT is modeled by queueing theory per the original DistServe paper, and decode interactivity can be modeled by interactivity-throughput Pareto curves.
EPD disaggregation is an extension of PD disaggregation that also separates out the vision encoder. Generally the vision encoder is a pretty small part of total FLOPs, so this pays off for smaller dense models rather than large LLMs.
Global routing
Local routing is great if you have one serving pool - a group of inference servers, each with the same kernels/parallelism/PD/cache system, replicated many times. But real systems don’t come that way at large scale. Once you start adding more data centers, accelerator types (TPUs, AMD, Trainium, Ascend), you’ll need to deal with inference deployments that span multiple regions and hardware types, as well as geographic network latency.
Suppose two pools are each serving 100 requests/s at 30 ms per output token, with zero load shedding or errors. One has enough warm GPUs to handle twice the traffic at the same latency. The other is nearly full and needs three minutes to bring up another replica. Both look healthy. Where should the next 20 requests/s go?
There’s not that many organizations that serve at this scale yet. We’ll review some approaches recently shared by Google and OpenAI in late 2026.
How much traffic can a pool take?
To start, let’s model the global router as something that takes signal and produces a rough traffic breakdown to each serving pool. Serving pool i gets some fraction pi of traffic, which sums to 1. We will assign requests consistently with cache-aware routing to each serving pool.

The prefill and decode curves from earlier give us a way to talk about capacity. A pool can have room for more decode while its prefill queue is already close to the point where TTFT takes off. And the same 100 requests/s can mean very different things depending on the prompt lengths, output lengths, and how much of the prompt is cached. So capacity is really how much of this traffic we can serve at this TTFT and TPOT target.
Geography and cache locality complicate this a bit. A farther pool can get you a first token sooner if it has a shorter queue or a warm prefix. Conversely, moving an agent session to a pool with spare GPUs can create a bunch of new prefill work. If your token-level cache hit rate drops from 95% to 90% at the same input-token rate, you’ve just doubled the number of uncached input tokens. The traffic split itself changes how much work the fleet has to do.
OpenAI used a black-box feedback loop based on measured interactivity, but this would thrash requests between regions if not tuned well, which broke KV cache hit rate.
The processing-rate derivative
Distributed Load Balancing with Workload-Dependent Service Rates (EC ‘25) introduced a simple local, fast-converging rule called GMSR to achieve provably global optimal routing. The key idea of the paper is to derive a processing-rate function μi(Ni) for each serving pool i with concurrency Ni. Then, by Little’s law, the policy that globally optimizes average request completion latency matches the policy with the lowest total concurrency. Taking the derivative, you can “just” route requests to minimize 1/μ′i(Ni).
(If TTFT is negligible, output lengths are similar, and the interactivity–throughput curve is locally close to a hyperbola, GMSR roughly equalizes interactivity across the pools a frontend uses.)
DLB (’26) extends this idea to LLM inference in particular and also adds a network latency term. Each request enters at the nearest datacenter i, and the router selects an eligible serving pool j using one of several cost functions, including the gradient-based cost 1/μ′j(Nj) + 2τij, where 2τij is the round-trip network latency (RTT).
This provides for a pretty reasonable low-coordination way to route traffic between multiple heterogeneous serving pools, without needing to correctly tune or model each aspect of their systems exactly. Local routers can simply predict the processing-rate derivative.

Scaling across regions
Having global routing respond quickly to requests is great, but this operates at the short time horizon where capacity is fixed. It doesn’t actually answer the long time horizon question of how to actually scale capacity across regions.
To my knowledge this is an open question, and I haven’t found much in the way of writing about this online. But I’ll describe some related ideas and techniques.
How we rebuilt provider routing for better, faster inference (’26) describes OpenRouter’s approach to routing across multiple model providers, which is effectively an adversarial black-box routing problem. OpenRouter has various service tiers (fast, correct) and constraints (ZDR, European governance); they use this along with historical metrics to produce a weighted “cost” for each provider under their umbrella. For instance, errors are folded in as one part of “routing cost.” Providers meeting the cost envelope get the lion’s share of traffic, but all providers get some amount of traffic determined by exponential falloff. This lets them naturally achieve GMSR-like results, while incorporating signals like error rate and quality.
Most providers behind OpenRouter likely need to have autoscaling and traffic control of their own to determine how they handle load. In this case, OpenRouter effectively acts as a global router, and individual providers with a single serving pool would autoscale that independently. You could imagine building a similar system for internal routing with this extra “cost” knob!
Dynamo ModelExpress is an Nvidia library that hooks into inference engines, allowing them to load model weights over Infiniband from other replicas on the same serving pool. (This is nontrivial – it handles parallelism and layouts.) Model weight loading is a big part of cold starts, so this can help make scaling more reactive (rather than predictive). R-Fork is an approach in the same vein for SGLang.
Some inference providers publish their methodology for selecting hardware, such as How to Deploy Your Model from Sail Research. However, these guides are still limited by using theoretical hardware numbers without taking into account achievable utilization from actual kernels. There’s a tradeoff between accuracy and measurement cost.
Model routing
So far we’ve held the model fixed. Once the router can pick the model, it can send routine work to a cheaper model and save a stronger one for the hard parts. For an agent, that decision depends on what happened in the previous turns. Switching models halfway through a session can turn a long, discounted cache hit into a fresh prefill.
RouteLLM learns from human preference data which prompts benefit from a stronger model. At request time, a threshold determines whether to use the strong or cheap model. Adjusting that threshold gives you a cost–quality curve.
OpenRouter Auto and Auto Code combine signals about task type and difficulty with benchmarks, live prices, and cache status. On a harder follow-up turn, the router can raise the current model’s reasoning effort and keep the session’s warm prefix.
Devin Fusion uses a frontier model to lead the task and delegate routine work to a cheaper sidekick with its own cached context. Lightweight classifiers flag when a different model might do better mid-session. Cognition makes those switches at context compaction, when the rewritten prompt would already need a fresh prefill.
Router by Ramp lets teams rank models on a weighted set of benchmarks and test candidate models on a sample of production traffic before switching. Its NVIDIA Switchyard integration routes individual coding-agent turns, so an agent can use a cheaper model for routine steps and escalate when it gets stuck.
Plato’s Key shows that a simple rotation (i.e., semi-orthogonal map) and rescaling can make a hidden state from one LLM usable by another. In factual recall tests across 20 model pairs, the swap made the receiving model produce the donor’s answer 41% of the time at the median. If this generalizes to longer contexts, a model switch could reuse some of the work the first model already did.
Security
Sensitive information often gets sent to LLMs these days! There have been many security incidents (example 1, example 2, example 3, example 4, example 5). The router is a trusted entity that processes user data—it needs to know who can reuse a prefix, where a request can run, and what state can outlive it. If a gateway can choose the model, there’s also a question of how the caller can verify which model actually ran.
Prefix cache isolation addresses the fact that a warm prefix changes response timing, which can reveal information about other tenants’ activity. Most inference engines allow you to mix a cache_salt into the first block’s hash. Later blocks inherit it through the hash chain, so the gateway can scope prefix reuse to a tenant or trust group.
Anthropic’s prompt caching docs give an example of how prefix caching can coexist with zero data retention. Anthropic documents prompt caching as ZDR-eligible and keeps KV tensors and hashes in memory with a five-minute or one-hour cache lifetime. Where the state lives, how long it lasts, and who can reuse it are separate properties.
Progress on provable inference for large language models describes FlashProve, a prototype that lets a provider commit to model weights and prove that selected output tokens match the model’s greedy decoding without revealing the weights. That gives a client a way to audit model substitution. The reported Llama 4 Maverick experiment took roughly 70–95× the GPU time of ordinary inference.
Multimodal inference
So far we’ve only discussed the common inference shape of (text, image) -> (text). There are use cases for multimodal inference - image, audio and video generation, real-time / live duplex models, world simulation, and creative editing tools.
ModServe (SoCC ’25) starts from an observation in Microsoft’s production traces that multimodal requests vary widely in size and arrive in bursts by modality. ModServe scales image and text capacity independently and routes image requests based on queued visual work. In a 128-GPU trace replay, it delivered 3.3–5.5× higher throughput while meeting latency targets.
Serving Multimodal at Scale in llm-d explains how the router estimates visual tokens and weighs worker load against cache affinity. A 200 KB JPEG and a 2 MB PNG can represent the same image and cost the same to encode. Two requests asking different questions about that image can also reuse its encoder embeddings even when their LLM prefixes differ.
vLLM-Omni and SGLang-Omni represent multimodal generation as a graph with separate batching and GPU allocation per stage. A speech model can chain text generation, audio-token generation, and a vocoder. A visual model can use a diffusion engine as one of its stages.
Future work
Many engineers and researchers have invested a lot of time in inference routing recently. Most of the work reviewed in this post has been from the past 6 months!
We’re still missing a true understanding of inference performance – oftentimes people will misunderstand benchmark numbers, especially around speculative decoding. And the engines themselves are very complex.
As organizations advance toward the frontier of efficient inference and better model architectures, including ones with DRAM-offloaded experts and other various complexities, routing will also need to adapt.
Inference engines and kernels are open-source. We need the router and KV cache system to turn compute into tokens. That’s how people see the benefits of AI research in the models they use.
There are also newer APIs like /v1/responses and /v1/messages preferred by OpenAI and Anthropic, respectively. But /v1/chat/completions remains common.
A simplification: Actually, almost all decode is memory-bound. And there are other factors: low-batch size decode is also slowed down by kernel launch overheads; medium batch sizes (~2-64) gradually increase active MoE weight load. Some of this is mitigated by techniques like PDL, aggressive kernel fusion and overlap (megakernels).
With CUDA graphs, low CPU overhead, well-behaved kernels, etc.
Parallelisms get much deeper and depend heavily on kernel and inference engine support, for instance this recent PR (arbitrarily selected) adds a lever to run KDA layers as TP but MLA layers as DPA.





Need to take notes
This is so awesome!!!!!!!