GPU Model Serving on Kubernetes
A design for serving open-weight models on Kubernetes: dedicated GPU node pools, the NVIDIA GPU Operator or DRA for device management, vLLM behind KServe or a model gateway, queue-aware autoscaling, GPU telemetry and per-team cost reporting, in India regions where needed.
Clients and gateway
- Apps and agents
- API gateway
- Inference routing
Serving
- KServe
- VLLM
- Triton
Scaling
- KEDA / HPA
- Node autoscaler
- Kueue
GPU nodes
- GPU node pools
- NVIDIA GPU operator
- DRA driver
Observability and cost
- DCGM exporter
Prometheus + Grafana
- OpenTelemetry
How the pieces fit together. Read top to bottom.
Each layer builds on the one below it. A reference design; every real environment is adapted to its constraints.
-
Clients and gateway
- Apps and agentsOpenAI-compatible API calls
- API gatewayauth, rate limits, quotas
- Inference routingGateway API Inference Ext.
- Model registryapproved models and versions
-
Serving
- KServeInferenceService per model
- vLLMbatching, paged KV cache
- Triton (optional)non-LLM and ensemble models
- Model cacheweights on PVC or object store
-
Scaling
- KEDA / HPAscale on queue and GPU metrics
- Node autoscalerKarpenter or cluster autoscaler
- Kueuequota and batch queueing
- Scale to zerofor low-traffic models
-
GPU nodes
- GPU node poolstaints, per-SKU pools
- NVIDIA GPU Operatordriver, toolkit, device plugin
- DRA driverclaims, sharing, MIG
- India regionsMumbai, Hyderabad, Pune, Delhi
-
Observability and cost
- DCGM ExporterGPU utilization and memory
- Prometheus + Grafanalatency, tokens per second
- OpenTelemetrytraces from gateway to model
- OpenCostcost per namespace and model
From change to running system
-
1
Approve and register a model
The platform team pulls the model weights into an internal registry or bucket, records the license and version, and defines its GPU needs (memory, count, MIG profile or full GPU).
-
2
Deploy the model
A pull request adds a KServe InferenceService that runs vLLM with the chosen weights. GitOps applies it; the pod lands on a matching GPU node pool through tolerations or a DRA ResourceClaim.
-
3
Route requests
Clients call an OpenAI-compatible endpoint. The gateway authenticates, applies per-team rate limits, and the inference extension picks a replica based on queue depth and KV-cache load.
-
4
Scale with demand
KEDA scales replicas on pending requests or GPU utilization. When no GPU is free, the node autoscaler adds a node from the right pool; idle nodes are removed after a cool-down.
-
5
Measure quality and speed
Dashboards show time to first token, tokens per second, error rate, GPU memory and utilization per model. Traces link a slow user request to the model replica that served it.
-
6
Report cost per team
OpenCost allocates GPU node cost to namespaces and labels, so each team and model has a monthly cost view that FinOps and product owners can act on.
The choices that matter
Device plugin or Dynamic Resource Allocation
DRA reached GA in Kubernetes 1.34 and allows richer GPU requests and sharing. The classic device plugin is simpler and more widely supported by managed services today. Check your provider and driver versions first.
KServe or plain Deployments
KServe adds a standard model API, scale-to-zero and canary rollout at the cost of more components. For one or two models, a vLLM Deployment behind a gateway is often enough to start.
Share GPUs or dedicate them
MIG and time-slicing raise utilization for small models but add noisy-neighbor risk and harder capacity planning. Large models and latency-sensitive traffic usually get whole GPUs.
India region and GPU availability
Keeping inference in Mumbai, Hyderabad, Pune or Delhi regions supports residency needs, but GPU types and quota differ by region and cloud. Confirm SKU and quota before committing a design.
Autoscale on queue depth, not CPU
LLM servers are bound by GPU memory and batch size. Scaling on pending requests or KV-cache usage reacts to real load; CPU-based autoscaling does not.
Build it with us
Our Cloud & DevOps engineers design, build and run it in your accounts. Your team owns the code.
-
MLOps & AI Infrastructure
Production infrastructure for machine learning and LLM applications: GPUs on Kubernetes, model serving with vLLM, KServe or Triton, MLflow tracking, evals, prompt versioning and tracing, in India regions where needed.
See MLOps & AI infrastructure -
Private & India-Hosted AI
Run language models where your data already lives: open-weight or Indic models on your own cloud account, VPC or on-premise servers, India cloud regions, or zero-retention API setups that fit DPDP and sector rules.
See private & India-hosted AI
This design in depth
Components and the reason for each
An inference platform has to do four things well: place models on the right GPUs, batch requests efficiently, scale with demand without long cold starts, and show who is using what. Each component in the design maps to one of these jobs.
| Component | Job | Why it is there |
|---|---|---|
| GPU node pools per SKU | Placement | Different models need different memory and interconnect; taints keep CPU workloads off expensive nodes |
| NVIDIA GPU Operator | Placement | Installs and upgrades drivers, container toolkit, device plugin, MIG manager and DCGM consistently on every GPU node |
| vLLM | Batching | Continuous batching and paged KV cache make far better use of GPU memory than naive serving |
| KServe | Lifecycle | A standard InferenceService resource with canary rollout, scale to zero and a consistent API |
| Gateway with inference extension | Routing | Routes by model name and replica load, enforces auth and per-team limits |
| KEDA and node autoscaler | Scaling | Adds replicas on queue depth and adds GPU nodes only when replicas cannot be placed |
| Kueue | Fair sharing | Queues batch and evaluation jobs against team quotas so they do not starve online serving |
| DCGM exporter, Prometheus, OpenTelemetry, OpenCost | Visibility | GPU health, latency per token, traces and cost per namespace or model |
Background reading in our glossary: dynamic resource allocation, KEDA, quantization and open-weight models.
Network and security boundaries
Model serving pods should not need the internet. Weights are pulled from an internal registry or a private object storage bucket through VPC endpoints or private links, and an egress network policy denies all other outbound traffic from serving namespaces. This protects against a compromised dependency calling home and keeps prompts and outputs inside your network.
The gateway is the only entry point. It authenticates callers with your identity provider or service tokens, applies per-team rate limits and token quotas, and logs request metadata. Whether prompt and response bodies are logged is a deliberate decision: they may contain personal data covered by India's DPDP Act 2023, so we default to metadata only, with sampling and masking where debugging needs content. Model weights are treated as assets: the registry records source, license, checksum and approval, and only approved versions can be referenced in an InferenceService, enforced through admission policy. Teams are separated by namespace, with quotas on GPU requests so one team cannot claim the whole pool.
Deployment and upgrade flow
Three things change on different schedules, and each has its own path.
- Models: a new model version is added to the registry, evaluated offline on your test set, then deployed as a KServe canary receiving a small share of traffic. Latency, error rate and quality checks (automated evals and sampled human review) decide whether traffic shifts fully or rolls back.
- Serving runtime: vLLM releases often bring throughput gains and new model support, but can change defaults. New versions run first in a staging namespace with load tests that replay recorded traffic patterns, then roll out model by model.
- GPU stack: driver and operator upgrades go node pool by node pool. The GPU Operator can upgrade drivers in place with node draining, or new nodes come up with the new driver and old nodes drain. CUDA compatibility between the driver and serving images is checked before each step.
Kubernetes version upgrades follow the normal cluster process, with an extra check that the GPU Operator, device plugin or DRA driver supports the target version.
Operations runbooks
- Slow cold starts: large weights take time to download and load. Pre-pull weights to node-local storage or a shared volume cache, keep a minimum replica for latency-sensitive models, and use image streaming or lazy loading where your platform supports it.
- Out-of-memory on the GPU: usually KV cache pressure from long contexts or high concurrency. Reduce maximum context or concurrent sequences, enable KV cache quantization, or move the model to a larger GPU or tensor parallelism across GPUs.
- GPU errors in DCGM (Xid events, ECC errors): cordon the node, drain workloads, and replace the node; repeated errors on one instance type go to the cloud provider.
- Pending pods with no GPU capacity: check quota in the region, node pool limits and whether the requested SKU is available; fall back to a secondary SKU pool if the model supports it.
- Latency spikes: compare time to first token and inter-token latency; queueing points to scaling, inter-token slowdowns point to batch size or a noisy neighbor on a shared GPU.
- Quality regression after a model update: roll back the InferenceService to the previous version from Git and rerun the eval suite before retrying.
Cost drivers
GPU hours dominate. What drives them is how many GPUs are allocated versus actually busy, so the levers are utilization levers: continuous batching, right-sizing models to GPUs, quantization (for example FP8 or INT4 where quality holds on your evals), sharing GPUs through MIG for small models, scale to zero for rarely used models and scheduling batch work into idle capacity through Kueue. Purchase model matters too: committed capacity for the steady base, on-demand for peaks and Spot only for interruptible batch work. Secondary drivers are storage for model weights and caches, data transfer between zones, and observability volume from per-request telemetry. Context length is a quiet driver: long prompts consume KV cache memory and reduce batch size, so prompt design and caching affect GPU spend directly. Our agent running cost tool and model comparison tool help frame the trade-offs.
Variants and when to choose them
- Single model, single team: a vLLM Deployment behind a gateway on one GPU node pool. Quick to run; move to the full design when a second model or team arrives.
- Multi-model platform: the full design with KServe, quotas and cost reporting, for organizations serving several models to several teams.
- Disaggregated serving: separate prefill and decode stages on different GPU pools with KV-cache-aware routing (as in the llm-d project), for very high traffic large models where it measurably improves throughput.
- Batch inference: Kueue-managed jobs for document processing, embeddings or evaluations, sharing GPUs with online serving outside peak hours.
- Managed endpoints: a cloud provider's managed inference service when the team does not want to operate GPU nodes and model choice fits what the service offers.
- India-resident inference: clusters in Indian regions with weights and logs kept there, when contracts or data protection decisions require it.
Related pages: MLOps and AI infrastructure, private AI deployment and our GPU Kubernetes blueprint.
Questions about this design
Something else? Send us your question and an engineer replies with next steps.
Should we self-host models or use a hosted API?
Hosted APIs are usually the quickest start and give access to the largest models. Self-hosting open-weight models makes sense when data must stay in your account or in India, when steady high volume makes dedicated GPUs better value, when you need a fine-tuned model, or when you need control over versions and latency. Many organizations use both, routing each workload to the right option.
Which GPUs do we need for a given model?
Start from memory: model weights at the chosen precision, plus KV cache for your expected context length and concurrency, plus overhead. A model that does not fit on one GPU needs tensor parallelism across several GPUs with fast interconnect. Quantization reduces memory needs if quality holds on your evaluations. We size with load tests on candidate instance types before committing.
Can several small models share one GPU?
Yes, using MIG partitions on supported GPUs, which give hardware isolation, or time-slicing, which shares without isolation. Dynamic resource allocation in recent Kubernetes versions makes these requests more flexible. Sharing raises utilization for small or low-traffic models, but latency-sensitive and large models usually get whole GPUs to avoid noisy-neighbor effects.
How do we measure the performance of an inference service?
Track time to first token, inter-token latency, tokens per second per replica, request queue time, error rate and GPU memory and utilization, per model and version. Load tests should replay representative prompt and output lengths, because averages hide the long prompts that cause most problems. Quality is measured separately with evaluation suites run on every model change.
Other reference architectures
All architectures-
AWS Landing Zone with Amazon EKS
A multi-account AWS foundation for running Kubernetes: Organizations and Control Tower for accounts and guardrails, shared networking, EKS clusters per workload account, Pod Identity for AWS access, GitOps delivery and central security and logging.
See AWS landing zone with Amazon EKS -
GitOps Delivery Across Dev, Staging and Production Clusters
A GitOps design where Git is the source of truth for every cluster: separate app and environment repos, an Argo CD or Flux control plane, ApplicationSets for fleet rollout, promotion by pull request, external secrets and policy checks before and after merge.
See GitOps delivery across dev, staging and production clusters -
Open-Source Observability Stack on Kubernetes
An open-source observability design: OpenTelemetry for collection, Prometheus with Mimir for metrics, Loki for logs, Tempo for traces, Grafana for dashboards and alerts, SLOs defined as code, and an on-call path that pages people only for user impact.
See open-source observability stack on Kubernetes -
Secure Software Supply Chain for Containers
A CI/CD design that proves what runs in production: protected source, isolated runners, SAST and dependency scanning, SBOMs, signed images and provenance with Sigstore cosign, a controlled registry, admission policies that verify signatures, and runtime detection.
See secure software supply chain for containers