Base models
BaseModel and ClusterBaseModel tell OME where a model's weights live and which nodes get them; OME parses the model's architecture, size and capabilities.
A BaseModel or ClusterBaseModel lets OME manage a model's weights. You say where the weights live and which nodes keep a copy. OME downloads the weights to those nodes, and runs serving pods only on nodes that hold them. A model on a PersistentVolumeClaim is mounted into the pods instead. OME also reads the model's files to learn its architecture, size and capabilities, and uses them to pick a serving runtime. An InferenceService then serves the model by naming it.
Since v1.3, a base model is optional: an InferenceService can name its runtime and load the weights another way. The model agent that downloads base models is optional too, so turn it on when you install OME.
BaseModel and ClusterBaseModel¶
The two kinds have the same spec and differ in scope:
| Kind | Scope | Used by |
|---|---|---|
| BaseModel | Namespaced | InferenceServices in the same namespace |
| ClusterBaseModel | Cluster | InferenceServices in any namespace |
An InferenceService names its model in spec.model.name, and the model's kind in spec.model.kind, which defaults to ClusterBaseModel. To serve a BaseModel, set kind: BaseModel. With the wrong kind, OME admits the InferenceService but doesn't create or update its serving workload; see An InferenceService that serves a BaseModel gets no pods.
Give BaseModels and ClusterBaseModels different names. When both kinds share a name, InferenceServices in the BaseModel's namespace get the BaseModel, even when they ask for the ClusterBaseModel.
This ClusterBaseModel downloads Qwen/Qwen2.5-7B-Instruct from Hugging Face to /mnt/data/models/qwen/qwen2-5-7b-instruct on the nodes that run the model agent:
apiVersion: ome.io/v1beta1
kind: ClusterBaseModel
metadata:
name: qwen2-5-7b-instruct
spec:
storage:
storageUri: hf://Qwen/Qwen2.5-7B-Instruct
path: /mnt/data/models/qwen/qwen2-5-7b-instructApply the file:
kubectl apply -f model.yamlclusterbasemodel.ome.io/qwen2-5-7b-instruct createdSet storage.storageUri, and for hf://, oci://, modelpack:// and local:// models, storage.path. OME fills in the rest of the metadata from the model's files, and the OME API reference lists every field.
Where the weights come from¶
storage.storageUri says where the weights are, and its scheme decides what OME does:
| Scheme | URI form | What OME does |
|---|---|---|
hf |
hf://{model-id}[@{revision}] |
Downloads the model from Hugging Face to path on the selected nodes. The revision defaults to main, and a node resolves it to a commit each time it processes the model. See Pin the revision. |
oci |
oci://n/{namespace}/b/{bucket}/o/{object_path} |
Downloads the model from OCI Object Storage to path on the selected nodes. |
modelpack |
modelpack://{registry}/{repository}[:{tag}], or @{digest} in place of the tag |
Pulls the model, a CNCF ModelPack artifact, from a container registry to path on the selected nodes, through an llmman serve daemon that you provide. The repository can contain slashes, and a node pulls whatever a tag points to each time it processes the model. See Pin the digest and ModelPack models. |
pvc |
pvc://{pvc-name}/{sub-path} for a BaseModel, pvc://{namespace}:{pvc-name}/{sub-path} for a ClusterBaseModel |
A metadata Job reads the model from the claim. Whatever the kind, only InferenceServices in the claim's namespace can use it. See Serve models from a PVC. |
local |
local://{path} |
Reads the model from a directory that's already on the selected nodes. See Serve models from node-local storage. |
vendor |
vendor://{vendor-name}/{resource-type}/{resource-path} |
Downloads and reads nothing. The selected nodes report the model ready. |
Pin the hf:// revision¶
The revision after @ in an hf:// URI is a full 40-character commit, or a branch or tag such as the default main. Before a download, the node turns the revision into a commit: it uses a 40-character commit as it is, and resolves anything else to the commit it points to on Hugging Face at that moment.
A node resolves the revision again every time it processes the model, whatever the model's downloadPolicy: when the node starts matching the model, when a change to the model makes all matching nodes process it again, and when its agent pod restarts. Once main moves, a node that processes the model again downloads the newly resolved commit — by default into the same path, which the download never cleans first. So two nodes that processed an unpinned model at different times can hold different snapshots of it, and one node can hold a mix of two.
To keep every node on one snapshot, put the commit in the URI, as in hf://Qwen/Qwen2.5-7B-Instruct@<commit>. Models that share files with downloadPolicy: ReuseIfExists share one copy per resolved commit: see Share Hugging Face artifacts.
Change the hf:// source¶
With the default downloadPolicy, AlwaysDownload, a download into a path that already holds files never cleans or checks them first. The agent downloads the resolved commit into the directory as it is, and skips every existing file whose size matches the snapshot's, without reading it — the rule that lets an interrupted download keep its finished files. When the files at path came from another revision, the download leaves a mix of the two:
- A file that isn't in the new snapshot stays. Nothing deletes it.
- A file whose name and size are unchanged between the revisions keeps the old revision's bytes. Only missing files, and files whose sizes differ, download.
Every in-place source change works this way: a storageUri edit to a new pinned commit or to another repository that keeps the same path, and main moving on an unpinned model. The node reports the model Ready at the new commit, and nothing records that the copy at path is mixed.
So when you change an hf:// model's storageUri, change path in the same edit, and the new snapshot downloads into an empty directory. Pin the revision too: then main can't change the source without an edit from you.
Models with downloadPolicy: ReuseIfExists switch cleanly: each resolved commit gets a shared copy of its own, which the agent checks against the commit's list of files, and a source change relinks the model's path to the new commit's copy. See Share Hugging Face artifacts.
Pin the modelpack:// digest¶
The tag in a modelpack:// URI names whatever it points to in the registry at pull time, and a node pulls the URI's reference again every time it processes the model — a copy already at path doesn't shorten the pass, as ModelPack models in the model agent guide describes. So once the tag moves, such as a v1 republished in the registry, a node that processes the model again replaces its copy with the new artifact, reports the model Ready as before, and nothing records that the content changed. Two nodes that process an unpinned model at different times can hold different artifacts, like an unpinned hf:// revision.
Unlike an in-place hf:// source change, the replacement is whole: the agent swaps the complete new artifact into path, so the copy is never a mix of two artifacts — just, silently, another version.
To keep every node on one artifact, put the artifact's digest in the URI in place of the tag, as in modelpack://ghcr.io/myorg/llama-3-70b@sha256:<digest>. The digest names the artifact's content, so every pass pulls the same artifact, wherever the tag moves.
Credentials¶
hf:// models read their token from a Secret that you name in storage.key. The agent reads the Secret from the model's namespace, or from ome for a ClusterBaseModel. The token comes from the Secret's token key, or from the key in storage.parameters.secretKey.
Create the namespace llama-demo, and a Secret in it with your Hugging Face token:
kubectl create namespace llama-demo
kubectl create secret generic hf-token -n llama-demo --from-literal=token="$HF_TOKEN"namespace/llama-demo created
secret/hf-token createdThis BaseModel downloads the gated model meta-llama/Llama-3.1-8B-Instruct with the token:
apiVersion: ome.io/v1beta1
kind: BaseModel
metadata:
name: llama-3-1-8b-instruct
namespace: llama-demo
spec:
storage:
storageUri: hf://meta-llama/Llama-3.1-8B-Instruct
path: /mnt/data/models/meta/llama-3-1-8b-instruct
key: hf-tokenThe agent uses the first token it finds:
- The Secret in
storage.key. storage.parameters.token, which leaves the token in plain text in the model's spec, so prefer a Secret.- The agent's own
HF_TOKENenvironment variable, if you set one.
Without a token, a gated model fails to download, and the node reports Failed.
oci:// models authenticate with the method in storage.parameters.auth: InstancePrincipal, the default, UserPrincipal, ResourcePrincipal or OkeWorkloadIdentity. storage.parameters.region overrides the region.
modelpack:// models take no credentials from the model: the llmman serve daemon talks to the registry, so storage.key and storage.parameters play no role. Give the daemon the registry's credentials in its own configuration. See ModelPack models.
How weights reach the nodes¶
The model agent puts the weights on the nodes. It runs as the DaemonSet ome-model-agent-daemonset, by default on all nodes whose taints it tolerates, including nodes with the nvidia.com/gpu taint. Helm values lists the settings that choose its nodes.
Since v1.3, the ome-resources chart installs the agent only when you set modelAgent.enabled: true. On v1.2.2, the chart always installs it. Without the agent, models stay In_Transit, except pvc:// models.
storage.path is the directory on the nodes that holds the model. Serving pods mount it read-only at the same path, and OME sets the MODEL_PATH environment variable to it, which the pre-configured runtimes load the model from.
The agent sees the host directory in modelAgent.hostPath, /mnt/data/models by default. Keep path under it, or mount more directories with modelAgent.extraVolumes and modelAgent.extraVolumeMounts.
With storage.downloadPolicy: ReuseIfExists, models that use the same Hugging Face files share one copy on each node. The default, AlwaysDownload, gives each model its own copy. See Share Hugging Face artifacts.
Choose the nodes¶
By default, all nodes that run the agent keep a copy of the model. Two storage fields narrow that down, and a node must match both when you set both:
| Field | A node matches when |
|---|---|
nodeSelector |
It has all the labels in the selector, with the same values. |
nodeAffinity |
It matches one of the requiredDuringSchedulingIgnoredDuringExecution terms. The agent ignores preferred terms. Unlike in pod scheduling, NotIn doesn't match a node that lacks the label. |
This BaseModel keeps a copy on the nodes of two instance types:
apiVersion: ome.io/v1beta1
kind: BaseModel
metadata:
name: llama-3-3-70b-instruct
namespace: llama-demo
spec:
storage:
storageUri: hf://meta-llama/Llama-3.3-70B-Instruct
path: /mnt/data/models/meta/llama-3-3-70b-instruct
key: hf-token
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node.kubernetes.io/instance-type
operator: In
values:
- BM.GPU.H100.8
- BM.GPU.H200.8When you change the model or a node:
| Change | What happens |
|---|---|
nodeSelector or nodeAffinity |
Nodes that stop matching delete their copy, and nodes that start matching download it. Since v1.3, nodes that still match keep their copy. On v1.2.2, they process the model again. |
The model's labels, an annotation whose key starts with ome.io/repair, or another storage field, such as storageUri, path or key |
All matching nodes process the model again. Among annotations, only the ome.io/repair prefix counts: adding, changing or removing a repair annotation, such as ome.io/repair-request: "1", requests the pass, and a change to any other annotation doesn't. A downloadPolicy change does this only for hf:// models. Changing an hf:// model's storageUri alone downloads over the old files by default, so change path too. |
displayName, modelCapabilities or other descriptive metadata |
Nodes keep their copy as it is. |
| A node's labels | Nothing, until you restart the agent pod on that node. The new agent downloads models that now select the node, and keeps copies of models that no longer do. |
Processing an hf:// model again also resolves its revision again. Without a commit in the URI, a node that processes the model after main has moved downloads the new commit — by default over its old copy, keeping the files that the new snapshot doesn't replace. Processing a modelpack:// model again pulls its reference again: without a digest in the URI, a node that processes the model after the tag has moved swaps in the new artifact whole.
While a node processes the model, the model's label there is Updating, so new serving pods avoid that node until it's Ready again. Running pods keep running.
Node labels and status¶
The agent labels each selected Node with the model's state there. The label key depends on the kind:
| Kind | Label key | Example |
|---|---|---|
| ClusterBaseModel | models.ome.io/clusterbasemodel.{name} |
models.ome.io/clusterbasemodel.qwen2-5-7b-instruct |
| BaseModel | models.ome.io/{namespace}.basemodel.{name} |
models.ome.io/llama-demo.basemodel.llama-3-1-8b-instruct |
When a ClusterBaseModel's name is longer than 32 characters, or a BaseModel's namespace and name together are longer than 38, OME shortens the key with a hash. Read the key from the Node's labels then.
The label is Updating while the agent downloads or checks the model, then Ready or Failed.
The model's status lists the nodes where it's ready and where it failed:
kubectl get clusterbasemodel qwen2-5-7b-instruct \
-o 'custom-columns=STATE:.status.state,READY:.status.nodesReady[*],FAILED:.status.nodesFailed[*]'STATE READY FAILED
Ready gpu-node-1,gpu-node-2 <none>Or select the nodes by label:
kubectl get nodes -l models.ome.io/clusterbasemodel.qwen2-5-7b-instruct=Ready -o namenode/gpu-node-1
node/gpu-node-2OME runs an InferenceService's serving pods only on nodes where the model's label is Ready. pvc:// models have no copy on the nodes, so their pods have no such constraint.
Model lifecycle¶
status.state is the model's state across the cluster, shown in the READY column of kubectl get basemodel and kubectl get clusterbasemodel:
| State | Meaning |
|---|---|
In_Transit |
No node has the model Ready or Failed yet. Nodes are still downloading it, the model agent is off, or the model selects no node that runs the agent. |
Ready |
At least one node has the model ready. |
Failed |
No node has the model ready, and at least one has failed. |
A model is Ready as soon as one node has it, so some serving pods can stay Pending while other nodes download it. If a model stays In_Transit or becomes Failed, see Troubleshooting in the model agent guide, or in the PVC guide for a pvc:// model.
Create an InferenceService once its model is Ready. OME needs the model's format, which it reads from the model's files, to choose or check a runtime. Without it, the admission webhook rejects the InferenceService with a message that ends in model format name is required.
Status freshness¶
Two more status fields say when OME last wrote the model's status: observedGeneration is the metadata.generation it had just reconciled, and lastReconcileTime is the time of the write. OME stamps them only when it writes the status, and for every model but a pvc:// one, it writes the status only when nodesReady, nodesFailed or status.state changes. So the two fields track status changes, not the controller's health:
- An edit that the nodes don't react to, such as a
displayNamechange, raisesmetadata.generationwithout changing the status.observedGenerationstays behind until the node lists or the state next change, which can be never. - On a
Readymodel that nothing changes,lastReconcileTimekeeps the time of the last status change. An hours-old value on a healthy model is normal, and doesn't mean the controller is stuck.
This model got a displayName edit after its last status change, and both it and the controller are fine:
kubectl get clusterbasemodel qwen2-5-7b-instruct \
-o 'custom-columns=GENERATION:.metadata.generation,OBSERVED:.status.observedGeneration,LAST_WRITE:.status.lastReconcileTime'GENERATION OBSERVED LAST_WRITE
2 1 2026-10-29T08:11:42ZA pvc:// model's fields do stay fresh. OME rewrites its whole status, and stamps both fields, each time it checks the claim and reads the metadata Job's outcome, and those checks recur because OME runs the Job again each time Kubernetes deletes the finished one. So its fields keep advancing while the controller runs, and a spec edit catches observedGeneration up at the next check.
Disable a model¶
To stop new use of a model, set disabled: true in its spec. The admission webhook then rejects new and changed InferenceServices that use it, with model qwen2-5-7b-instruct is disabled. OME also stops creating or updating their serving workloads, and records a ModelReconcileError event with specified base model qwen2-5-7b-instruct is disabled. Running pods keep running, and the weights stay on the nodes.
Delete a model¶
When you delete a model, a finalizer keeps it until the agent on each node that recorded the model reports its copy deleted. If a node's agent isn't running, the deletion waits until it runs again or the node leaves the cluster.
You don't have to wait for the download. On a node that's still downloading the model, the agent cancels the download, and a queued download never starts, so the nodes don't keep downloading weights you deleted. A canceled download doesn't mark the model Failed on the node. How a delete stops a download in the model agent guide says how quickly a running download stops; on v1.2.2, the agent can't stop an oci:// download that has started.
On each node, the agent removes the model's label and deletes the files of an hf://, oci:// or modelpack:// model from path, keeping every file that another model, in any namespace, still uses. A model with the same path — even written with a trailing slash, or reached through a symlink — keeps the whole directory, and a model whose path leads inside it keeps its own files and their parent directories while the rest goes; When the agent deletes files in the retention guide has the exact rules. The agent also keeps the whole directory when the model has the label models.ome/reserve-model-artifact: "true". It leaves local:// and vendor:// files in place. Files shared through ReuseIfExists follow the rules in Share Hugging Face artifacts. For pvc:// models, see Clean up in the PVC guide.
Set the reserve label when you create the model: adding a label later makes all matching nodes process the model again. See Keep downloaded model files.
What OME learns from the model¶
Once a node has the weights, the agent reads the model's config.json, or model_index.json for a diffusion pipeline, and two more files when they exist: hf_quant_config.json, and the config_sentence_transformers.json next to config.json. OME fills in these fields:
| Field | What OME records |
|---|---|
modelType |
The model type, such as llama. |
modelArchitecture |
The architecture, such as LlamaForCausalLM. |
modelFormat |
safetensors with version 1.0.0, or diffusers for a diffusion pipeline. |
modelFramework |
transformers with the config's transformers_version, or diffusers. |
modelParameterSize |
The number of parameters, such as 3.21B. |
maxTokens |
The context length. |
modelCapabilities |
What the model does, such as TEXT_TO_TEXT or AUDIO_TO_TEXT. Some models get several. See Model capabilities. |
quantization |
fp8, fbgemm_fp8, int4, nvfp4, mxfp4 or compressed-tensors. 4-bit GPTQ and AWQ models get int4. Other methods and unquantized models leave it empty. |
modelConfiguration |
A summary of the config, with keys such as context_length and torch_dtype. |
diffusionPipeline |
The pipeline's components, from model_index.json. |
OME fills in only empty fields, so a value that you set always wins. For pvc:// models, a metadata Job fills in the same fields, except modelConfiguration and diffusionPipeline.
Model capabilities¶
OME detects modelCapabilities with an ordered list of rules over the model's files. The first rule that recognizes the model writes its whole list of values, so a multimodal model gets several at once, and the rules after it don't run. The agent and the pvc:// metadata Job run the same rules.
The rules read the pipeline class — _class_name in model_index.json, such as FluxPipeline — and, from config.json, the model_type and the first entry of architectures, the architecture below. A third file adds one signal: a config_sentence_transformers.json next to config.json that sets similarity_fn_name marks the model as an embedding model. model_type matches ignore case; the others are case-sensitive. The first matching row fills the field:
| The model's files | modelCapabilities |
|---|---|
A pipeline class that contains ImageEdit, Pix2Pix, Img2Img or Inpaint |
IMAGE_TEXT_TO_IMAGE |
A pipeline class that contains TextToVideo or T2V |
TEXT_TO_VIDEO |
Any other pipeline class that contains Video |
IMAGE_TEXT_TO_VIDEO |
A pipeline class that contains Image, Pix, StableDiffusion or Flux |
TEXT_TO_IMAGE |
Any other model_index.json |
The empty entry |
A model_type that contains nemotronh_nano |
IMAGE_TEXT_TO_TEXT and TEXT_TO_TEXT, plus AUDIO_TEXT_TO_TEXT and VIDEO_TEXT_TO_TEXT when it contains nemotronh_nano_omni |
The architecture NemotronH_Omni_Reasoning_V3 with a vision key and "sound_config": null |
TEXT_TO_TEXT, IMAGE_TEXT_TO_TEXT and VIDEO_TEXT_TO_TEXT |
An architecture with the word Omni |
TEXT_TO_AUDIO, IMAGE_TEXT_TO_AUDIO, VIDEO_TEXT_TO_AUDIO, AUDIO_TO_TEXT and AUDIO_TO_AUDIO |
A model_type that contains inkling_mm_model |
TEXT_TO_TEXT and AUDIO_TEXT_TO_TEXT |
A vision key in config.json: vision_config, mm_vision_tower, image_token_id, image_token_index or img_processor |
IMAGE_TEXT_TO_TEXT |
An architecture that ends in ForCTC or ForSpeechToText, or is WhisperForConditionalGeneration |
AUDIO_TO_TEXT |
A config_sentence_transformers.json that sets similarity_fn_name, an architecture with the word Bert, Embedding or Sentence, or the architecture MistralModel with model_type mistral |
EMBEDDING |
An architecture that ends in ForCausalLM, ForConditionalGeneration or LMHeadModel |
TEXT_TO_TEXT |
| None of the above | The empty entry |
An architecture has a word when it appears as a CamelCase or underscore-separated segment: Qwen3Omni has the word Omni, and Demonic doesn't. The order carries intent: a vision model whose architecture ends in ForConditionalGeneration gets IMAGE_TEXT_TO_TEXT from the vision-key row, not the fallback TEXT_TO_TEXT, and NemotronH_Omni_Reasoning_V3 without "sound_config": null falls through to the Omni row's audio values.
config_sentence_transformers.json is the file the sentence-transformers library saves next to config.json for the embedding models it serves, and it's what detects decoder-based embedding models whose config.json is a causal LM's: a Qwen3-Embedding model's architecture is Qwen3ForCausalLM, but the file sets "similarity_fn_name": "cosine", so the model gets EMBEDDING instead of the fallback TEXT_TO_TEXT. For your own embedding model, ship the file with similarity_fn_name set, in the same directory as the config.json OME reads: a file that doesn't parse counts as no signal, and one in another directory doesn't count.
When no row matches, OME writes the empty entry — modelCapabilities: [""] — and you set the field yourself. The field is a list of plain strings, which OME doesn't validate, so prefer the values in the table; the API also names RERANK and AUDIO_TRANSLATION, which no rule writes, and lists the older task names TEXT_GENERATION, TEXT_SUMMARIZATION, TEXT_EMBEDDINGS, TEXT_RERANK, CHAT and VISION as deprecated.
Set the metadata yourself¶
Set these fields yourself:
modelFormatandmodelFramework, forvendor://models and models with unreadable files, such as a directory withoutconfig.json. These models still becomeReady, but OME needs both fields to choose a runtime.modelCapabilities, when no capability rule matches the model and OME leaves an empty entry.displayName,version,vendorandapiCapabilities, which OME never fills in.
To skip reading a model's files, add the annotation ome.oracle.com/skip-config-parsing: "true". OME then keeps only the metadata you set. For a pvc:// model, the metadata Job ignores the annotation and fills in the fields you left empty. This BaseModel sets the metadata that the runtime srt-llama-3-2-3b-instruct supports:
apiVersion: ome.io/v1beta1
kind: BaseModel
metadata:
name: llama-3-2-3b-instruct
namespace: llama-demo
annotations:
ome.oracle.com/skip-config-parsing: "true"
spec:
modelType: llama
modelArchitecture: LlamaForCausalLM
modelFormat:
name: safetensors
version: "1.0.0"
modelFramework:
name: transformers
version: "4.45.0.dev0"
modelParameterSize: "3.21B"
modelCapabilities:
- TEXT_TO_TEXT
storage:
storageUri: hf://meta-llama/Llama-3.2-3B-Instruct
path: /mnt/data/models/meta/llama-3-2-3b-instruct
key: hf-tokenHow runtimes match the model¶
A serving runtime lists the models it supports in supportedModelFormats, by format, framework, architecture and quantization, and can limit their size with modelSizeRange. Model version matching and Diffusion pipeline runtime matching explain when a model matches.
When an InferenceService doesn't name a runtime, OME chooses among the matching runtimes that have an entry with autoSelect: true. A ServingRuntime in the InferenceService's namespace wins over any ClusterServingRuntime, and among runtimes of the same kind, the highest score wins.
When an InferenceService names a runtime, OME uses it even if the runtime doesn't declare support for the model, and records a RuntimeCompatibilityAdvisory event. Sharded models are the exception; see Distribution.
DistributionUnreleased: coming in v1.3¶
spec.distribution decides how the weights are laid out. PerNode, the default, puts a full copy on each selected node; leave the field out to get it.
Sharded is for loading the model in chunks from a model cache provider, which this release can't configure yet. The admission webhook rejects InferenceServices that use a Sharded model, even when they name a runtime. The message includes no model cache provider is configured for sharded model loading.
Fine-tuned weights¶
A FineTunedWeight holds weights fine-tuned from the base model in its baseModelRef. To serve it, name the base model in spec.model.name and the FineTunedWeight in spec.model.fineTunedWeights. OME serves one fine-tuned weight per InferenceService.
Next steps¶
- Serve models from a PVC: serve weights from a PersistentVolumeClaim.
- Serve models from node-local storage: serve weights already on the nodes' disks.
- Run the model agent: install, tune and troubleshoot the agent.
- Share Hugging Face artifacts: keep one copy of shared Hugging Face files per node.
- Serving runtimes: how a runtime declares the models it supports.