Use Kubeflow Model Registry
The Kubeflow Model Registry is a central repository for managing machine learning models, their versions, and associated metadata. It allows data scientists to publish models, track their lineage, and collaborate on model development.
TOC
Access the Model RegistryRegister a ModelOption 1: Using the UIOption 2: Using Python ClientDeploy a Registered ModelAccess the Model Registry
- Open Dashboard: Log in to the Kubeflow central dashboard.
- Model Registry: Click on Model Registry in the sidebar. This will take you to the list of registered models in your namespace.
Note: If you do not see the Model Registry, ensure a Model Registry instance has been deployed in your namespace by the platform administrator.
Register a Model
You can register models either through the user interface or programmatically using the Python client.
Option 1: Using the UI
-
Create Registered Model:
- Click Register Model.
- Model Name: Enter a unique name (e.g.,
fraud-detection). - Description: Add a description.
- Version details: Optionally add version information, tags, and metadata.
- Model Location: Provide the S3/URI to the model artifact (e.g.,
s3://my-bucket/models/fraud-detection/v1/). - Click Create.
-
Create Version:
- Click on drop down menu next to the Registered Model and select Register New Version.
- Enter version name, description, metadata and artifact URI.
- Click Register new version.
Option 2: Using Python Client
You can register models directly from your Jupyter Notebook using the model-registry Python client.
Prerequisites:
- Install the client:
python -m pip install model-registry=="0.3.5" kserve=="0.13" - Ensure you have access to the Model Registry service. If running inside a Kubeflow Notebook, you can use the internal service DNS (e.g.
http://model-registry-service.<namespace>.svc:8080).
Sample Code:
The following example demonstrates how to register a model stored in S3.
Deploy a Registered Model
Once a model is registered, you can deploy it as an InferenceService using KServe.
To deploy, you typically need the URI of the model artifact. You can retrieve this from the Registry UI or via the Python API:
Once deployed, the KServe controller will pull the model from the specified S3 URI and start the inference server.