Architecture: The Distributed Inference Stack & Request Lifecycle
A monolithic deployment is an operational liability. To scale enterprise intelligence, you must decouple orchestration from execution.
In the previous module, we explored the vast toolkit llm-d provides—from cache-aware routing to disaggregated serving. But how do these features actually function inside a Kubernetes cluster?
Industrial-grade Generative AI requires two distinct layers of optimization. You need a high-performance engine to manage raw math and memory at the GPU level, and an intelligent control plane to manage traffic and efficiency across the entire cluster.
Red Hat OpenShift AI 3.3 combines the industry-standard vLLM engine with the Kubernetes-native llm-d framework to create this unified, split-plane stack.
The Core Concept: Decoupling Control vs. Execution
In a traditional microservices setup, an ingress controller blindly round-robins traffic. In the AI Factory, we use a "split-plane" design to ensure expensive requests are routed with surgical precision.
-
The Control Plane (
llm-d): This is the orchestrator. It acts as the "Traffic Cop" for your compute network. It maintains a real-time view of the health, queue length, and KV cache status of every worker pod, but it does not process the prompts itself. -
The Execution Plane (vLLM): This is the high-throughput worker engine running inside the pods. It utilizes PagedAttention to maximize GPU memory and handles the actual matrix multiplication required to generate text.
|
The Logistics Analogy
Think of running an LLM at scale like managing a global logistics network:
|
Component Breakdown
To build this architecture, four specialized components must work in perfect unison.
1. The Gateway API (The "Smart Router")
Standard Kubernetes networking is insufficient for distributed AI. We rely on a compliant Gateway API (Envoy) acting as the front door. Typically deployed in the openshift-ingress namespace as openshift-ai-inference, this Gateway intercepts incoming user requests and pauses to query the scheduler before forwarding the data.
-
Design Note: Because
llm-drelies heavily on native Gateway API routing, you must ensure legacy or conflicting service meshes (like OpenShift Service Mesh v2) do not override these specific routing paths.
2. The Inference Scheduler (The "Brain")
Also known as the Endpoint Picker Protocol (EPP), this component is the mastermind behind the Intelligent Inference Scheduling capability we discussed earlier. It runs continuous "Filter-and-Score" logic to select the absolute best destination for every single request.
-
Filter: It instantly removes unhealthy, overloaded, or updating pods from the candidate list.
-
Score: It scores the remaining pods based on queue length and KV Cache Affinity. If a pod already holds the conversation history in its memory, it scores higher.
3. KServe GenAI Controller (The "Factory Builder")
This is the operator that watches for your declarative configurations. When you submit an LLMInferenceService custom resource, this controller automatically builds the underlying Kubernetes Deployments, Services, and Route objects required to wire the Gateway to the Scheduler and the Workers.
4. vLLM Worker Pods (The "Engine")
These are the heavy lifters running in your user namespace. Managed seamlessly by the Leader Worker Set (LWS) Operator, these pods pull the model weights from your secure vault (MinIO/S3), hold them in GPU memory, and wait for the Gateway to hand them a prompt.
5. Deployment Strategy: The "Recreate" Trap
When applying updates to traditional stateless web applications, Kubernetes engineers rely on a "Rolling Update" strategy to maintain zero downtime.
|
Architectural Reality: Expect Downtime on Updates
When you select the Because massive Large Language Models consume so much VRAM, the system must completely terminate the old pod and release the GPU memory before spinning up the new pod. Updating a model via |
The Data Flow: Lifecycle of a Request
Understanding this six-step flow is critical for troubleshooting connectivity and explaining the architecture to downstream developers. The Scheduler makes the decision, but the Gateway moves the data.
-
Request In: A user application sends an OpenAI-compatible request (e.g.,
/v1/chat/completions) to the defined GatewayHTTPRoute. -
Gateway Intercepts: The Envoy Gateway receives the traffic and pauses the payload.
-
The "Brain" is Called: The Gateway forwards the request metadata (not the full prompt) to the Inference Scheduler, effectively asking: "Where should this go?".
-
Scheduler Decides: The Scheduler runs its Filter-and-Score logic. It identifies the pod with the shortest queue and the best cache match.
-
Instruction Issued: The Scheduler instructs the Gateway on exactly which vLLM worker pod should handle the request.
-
Gateway Execution: The Gateway receives the instruction and forwards the full prompt payload to the chosen vLLM pod. The pod generates the response and streams it back through the Gateway to the user.
Observability: Proving the Architecture Works
To demonstrate the value of this architecture back to the business, Platform Engineers must track the "Golden Signals" of inference via Prometheus.
| Business Goal | Prometheus Metric | Description |
|---|---|---|
Prove Responsiveness |
|
The primary measure of perceived speed. The scheduler directly lowers this by finding the least-busy pod. |
Prove Cost Savings (TCO) |
|
Your primary ROI metric. A 90% hit rate means cache-aware routing is working, allowing you to skip expensive compute cycles 90% of the time. |
Prove Efficiency |
|
Confirms that expensive Data Center GPUs are actively processing math and not sitting idle due to poor load balancing. |
Now that you understand the blueprint and the data flow, it is time to build it. Next, we will automate the deployment of this architecture using a declarative GitOps approach.