Lab: Adding Custom Models to the OpenShift AI Model Catalog
This lab guides you through manually registering external models (e.g., from Hugging Face) into the OpenShift AI Model Catalog using the file-based configuration method.
Prerequisites
-
Access to the OpenShift Cluster via a terminal (
ocCLI). -
cluster-adminprivileges (or permissions to edit ConfigMaps in the model registry namespace).
Procedure
1. Switch to the Registry Namespace
First, ensure you are working in the correct namespace where the Model Registry components are running.
oc project rhoai-model-registries
2. Open the Catalog Configuration
The Model Catalog does not use a database for configuration; it uses a Kubernetes ConfigMap. You will edit this object directly.
oc edit configmap model-catalog-sources
|
You are editing a ConfigMap, not a local file. The file |
3. Configure the Registry and Add Models
You need to define two logical "files" inside this ConfigMap:
-
sources.yaml: Registers your custom catalog path. -
my-models.yaml: Contains the actual metadata for your models.
Copy and paste the following data segment of the block into the data: section of the ConfigMap.
-
Top-Level Fields: Only
name,description,readme, andmaturityare allowed here. -
customProperties: You must put
author,version,model_type, and other metadata here to avoid errors.
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: model-catalog-sources
# namespace: rhoai-model-registries
data:
# FILE 1: The Main Config - Points to your custom file
sources.yaml: |
catalogs:
- name: "Model-Registry-Lab"
id: "registry-custom-models"
type: "yaml"
properties:
yamlCatalogPath: "/data/user-sources/registry-models.yaml"
# FILE 2: Your Model Definitions (Add models here)
registry-models.yaml: |
models:
# --- MODEL 1: Qwen/Qwen3-0.6B ---
- name: "Qwen3-0.6B"
provider: XYZ Company
description: "Qwen Small Language Model"
customProperties:
model_type:
metadataType: MetadataStringValue
string_value: "generative"
author:
metadataType: MetadataStringValue
string_value: "Qwen"
version:
metadataType: MetadataStringValue
string_value: "1.0"
artifacts:
- name: "model-artifact"
uri: "s3://private-models/Qwen3-0.6B"
4. Save and Exit
-
Vi/Vim Users: Press
Esc, then type:wqand pressEnter. -
Nano Users: Press
Ctrl+O,Enter, thenCtrl+X.
If the edit is successful, you will see:
configmap/model-catalog-sources edited
5. Apply Changes (Force Reload)
The catalog service attempts to "hot reload" changes, but it is best practice in a lab environment to restart the pod to ensure a clean state and immediate update.
Waiting two minutes worked everytime, the following steps are presented here just in case you’re impatient.
oc delete pod -l component=model-catalog -n rhoai-model-registries
Wait for the new pod to start (Status: Running):
oc get pods -l component=model-catalog -w
Visual Verification
-
Open your Red Hat OpenShift AI Dashboard in your browser.
-
Navigate to the Model Catalog tab in the left sidebar.
-
Look for a new section or tab (depending on UI version) labeled "Private Enterprise Registry".
-
Success: You should see the card for "Qwen3-0.6B".
-
Click the card. Notice that the deployment source is NOT Hugging Face. It is your private S3 bucket URI.
Troubleshooting
-
Error:
json: unknown field "author"-
Fix: You placed
authorat the top level of the YAML. Move it insidecustomProperties.
-
-
Error:
sources.yaml: no such file or directory-
Fix: You likely accidentally deleted the
sources.yamlkey in the ConfigMap. Re-copy the full YAML block from Step 3.
-
-
Dashboard Issue: Models not visible in the UI.
-
Fix: In the OpenShift AI Model Catalog, check the Source filter. Uncheck "Red Hat AI" and ensure "Model-Registry-Lab" (or "All sources") is selected.
-