Skip to main content

CRD reference

Hearth CRDs use API group serving.hearth.dev/v1alpha1. This page documents the user-facing fields from api/v1alpha1/ and the generated CRD schemas. The API remains alpha: fields reserved for planned features may be accepted by Kubernetes but rejected during reconciliation. Those fields are marked below; schema presence alone is not a support claim.

LLMService

LLMService is a namespaced resource that describes what model to serve, which runtime to use, how many accelerator resources to request, how to scale, how to cache model weights, and how cold starts should behave.

Only spec.model is required by the CRD schema. Other sections are optional and use the defaults shown below when a default is defined.

For a service that can reconcile in the current implementation, set spec.model.source.uri and select a runtime with either spec.runtime.name or spec.runtime.selector.vendor. Catalog-only models and an omitted runtime are admitted by the alpha schema but reported as Degraded.

FieldTypeDefault / enumDescription
spec.modelobjectrequiredModel identity and source.
spec.model.catalogRefstring-Reserved for model-catalog resolution and currently rejected. Use spec.model.source.uri.
spec.model.sourceobject-Inline model source configuration.
spec.model.source.uristringrequired when source is setModel location. Supported schemes are hf:// (with huggingface:// as an alias), modelscope://, and pvc://<claim>[/<subpath>]. A pvc:// source mounts pre-staged weights read-only at /models, performs no download, and should use cache.strategy: None. oci:// and s3:// are not implemented.
spec.model.source.secretRefobject-Reserved for private model sources; currently rejected during reconciliation.
spec.model.source.secretRef.namestring""Name of the Secret holding source credentials.
spec.runtimeobject-Backend runtime selection. Pin a runtime by name or provide a vendor preference selector.
spec.runtime.namestring-Exact InferenceRuntime name to use, such as vllm-nvidia-a100.
spec.runtime.selectorobject-Runtime auto-selection criteria.
spec.runtime.selector.vendorstring array-Acceptable vendors in preference order, for example ["nvidia", "ascend"].
spec.runtime.argsOverridestring array-Arguments appended after the selected runtime's templated arguments. A duplicate flag may override an earlier value when supported by the runtime CLI.
spec.resourcesobject-Abstract accelerator, CPU, and memory request mapped onto the selected runtime at reconcile time.
spec.resources.acceleratorsinteger1, minimum 1Number of whole accelerator devices to request.
spec.resources.fractionobject-Reserved for sub-device sharing; currently rejected during reconciliation.
spec.resources.fraction.memoryquantity-Memory portion for a fractional accelerator request.
spec.resources.fraction.coresinteger-Core count for a fractional accelerator request.
spec.resources.cpuquantity-CPU request for the serving workload.
spec.resources.memoryquantity-Equal memory request and limit for each backend replica.
spec.scalingobject-KEDA-driven autoscaling configuration. Hearth supports LLM-aware signals rather than CPU or raw RPS.
spec.scaling.mininteger0, minimum 0Minimum backend replicas. 0 enables scale-to-zero.
spec.scaling.maxinteger1, minimum 1Maximum backend replicas.
spec.scaling.metricstringdefault queueDepth; enum queueDepth, kvCacheUtilqueueDepth drives scaling. kvCacheUtil is reserved and rejected during reconciliation.
spec.scaling.targetinteger10, minimum 1Desired metric value per replica.
spec.scaling.activationTimeoutduration string5mCold-activation deadline. In keepalive mode it bounds how long a request waits for readiness; in reject mode it bounds the demand lease retained after the immediate 503.
spec.scaling.scaleDownStabilizationduration string5mHPA stabilization window for scale-down and KEDA cooldown before the final transition to zero. Use whole seconds from 0s through the HPA limit of 1h.
spec.scaling.drainTimeoutduration string2mPre-stop wait for in-flight requests when the selected runtime sets spec.lifecycle.preStopDrain: true. Hearth widens the Pod termination grace period to this timeout plus a shutdown margin when needed.
spec.cacheobject-Model-weight cache configuration for reducing cold-start downloads.
spec.cache.strategystringdefault NodeLocalPVC; enum NodeLocalPVC, HostPath, SharedPVC, BakedImage, NoneCache backend. NodeLocalPVC, HostPath, and None are implemented. SharedPVC and BakedImage are reserved and rejected during reconciliation.
spec.cache.sizequantity50Gi (controller default)Requested cache PVC size for NodeLocalPVC.
spec.cache.storageClassNamestring-StorageClass for the cache PVC. Empty uses the cluster default.
spec.cache.prewarmbooleanfalseCreates a one-time Job that hydrates model weights for NodeLocalPVC or HostPath. It is skipped for pvc:// sources because those weights are already staged.
spec.endpointobject-Client-facing endpoint behavior.
spec.endpoint.openAICompatiblebooleantrueInformational in the current implementation; the gateway always exposes the OpenAI-compatible API.
spec.endpoint.coldStartobject-Behavior for requests received while the backend is scaled to zero or still loading.
spec.endpoint.coldStart.modestringdefault keepalive; enum keepalive, rejectkeepalive holds streaming requests open with SSE heartbeats; reject returns fast 503 + Retry-After.
spec.endpoint.coldStart.heartbeatIntervalduration string10sInterval between keepalive heartbeats while a cold streaming request is waiting.
spec.imagePullSecretsobject array-LocalObjectReferences applied to the backend, gateway, and prewarm pods so images from private / air-gapped registries can be pulled. The named Secrets must exist in the LLMService's namespace.
spec.imagePullSecrets[].namestring""Name of an image-pull Secret in the LLMService's namespace.

Kubernetes quantity fields accept standard resource quantity strings such as 8, 500m, 32Gi, or 60Gi. Duration fields use Go/Kubernetes duration strings such as 10s, 2m, or 5m.

Cache PVCs and prewarm Jobs contain immutable fields and are created once. Changing the model or cache settings does not rewrite an existing <service>-prewarm Job or <service>-cache PVC. Delete the Job to rerun prewarming; replace a PVC only after preserving any data you need.

LLMService status

FieldDescription
status.phaseSummary state: Pending, Loading, Ready, ScaledToZero, or Degraded.
status.resolvedRuntimeName of the InferenceRuntime selected by the controller.
status.replicasNumber of ready backend replicas. Gateway replicas are not included.
status.endpointURLIn-cluster OpenAI-compatible base URL, ending in /v1.
status.conditionsKubernetes conditions. Hearth maintains a Ready condition with ObservedGeneration set to the reconciled generation.

InferenceRuntime

InferenceRuntime is cluster-scoped configuration consumed by the LLMService controller. Its own controller is passive. Changing a runtime requeues services that pin it or select its vendor.

FieldTypeDefault / enumDescription
spec.familystringrequired; default and only value vllmServing-engine family.
spec.vendorstringrequired; enum nvidia, ascendRegistered backend adapter key.
spec.priorityinteger0Tie-breaker within one vendor; higher values win. Vendor preference order wins before priority. Equal top priorities are rejected as ambiguous, so pin spec.runtime.name in that case.
spec.containerobjectrequiredServing-container definition.
spec.container.imagestringrequiredImage that exposes an OpenAI-compatible API.
spec.container.argsstring array-Go templates rendered with .Model.Path, .Service.Name, and .Service.Namespace. LLMService.spec.runtime.argsOverride values are appended.
spec.container.envKubernetes EnvVar array-Environment copied to the container. Literal value strings may use the same templates; normal valueFrom sources remain available.
spec.container.portobjectrequiredNamed TCP port for the serving API and, when the runtime exposes them there, metrics.
spec.container.port.namestringhttpPort name referenced by Services and probes.
spec.container.port.containerPortinteger8000; range 1..65535Serving-container port number.
spec.acceleratorobjectrequiredDevice-plugin resource and Pod scheduling constraints.
spec.accelerator.resourceNamestringrequiredExtended resource advertised by the installed device plugin, such as nvidia.com/gpu or huawei.com/Ascend910.
spec.accelerator.sharingobject-Reserved fractional-device capability metadata. No current adapter implements fractional allocation.
spec.accelerator.sharing.supportedbooleanfalseDeclares runtime capability only; setting it to true does not enable sharing, and LLMService.spec.resources.fraction is currently rejected.
spec.accelerator.nodeSelectorstring map-Node labels copied to backend and prewarm Pods.
spec.accelerator.tolerationsKubernetes Toleration array-Tolerations copied to backend and prewarm Pods.
spec.accelerator.schedulerobject-Routes backend and prewarm Pods through an already-installed scheduler.
spec.accelerator.scheduler.namestringempty (default scheduler)Pod schedulerName, for example volcano.
spec.accelerator.scheduler.queuestring-Volcano queue rendered as the scheduling.volcano.sh/queue-name Pod annotation. A non-empty queue is rejected unless scheduler.name is volcano.
spec.healthobject-Model-load-aware serving probes.
spec.health.readinessKubernetes Probecontroller default: HTTP GET /healthControls when the backend receives traffic.
spec.health.livenessKubernetes ProbenoneDetects a failed process after startup.
spec.health.startupKubernetes Probecontroller default: HTTP GET /health, about 10 minutesProtects slow model loading from liveness restarts.
spec.lifecycleobject-Graceful serving-Pod termination settings.
spec.lifecycle.terminationGracePeriodSecondsintegerKubernetes default; minimum 1 when setBase Pod shutdown budget. Hearth widens it to cover drainTimeout plus 10 seconds when draining is enabled.
spec.lifecycle.preStopDrainbooleanfalseAdds a pre-stop wait for LLMService.spec.scaling.drainTimeout. The serving image must contain /bin/sh.
spec.metricsobject-Runtime metric metadata for external integrations. Hearth autoscaling uses gateway demand and does not consume these names.
spec.metrics.pathstring/metricsRuntime Prometheus scrape path.
spec.metrics.portstringhttpService port that exposes runtime metrics.
spec.metrics.queueDepthstringrequired when metrics is setRuntime pending-request metric name.
spec.metrics.kvCacheUtilstring-Runtime KV-cache-utilization metric name.
spec.metrics.runningstring-Runtime in-flight-request metric name.
spec.metrics.ttftstring-Runtime time-to-first-token metric name.

Runtime definitions describe Kubernetes integration; they do not install drivers, device plugins, CANN, schedulers, or inference kernels. Because the InferenceRuntime controller is passive, its status.conditions field is not currently populated; operational state is reported on each LLMService that consumes the runtime. Planned unsupported directions are summarized in the roadmap.