123DevOps··7 min read

What is KServe? Serving machine learning models on Kubernetes with InferenceService

Learn about KServe: the InferenceService CRD, built-in (sklearn, Hugging Face) and custom predictors, the Knative (serverless) and Standard (raw deployment) modes, autoscaling, canary, and its features for generative AI and LLMs.

Kubernetes

The data scientist hands over a model.joblib file and asks, “can we put this in production now?”. Between that file and a reliable endpoint there’s an HTTP server, an image, a Deployment, a Service, autoscaling, rolling out a new version without breaking the old one, and metrics. KServe packages all of that into a single Kubernetes resource.

What is KServe

KServe is an open source inference platform for Kubernetes that serves both predictive AI (classification, regression, recommendation) and generative AI (LLMs). You declare the model in an InferenceService resource, and the controller creates the model server, networking, autoscaling and traffic routing.

The project started in 2019 as KFServing, inside Kubeflow, and was renamed KServe in 2021. It is still part of the Kubeflow ecosystem and was accepted into the CNCF in September 2025, directly at the Incubating level. As of November 2026 that is its current status; check the project page at cncf.io/projects/kserve. It is licensed under Apache 2.0, and the latest version on the GitHub releases page as of this date is v0.21.0.

What problem it solves

Serving models looks simple until you reach production:

  • Every framework has its own server: scikit-learn, XGBoost, PyTorch, TensorFlow, Hugging Face. Without a standard, every team invents its own.
  • Uneven load: one model gets a thousand requests per second, another two per day; an idle GPU is expensive.
  • Risky version changes: publishing a new model means sending only a fraction of traffic to it and rolling back quickly.
  • Different protocols: every team exposes its own API and clients suffer.

KServe standardizes the inference protocol (V1, V2/Open Inference Protocol and, for LLMs, OpenAI-compatible APIs), provides ready-made runtimes, and integrates autoscaling and canary into the same resource.

How it works

The kserve-controller-manager watches InferenceService resources and generates the lower-level objects. An InferenceService has up to three components: predictor (required, runs the model), transformer (pre- and post-processing) and explainer (prediction explanations). Model servers are defined by ServingRuntime and ClusterServingRuntime; KServe picks the runtime from the modelFormat field. The resource status carries the endpoint URL and the Ready condition; in Knative mode, kubectl get isvc also shows how much traffic goes to each revision. The model itself comes from a storageUri (S3, GCS, PVC, Hugging Face, OCI), which in most cases is downloaded by an init container (the storage initializer) before the server starts.

CRD What it’s for
InferenceService Declares a served model: format, source (storageUri), resources and scaling
ServingRuntime / ClusterServingRuntime Defines the image and formats supported by a model server
InferenceGraph Chains several models into an inference pipeline
LLMInferenceService Resource dedicated to LLMs, with routing and distributed inference
LocalModelCache Keeps models cached on nodes to reduce cold starts

Deployment modes

Mode How it runs Autoscaling Note
Knative (formerly “Serverless”) Knative Serving KPA, request-based, with scale-to-zero Native revisions and canary; requires Knative
Standard (formerly “RawDeployment”) Plain Deployment + Service HPA or KEDA Fewer dependencies; no KPA scale-to-zero

The old names are still accepted but marked as legacy in the code. The default mode is set in the inferenceservice-config ConfigMap and can be overridden per resource with the serving.kserve.io/deploymentMode annotation.

Generative AI

For LLMs, KServe provides runtimes with a vLLM backend, OpenAI-compatible endpoints (chat completions, streaming and embeddings), local model caching and KV cache offloading. The LLMInferenceService CRD, built on the llm-d project, adds KV-cache-aware routing, prefill/decode disaggregation and multi-node inference. The GPU, vLLM and cost details are in Running LLMs on Kubernetes with vLLM; here the focus is KServe.

Hands-on example

The manifests below follow the official documentation and were validated only as YAML, because the test cluster doesn’t have the KServe CRDs installed. The first is the classic example with a sample sklearn model:

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: sklearn-iris
  namespace: ml-serving
spec:
  predictor:
    model:
      modelFormat:
        name: sklearn
      storageUri: "gs://kfserving-examples/models/sklearn/1.0/model"
      resources:
        requests:
          cpu: 100m
          memory: 512Mi
        limits:
          cpu: "1"
          memory: 1Gi
kubectl apply -f sklearn-iris.yaml
kubectl get inferenceservices sklearn-iris -n ml-serving

SERVICE_HOSTNAME=$(kubectl get inferenceservice sklearn-iris -n ml-serving \
  -o jsonpath='{.status.url}' | cut -d "/" -f 3)
curl -H "Content-Type: application/json" -H "Host: ${SERVICE_HOSTNAME}" \
  "http://${INGRESS_HOST}:${INGRESS_PORT}/v1/models/sklearn-iris:predict" \
  -d '{"instances": [[6.8, 2.8, 4.8, 1.4], [6.0, 3.4, 4.5, 1.6]]}'

For a Hugging Face model, change the format and point to the repository with hf://. In Standard mode, with HPA:

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: text-classifier
  namespace: ml-serving
  annotations:
    serving.kserve.io/deploymentMode: Standard
    serving.kserve.io/autoscalerClass: hpa
spec:
  predictor:
    minReplicas: 1
    maxReplicas: 4
    scaleMetric: cpu
    scaleTarget: 80
    model:
      modelFormat:
        name: huggingface
      args:
        - --model_name=classifier
      storageUri: "hf://<model-id>"
      resources:
        requests:
          cpu: "1"
          memory: 2Gi
        limits:
          cpu: "2"
          memory: 4Gi

When no runtime fits, you write your own server with the Python SDK (kserve.Model, with the load and predict methods) and publish it as a container:

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: custom-model
  namespace: ml-serving
spec:
  predictor:
    containers:
      - name: kserve-container
        image: registry.example.com/your-org/custom-model:1.0.0
        args:
          - --model_name=custom-model
          - --http_port=8080
        resources:
          requests:
            cpu: "1"
            memory: 1Gi
          limits:
            cpu: "2"
            memory: 2Gi

Canary

To roll out a new model carefully, update storageUri and add canaryTrafficPercent to the predictor. KServe keeps the previous revision receiving the rest of the traffic:

spec:
  predictor:
    canaryTrafficPercent: 10
    model:
      modelFormat:
        name: sklearn
      storageUri: "gs://kfserving-examples/models/sklearn/1.0/model-2"

The canary documentation for canaryTrafficPercent is written for Knative mode; the notes for recent releases add traffic splitting in Standard mode too, via Gateway API HTTPRoutes. Check the behavior in the version you run. To compare with regular deployment strategies, see scaling and updating applications on Kubernetes.

When to use it (and when not to)

Use KServe when:

  • Several teams publish many models and you want a single serving standard.
  • Models with sporadic traffic benefit from scale-to-zero.
  • You need canary, InferenceGraph pipelines or explainability without building every piece.
  • You want to serve predictive models and LLMs on the same platform, with standardized APIs.

Avoid it when:

  • It’s a single model with steady traffic: a Deployment with FastAPI and an HPA may be enough.
  • The team doesn’t want to operate Knative, a gateway and cert-manager; Standard mode reduces that, but not to zero.
  • You only consume models through third-party APIs and host nothing.

Alternatives

Option Focus When to consider
KServe Standardized serving on Kubernetes, predictive and generative ML platform with many models and teams
Deployment + vLLM directly LLMs, full control Few models, team comfortable with Kubernetes
Ray Serve (KubeRay) Python serving on Ray Complex Python pipelines, already using Ray
Seldon Core Model serving and orchestration Seldon ecosystem; check the license of the version
NVIDIA Triton Multi-framework inference server Can also run as a runtime inside KServe

For event- and queue-driven scaling, KEDA complements Standard mode.

Summary

  • KServe serves models on Kubernetes with the InferenceService CRD (serving.kserve.io/v1beta1)
  • CNCF Incubating project as of November 2026; check the current status on the project page
  • Built-in predictors via modelFormat (sklearn, huggingface and others) or custom containers
  • Knative mode with scale-to-zero or Standard mode with Deployment, HPA or KEDA
  • canaryTrafficPercent splits traffic between the new and previous revisions
  • For LLMs, there’s a vLLM backend, OpenAI-compatible APIs and the LLMInferenceService CRD
  • For a single simple model, a plain Deployment may be enough

A model only creates value when it answers in production; KServe turns that path into a YAML file.

Get updates on new posts and stay in the loop!