Skip to main content
Version: Latest

SemanticRouter CRD Reference

SemanticRouter is the Operator-owned resource for deploying a Router and binding it to Kubernetes model services.

apiVersion: vllm.ai/v1alpha1
kind: SemanticRouter
metadata:
name: my-router
spec: {}

This page summarizes the top-level contract. The installed CRD is authoritative for nested OpenAPI validation and defaults:

kubectl explain semanticrouter.spec --recursive

The source schema is available in semanticrouter_types.go and the generated CRD in vllm.ai_semanticrouters.yaml.

Top-level spec fields

FieldPurpose
imageRouter image repository, tag, registry prefix, and pull policy.
replicasFixed replica count when autoscaling is not controlling replicas.
imagePullSecretsRegistry credentials referenced by name.
serviceAccountCreate or select the workload ServiceAccount.
serviceService type and API, gRPC, and metrics ports.
resourcesContainer CPU, memory, and other resource requests/limits.
persistenceModel-storage PVC settings or an existing claim.
configOperator configuration adapters and canonical routing object.
toolsDbFunction-tool records materialized for Router tool selection.
vllmEndpointsModel services discovered as canonical providers and model cards.
autoscalingHPA enablement and CPU/memory targets.
startupProbe, livenessProbe, readinessProbeWorkload probe tuning.
securityContext, podSecurityContextContainer and pod security settings.
podAnnotationsAdditional annotations, including scraper integration.
nodeSelector, tolerations, affinityPod scheduling constraints.
env, argsAdditional Router environment variables and arguments.
gatewayReference to an existing Kubernetes Gateway.
openshiftOpenShift Route behavior.
ingressKubernetes Ingress configuration.

vllmEndpoints

Each entry creates one logical provider model and one backend reference:

spec:
vllmEndpoints:
- name: qwen-backend
model: qwen/assistant
reasoningFamily: qwen3
backend:
type: service
service:
name: qwen-vllm
namespace: model-serving
port: 8000
weight: 1

Supported backend types are service, kserve, and llamastack. Optional loras declare adapters exposed by the generated routing model card. The first resolved model becomes the default unless configuration overrides it.

config

The Operator always renders a canonical v0.3 Router document. Its configuration surface has two parts:

  • config.routing passes through the canonical routing object, including model cards, signals, projections, decisions, algorithms, and route plugins;
  • typed adapter fields such as response_cache, tools, prompt_guard, classifier, complexity_rules, reasoning_families, api, and observability are translated into their canonical provider or global locations.

Do not assume an arbitrary local config.yaml key is valid directly under spec.config. Use the CRD schema and Configuration Workflows when moving between local YAML and the Operator.

The deprecated semantic_cache adapter is retained for compatibility; response_cache is the canonical field. Do not set both.

Status

status reports the observed generation, replica counts, conditions, phase, gateway mode, and detected OpenShift features. Controllers and automation should use conditions and status.observedGeneration, not only the phase.

kubectl get semanticrouter <name> -o jsonpath='{.status.conditions}'
kubectl get semanticrouter <name> -o jsonpath='{.status.observedGeneration}'