You can use the cloud-native AI suite to manage models in MLflow Model Registry. This topic describes how to use AI Developer Console and the Arena CLI to manage models.
Background information
MLflow is an open source machine learning lifecycle management platform, which can be used to track model training information, manage machine learning models, and deploy machine learning models. For more information about MLflow Model Registry, see MLflow Model Registry - MLflow documentation.
Prerequisites
A Container Service for Kubernetes (ACK) Pro cluster that runs Kubernetes 1.20 or later is created. For more information, see Create an ACK Pro cluster.
Console and Scheduling Component of the cloud-native AI suite are installed. For more information, see Install the cloud-native AI suite.
A Resource Access Management (RAM) user is created in the RAM console and associated with a quota group. For more information, see Create a RAM user. For more information about how to associate quota groups with RAM users, see Step 1: Create a quota group for the RAM user.
The MLflow component is deployed in the
kube-ai
namespace of the ACK cluster. For more information, see Configure MLflow Model Registry.(Optional) To use Arena to manage models, configure the Arena client. The Arena version must be 0.9.14 or later. For more information, see Configure the Arena client.
Use AI Developer Console to manage models
Add registered models
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the cluster that you want to manage and choose in the left-side navigation pane.
In the upper-left part of the Cloud-native AI Suite page, click AI Developer Console. Then, in the left-side navigation pane of the Cloud Native AI page, click Model Manage.
On the Model Manage page, click New Registered Model.
In the New Registered Model dialog box, configure the Name, Tags, and Description parameters.
In the following example, the model name is
my-model
. Thekey1
andkey2=value2
tags are added to the model. The model description isThis is some description about my-model!
.After you complete the configuration, click OK and refresh the model list. Then, the registered model is displayed in Registered Models list.
View registered models
In the registered model list on the Model Manage page, click the name of your model to view the detailed information about the model on the Registered Model Details page.
Modify registered models
On the Registered Model Details page, you can perform the following operations:
Modify the name of the registered model.
Modify the description of the registered model.
Modify the tags of the registered model or add tags to the model.
Add a model version.
Use Arena to manage models
For more information about how to use Arena to manage models, see Model Manage Guide - Arena Documentation.
Add model versions
Run the following command to add a model version:
arena model create \
--name my-model \
--tags key1,key2=value2 \
--description "This is some description about my-model" \
--version-tags key3,key4=value4 \
--version-description "This is some description about my-model v1" \
--source pvc://my-pvc/models/my-model/1
Expected output:
INFO[0000] registered model "my-model" created
INFO[0000] model version 1 for "my-model" created
Query registered models or model versions
Query registered models
Run the following command to query a registered model named
my-model
:arena model get \ --name my-model
Expected output:
Name: my-model LatestVersion 1 CreationTime: 2024-04-29T16:15:26+08:00 LastUpdatedTime: 2024-04-29T16:44:17+08:00 Description: This is some description about my-model! Tags: key1: key2: value2 Versions: Version Source --- --- 1 pvc://my-pvc/models/my-model/1
Query model versions
Run the following command to query a model version whose model name is
my-model
and version number is1
:arena model get \ --name my-model \ --version 1
Expected output:
Name: my-model Version: 1 CreationTime: 2024-04-29T16:42:18+08:00 LastUpdatedTime: 2024-04-29T16:42:18+08:00 Source: pvc://my-pvc/models/my-model/1 Description: This is some description about my-model v1 Tags: createdBy: arena key3: key4: value4
List all registered models
Run the following command to list all registered models:
arena model list
Update registered models or model versions
Run the following command to update a registered model named my-model
:
arena model update \
--name my-model \
--description "This is some updated description" \
--tags key1=updatedValue1,key2=updatedValue2
Expected output:
INFO[0000] model version "my-model/1" updated
To delete the tags of a model, append hyphens (-
) to the tags. In the following example, the key1
, key2=value2
, key3
, and key4=value4
tags are deleted:
arena model update \
--name my-model \
--tags key1-,key2=value2- \
--version 1 \
--version-tags key3-,key4=value4-
Delete registered models or model versions
Deleting a registered model also deletes all model versions associated with the model. Proceed with caution.
Delete registered models
For example, you can run the following command to delete a registered model named
my-model
:arena model delete \ --name my-model
To prevent user errors, the system prompts you to confirm whether to delete the specified model when you run the preceding command. Enter
yes
orno
to confirm.If you use automated scripts or you do not need to confirm the deletion operation, add
--force
to skip the confirmation step and directly delete the model. Example:arena model delete \ --name my-model \ --force
Delete model versions
For example, you can run the following command to delete a model version whose model name is
my-model
and version number is1
:arena model delete \ --name my-model \ --version 1
To prevent user errors, the system prompts you to confirm whether to delete the specified model version when you run the preceding command. Enter
yes
orno
to confirm.If you use automated scripts or you do not need to confirm the deletion operation, add
--force
to skip the confirmation step and directly delete the model version. Example:arena model delete \ --name my-model \ --version 1 \ --force