← All posts

KServe Meets vLLM: Scalable LLM Serving on Kubernetes

vLLM makes one replica efficient. It does not decide how many replicas exist, where they run, how traffic reaches them or how a new model version is rolled out. On Kubernetes, KServe takes that job, and its Hugging Face runtime has used vLLM as the generative backend since 2024. I have not run this manifest on a cluster; I checked it against the docs only.

Version notice. Written against KServe 0.21. The latest stable release is v0.21.0 (25 September 2026), and v0.22.0-rc0 is a pre-release from 28 November 2026 (release list). Check the manifests against the version you install.

In short

  • KServe turns one custom resource into the Deployment, Service and routing for a vLLM replica, and its Hugging Face runtime has used vLLM as the generative backend since 0.13.
  • Standard mode gives KEDA scaling on vLLM metrics but no scale to zero; Knative gives scale to zero but not KEDA, so choose before you design scaling.
  • The newest LLM API, LLMInferenceService, is v1alpha1, and the v0.22.0-rc0 notes list removed and deprecated fields.
  • For one model on one machine, running vLLM directly is simpler.

Limits first

  • Scale-to-zero and GPU LLMs do not mix well. Scale-to-zero exists only in Knative mode, and the docs list cold-start latency for that mode. A model with tens of gigabytes of weights pays that cost on the first request after idle.
  • KEDA autoscaling is Standard mode only. The docs state "Autoscaling using KEDA is only available in Standard mode." Standard mode has no scale-to-zero, so in the documented setups you get KEDA metric scaling or scale-to-zero, not both; the KEDA examples keep minReplicas: 1.
  • The newest LLM API is alpha. LLMInferenceService is v1alpha1; InferenceService is v1beta1.
  • Extra moving parts. KServe adds controllers, a gateway and often Prometheus and KEDA.

What KServe is

KServe is a model serving platform for Kubernetes. The CNCF project page records its acceptance at the Incubating maturity level on 29 September 2025. According to the control plane page, KServe offers two resources:

  • InferenceService (v1beta1), for predictive models and standard generative serving. The controller reconciles it into Deployments, Services and networking, and sets up the HPA or optional KEDA.
  • LLMInferenceService (v1alpha1), for advanced LLM workloads: prefill/decode separation, multi-node orchestration and intelligent scheduling.

A separate LocalModel controller caches models on nodes. In an InferenceService, the predictor section names the model format and storage location, and the docs pick a matching runtime.

Standard or Knative

The same page describes two deployment modes and recommends Standard Deployment for LLMs. Older manifests and posts call the two modes RawDeployment and Serverless; the KServe source now marks those names deprecated in favour of Standard and Knative. Standard is the default, so the annotation in the manifest below only makes the choice explicit.

PropertyStandard DeploymentKnative
Built onStandard Kubernetes resourcesKnative Serving (Service and Revision)
IngressGateway API (recommended) or Kubernetes Ingress (limited)Istio or Kourier gateway, queue proxy in each pod
Scale to zeroNoYes, through the Knative autoscaler and Activator
KEDA on vLLM metricsYesNot available per the autoscaling docs

The request path

Request path from client through gateway and InferenceService to a vLLM pod on a GPU Client Gateway Service vLLM pod 1 GPU per replica created by the KServe controller /openai/v1/...
Figure 1. Request path for an InferenceService. The gateway is Gateway API, Istio or Kourier depending on mode; the controller creates what is inside the dashed box.

Clients call an OpenAI-style path through the gateway and select the service with a Host header or hostname. Changing a model version is an edit to one resource.

The Hugging Face runtime and vLLM

The 0.13 release (15 May 2024) added dedicated vLLM support. The release notes say vLLM is auto-mapped as the backend for supported tasks, and "If vLLM does not support a particular task, it will default to the Hugging Face backend." --backend=huggingface disables the mapping.

The 0.21 generative inference page lists these paths:

  • openai/v1/completions
  • openai/v1/chat/completions
  • openai/v1/embeddings
  • openai/v1/rerank

The openai prefix can be changed or removed with the KSERVE_OPENAI_ROUTE_PREFIX environment variable. The runtime accepts vLLM engine arguments; KServe picks the CUDA image if the resources include nvidia.com/gpu, otherwise the CPU image.

What the later releases added

The 0.15 announcement (18 June 2025) listed several LLM features; five are below. It gives no benchmark figures.

  • LMCache for offloading and sharing KV tensors across requests and instances, aimed at reduced time to first token.
  • KEDA autoscaling on vLLM metrics such as vllm:num_requests_running.
  • Multi-node inference for models too large for one node (the announcement gives Llama 3.1 405B as an example).
  • Envoy AI Gateway, initial support, with token-based rate limiting and model routing listed as capabilities.
  • LocalModelCache with support for multiple node groups.

The v0.22.0-rc0 notes (still a release candidate) mention, for LLMInferenceService, an opt-in DisaggregatedSet backend for prefill/decode services, KEDA autoscaling for those roles and a fix for CPU-only KV cache offloading. The same release adds SGLang as an alternative inference runtime, removes the spec.trustRemoteCode field from LLMInferenceService and deprecates WVA autoscaling support for it, so check existing manifests.

The LLMInferenceService overview says it is built on llm-d and gives spec.model, spec.template, spec.worker (multi-node, via LeaderWorkerSet), spec.prefill, spec.router and spec.parallelism. It says InferenceService can serve LLMs only in basic single-node deployments. I use InferenceService below as the more mature, better-documented path.

A manifest and a client call

This follows the Hugging Face text-generation example in the KServe 0.21 docs, with the small Qwen model from the autoscaling page. The text-generation page states the vLLM backend is enabled by default. Gated models such as Llama also need the token secret described there.

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: qwen-chat
  annotations:
    serving.kserve.io/deploymentMode: "Standard"
spec:
  predictor:
    model:
      modelFormat:
        name: huggingface
      args:
        - --model_name=qwen
      storageUri: hf://Qwen/Qwen2.5-0.5B-Instruct
      resources:
        limits:
          cpu: "4"
          memory: 16Gi
          nvidia.com/gpu: "1"
        requests:
          cpu: "2"
          memory: 8Gi
          nvidia.com/gpu: "1"

The storageUri says where to fetch the weights, and --model_name is the name clients put in the model field. The GPU line makes KServe pick the CUDA image; size CPU and memory for your own model.

The docs example for calling the service uses the completions path:

curl -v http://${INGRESS_HOST}:${INGRESS_PORT}/openai/v1/completions \
  -H "Host: ${SERVICE_HOSTNAME}" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen", "prompt": "Write a poem about colors",
       "max_tokens": 100, "stream": false}'

The paths are OpenAI-shaped, so the official Python client works with a changed base URL. The Host header stands in for DNS routing:

from openai import OpenAI

# INGRESS_HOST, INGRESS_PORT and SERVICE_HOSTNAME as in the curl call
client = OpenAI(
    base_url=f"http://{INGRESS_HOST}:{INGRESS_PORT}/openai/v1",
    api_key="not-used",
    default_headers={"Host": SERVICE_HOSTNAME},
)
reply = client.chat.completions.create(
    model="qwen",  # must match --model_name
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

vLLM alone and under KServe

vLLM alone serves an OpenAI-compatible API and Prometheus metrics at /metrics (the vLLM metrics docs show curl http://0.0.0.0:8000/metrics). The table separates what KServe adds from what you would build yourself.

ConcernvLLM alonevLLM under KServe
OpenAI-style APIProvided by vLLMProvided by the runtime, under /openai/v1/... (prefix configurable)
Model downloadYour entrypoint or init containerStorage URI in the resource, with optional node-local cache (LocalModelCache)
Deployment, service, routingYou write themCreated by the controller from one resource
AutoscalingYou configure HPA or KEDA yourselfResource fields; KEDA on vLLM metrics in Standard mode
Multi-node and disaggregated servingYou orchestrateLLMInferenceService (v1alpha1) documents these
Added componentsNoneKServe controllers, gateway, optionally KEDA and Prometheus

Autoscaling: what to scale on

CPU utilisation is a poor signal for an LLM replica: the work is on the GPU, so CPU load can stay low while requests queue. The KServe autoscaling docs scale on vLLM request metrics instead. Their example uses vllm:num_requests_running, with a target of 2 per pod for the Prometheus method and 4 for the OpenTelemetry method; 6 requests at target 2 gives 3 replicas. vLLM also exposes vllm:kv_cache_usage_perc, the fraction of used KV cache blocks (0 to 1). The KServe docs do not use it as a scaling metric, so check it yourself.

The relevant parts of the docs example (KEDA, Prometheus method):

metadata:
  annotations:
    serving.kserve.io/deploymentMode: "Standard"
    serving.kserve.io/autoscalerClass: "keda"
spec:
  predictor:
    minReplicas: 1
    maxReplicas: 5
    autoScaling:
      metrics:
        - type: External
          external:
            metric:
              backend: "prometheus"
              serverAddress: "http://prometheus.istio-system.svc.cluster.local:9090"
              query: vllm:num_requests_running
            target:
              type: Value
              value: "2"

The docs example also sets Prometheus scrape annotations, so merge these fields into your resource instead of applying the fragment alone. The docs values are examples; derive your target from load tests of your own model and GPU.

Cold start and model loading

A new replica must pull the image, fetch the weights, load them into GPU memory and start the engine. With storageUri, a storage initialiser downloads the model when the pod starts. The LocalModelCache docs describe pre-downloading to each node's local disk in a job, so pods read from a local volume instead. The docs say startup can be greatly improved but give no figures.

Local caching is off by default and needs nodes with NVMe storage, a local-storage class, node labels and a local.path that matches the agent DaemonSet hostPath (a mismatch causes repeated duplicate download jobs). The storage initialiser can fail with Init:OOMKilled if its memory limit is too low.

The choice is between keeping one replica warm (minReplicas: 1, Standard mode, paying for an idle GPU) and accepting cold starts (Knative, scale to zero). For interactive traffic I would keep one replica warm.

Before production

  1. Pick the deployment mode. Choose Knative only if scale to zero is worth a cold start.
  2. Set the scaling metric and target from load tests.
  3. Plan model caching. Measure startup with and without LocalModelCache before taking on its node requirements.
  4. Create the secret for gated models. The text-generation page uses a Secret named hf-secret with key HF_TOKEN, wired through a ClusterStorageContainer.
  5. Confirm the route prefix. It is /openai/v1/... unless KSERVE_OPENAI_ROUTE_PREFIX changes it.
  6. Wire up observability. Scrape vLLM's /metrics and watch vllm:kv_cache_usage_perc alongside the scaling metric.
  7. Read the release-candidate notes. Check existing manifests against the v0.22.0-rc0 removals and deprecations before upgrading.

Sources