To deploy an LLM in production on Kubernetes, run an inference server such as vLLM on GPU nodes and request GPUs as nvidia.com/gpu limits. Model load time drives the probes and the scaling. Give the pod a startup probe that outlasts loading, and scale on queue length rather than CPU.

Illustration of a row of shipping containers on a GPU card, with people at laptops sending requests towards them.

Do you need Kubernetes to run an LLM in production?

Not always. In our view, Kubernetes pays off when your team already runs it and you have several models, several environments or steady traffic. For one model at modest traffic, a single GPU VM running vLLM is simpler to operate. A hosted API can be simpler again, because you do not schedule GPUs, manage drivers or plan around model loading. If you cannot say what Kubernetes would give you, start with one of those two.

What does a basic LLM deployment on Kubernetes need?

A basic deployment usually has seven pieces, and the vLLM guide to native Kubernetes walks through most of them.

  1. GPU nodes with the NVIDIA GPU Operator. NVIDIA says it automates the management of all NVIDIA software components needed to provision GPUs, including the drivers.
  2. A GPU request. Once the device plugin is installed, the cluster exposes nvidia.com/gpu, and Kubernetes says GPUs are only supposed to be specified in the limits section. If you also set requests, the two values must be equal.
  3. A PersistentVolumeClaim for the model cache. The vLLM guide calls the claim optional and says you can use hostPath or other storage.
  4. A Hugging Face token, only needed for gated models. The vLLM example passes it as HF_TOKEN from a Secret.
  5. A shared memory volume mounted at /dev/shm, as the vLLM example does.
  6. Health probes on /health. The HTTP example sets liveness and readiness probes on that path but no startup probe, so add one (see the next section).
  7. A Service in front of the pods, so clients have one address. The vLLM example uses a ClusterIP Service.

The vLLM guide includes a full manifest. We link to it rather than paste a shortened copy that would drift from the original.

Why does model load time shape probes and scaling?

A vLLM pod is not useful until its model has loaded, and that takes time. The vLLM Kubernetes guide warns that if the startup or readiness probe failureThreshold is too low for the server to start, Kubernetes kills the container and restarts it. Its Rust frontend gRPC example allows for model loading with a startup probe of periodSeconds: 10 and failureThreshold: 120, which is up to 20 minutes.

The Kubernetes answer is a startup probe. The Kubernetes probe docs say to set failureThreshold multiplied by periodSeconds long enough to cover the worst case startup time. The vLLM guide suggests finding the right value by removing the probes and measuring how long the server takes to be ready. Measure with your largest model, then size the probe to it.

A vLLM pod on a GPU node is not useful until its model has loaded. Its startup probe needs failureThreshold times periodSeconds long enough to cover the worst case startup time, the vLLM guide's Rust frontend gRPC example uses 10 seconds times 120, up to 20 minutes. If the probe is too short, Kubernetes kills the container and restarts it. Once the pod is ready, in our view, scale on the waiting queue rather than CPU.

Scaling has the same constraint. vLLM exposes Prometheus-compatible metrics on /metrics. The vLLM metrics page lists vllm:num_requests_waiting, the number of requests waiting to be processed, and vllm:num_requests_running. The KEDA Prometheus scaler scales on a Prometheus query against a target threshold, with an activationThreshold that activates the scaler. The Horizontal Pod Autoscaler can also fetch custom metrics through the custom.metrics.k8s.io API, which needs an adapter.

In our view, CPU use is a poor signal for a server bound by the GPU. A new replica also does nothing until its model has loaded. So scale on the waiting queue, and scale out before the queue gets long. For the launch tests that come after this, see our production LLM inference checklist.

Which vLLM Kubernetes option should you pick?

In our view, start with plain manifests if you run one or two models, and move to the production stack or KServe when that stops being enough. The vLLM guide lists many alternatives, including Helm, KServe, kubernetes-sigs/lws, llm-d and vllm-project/production-stack. The table covers plain manifests and three of them.

OptionWhat it gives youGood fit (our view)
Plain Deployment and Service (vLLM guide)You write the manifests for the PVC, Secret, probes and ServiceOne or two models, and a team that knows Kubernetes
vLLM production stack, installed with Helm (README)A reference stack on vLLM. Scale from one instance to many without changing application code, view metrics on a dashboard, and use request routing and KV cache offloadingSeveral vLLM replicas, and a ready-made starting point
KServe (docs)Its Hugging Face runtime uses vLLM and falls back to the Hugging Face backend for models vLLM does not support. It exposes OpenAI-compatible APIsTeams serving many model types, or already on KServe
LeaderWorkerSet (README)Deploys a group of pods as one unit of replication for a model sharded across nodes. All-or-nothing restart is opt-inModels too large for one node

The last row pairs with our post on serving LLMs across multiple GPUs. KServe and vLLM work at different layers. KServe is the serving layer on Kubernetes and vLLM is the engine it can use.

Where Xinference fits

Xinference is an AI inference platform for enterprise teams. It runs in your own environment, which means your VPC, your data centre or your servers. You choose the serving engine per model when you deploy it, from vLLM, SGLang, llama.cpp, Transformers or MLX. Changing engine means redeploying.

It puts one OpenAI-compatible API in front of every model, and every deployment option runs the same API. Moving between Xinference deployment options is a base URL change. If you would rather not run GPUs at all, the self-serve Model API serves DeepSeek V4.1 Flash, hosted in Australia. Don't see the model you need? Talk to us about adding it.

To try the self-hosted path first, follow our single-machine quickstart, deploy your first model in 10 minutes. To try the hosted path, Get API access.

What happens to your app when the LLM API goes down?

Every caller fails in its own way unless you decide the behaviour in advance. This section is advice and our view, and it applies whether the API is hosted or self-hosted.

Put retries and fallback for the hosted API in one place. That can be a gateway or a shared client library. Copying the logic into each service means each copy behaves a little differently, and you fix the same outage in every service.

Clients and agents can differ. One may retry indefinitely while another gives up when the connection drops. A fallback setting may fire only on overload errors and not on dropped connections. So check whether your fallback fires on a dropped connection as well as on overload errors, and test the failure you expect.

Watch real traffic, not only a synthetic check. A probe that sends one fixed request can stay green while real requests of a different shape fail. The Google SRE book says the four golden signals are latency, traffic, errors and saturation. It also says to track the latency of errors rather than just filtering errors out. Alert on the error rate and latency of real traffic.

In our view, a self-hosted model can be the last-resort fallback, with one condition. Switching to it must need no deploy. Keep it loaded and reachable on the same API shape, so the switch is a configuration change. A model that still has to load will not help during an incident.

In our view, per-team spend limits that stop traffic belong in the same gateway as failover. Otherwise one team's retry storm can use up the shared budget before the fallback is needed. The failover test in our production LLM inference checklist is a good place to rehearse all of this.

Questions

Can you run vLLM on Kubernetes without a GPU?

The vLLM Kubernetes guide has a CPU example, but it says that example is for demonstration and testing only. It also says CPU performance will not be on par with GPUs.

What is the difference between KServe and vLLM?

KServe is a Kubernetes model serving layer. vLLM is an inference engine, and KServe's Hugging Face runtime uses vLLM as its backend when it supports the model.

How do I handle LLM API failover?

Put retries and fallback in one gateway or shared client library, not in each service. Then test that the fallback fires on a dropped connection as well as on overload errors.

Can a local model be a fallback for a cloud API?

Yes, if switching to it needs no deploy. Keep the model loaded and reachable on the same API shape as the hosted API.

What should I autoscale an LLM on?

In our view, the waiting queue rather than CPU. vLLM exposes vllm:num_requests_waiting on /metrics, and KEDA or the Horizontal Pod Autoscaler can scale on a metric like it.