📷 "Docker HQ, San Francisco, California" by willbuckner is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.
Gateway API Inference Extension: Model-Aware Routing for LLMs on Kubernetes
Anyone taking their first steps with self-hosted Large Language Models on Kubernetes usually reaches for the proven pattern: a deployment with several model server replicas, a simple service in front, and a load balancer that distributes requests round-robin. This works in a demo setup. Under production load, however, the graphs show a different picture: GPU utilization looks moderate, throughput is passable – and yet the tail latency is four times higher than the median, while individual replicas are hopelessly overloaded while others next to them see hardly any traffic.
The problem lies not in the infrastructure, but in the routing logic. Ordinary Kubernetes services treat all requests as equal and interchangeable. This does not apply to LLM inference. This is exactly where the Gateway API Inference Extension comes in, an official Kubernetes project that has reached General Availability since 2025/2026 and is supported by implementations such as Envoy Gateway, kgateway, GKE Gateway, and Azure Application Gateway for Containers.
Why LLM Inference Breaks Conventional Load Balancing
Classic Kubernetes load balancing lives by three assumptions: requests are short, their resource consumption is roughly equal, and the backends are statelessly interchangeable. LLM inference violates all three.
A request over 200 tokens and a document summary over 60,000 tokens are both a single HTTP connection for kube-proxy – for the GPU cost factor, they can differ by orders of magnitude. At the same time, the backends are by no means interchangeable: a vLLM replica that has just served a prompt holds its prefix in the KV cache. Sending the same prefix again saves the prefill phase – the same request can be ten times faster on one replica than on another, simply because the cache is still warm there.
Added to this is the LoRA problem: those running many fine-tuned variants on shared base weights can avoid adapter swaps if the router directs traffic to the replicas that have already loaded the appropriate adapter.
The official Kubernetes project for the Inference Extension sums it up succinctly: LLM inference sessions are often long-lived, resource-intensive, and partially stateful – factors that round-robin or least-connections systematically ignore.
The Gateway API Inference Extension: InferencePool and Endpoint Picker
The extension does not replace an existing gateway – it extends it. Any ext-proc-capable Gateway API implementation (Envoy Gateway, kgateway, Istio, GKE Gateway, Azure Application Gateway for Containers) can be upgraded to an Inference Gateway.
Two central components are added:
InferencePool – the core resource (inference.networking.k8s.io/v1). Where a service only says “here is a group of pods”, an InferencePool defines a group of model server endpoints along with a reference to the router that selects the pods. The InferencePool is the central API object and has been GA since v1.0.0 of the extension.
Endpoint Picker (EPP) – a data plane component that communicates with the gateway via Envoy’s External Processing Protocol (ext-proc). Instead of forwarding blindly, the EPP evaluates live metrics of the model servers and selects the optimal replica. The signals include: prefix cache status (has this replica already seen the prompt?), KV cache utilization (is eviction imminent?), queue depth (how many requests are already waiting?), LoRA adapter availability (is the desired adapter loaded?), and request cost estimation.
The scheduling logic is pluggable – the project defines the interface, not the final scoring function. For production, the separate llm-d-router project is recommended, which brings advanced scorers, flow control, and additional APIs such as InferenceObjective and InferenceModelRewrite.
The Request Flow: From Gateway to the Right GPU
A typical request goes through several stations: The gateway matches an HTTPRoute and identifies the target InferencePool. Instead of forwarding directly to a pod, it consults the pool’s EPP. This fetches the current metrics from the model server endpoints, calculates a ranking, and instructs the gateway to forward to the optimal pod.
The project benchmarked this mechanism with vLLM on H100 GPUs: During a ramp-up from 100 to 1,000 queries per second, throughput was comparable to a standard service, but the p90 latency per output token and the end-to-end tail latency were significantly lower under higher load. The reason: The EPP avoids the hotspots that naive load balancers create through long-running inference requests.
When Adoption is Worthwhile
Not every team needs an Inference Gateway. Three conditions speak for it:
- Multiple replicas per model (with a single replica, the routing decision is trivial)
- Noticeable TTFT differences between replicas in the queue depth metric
- Multi-turn or agentic workloads where the prefix cache represents the dominant optimization
Before migration, a baseline measurement is recommended: document the p50/p99 TTFT ratio, prefix cache hit rate, and per-replica queue depth spread. The third value is the most important indicator – if one replica shows 40 waiting requests while another is at 2, the problem is not GPU capacity, but distribution.
Conclusion
The Gateway API Inference Extension turns Kubernetes not just into a container orchestrator, but into a platform for AI inference – without additional third-party load balancers. The approach is refreshingly pragmatic: extend instead of replace, pluggable scheduling logic instead of a monolithic solution. Anyone running LLMs on Kubernetes in production and questioning round-robin has found the right lever with the Inference Extension.
Sources
- asksumanta.com – Inference gateways on Kubernetes: model-aware routing for LLMs (October 2026)
- cloudandsre.com – Round-robin is malpractice for LLM traffic (2026)
- Kubernetes Gateway API Inference Extension – Official Project Documentation
- Microsoft Learn – Application Gateway for Containers Inference Gateway (November 2026)
🌐 Machine-translated from the German original, editorially reviewed. 🤖 Written with AI assistance.
Sponsored