Wallaroo Model Tag Management
How to manage tags and models.
Models uploaded to the current workspace can be seen through the following process:
From the Model Details page the following is displayed.
The method wallaroo.client.list_models()
lists all models in the workspaces the user is a member of.
None.
wallaroo.client.list_models()
returns wallaroo.model.ModelList
which is a List of wallaroo.model.Model
. Each Model has the following attributes.
Field | Type | Description |
---|---|---|
id | Integer | The numerical identifier of the model. |
name | String | The name of the model. |
owner_id | String | The Wallaroo model owner identifier. |
last_update_time | Datetime | The DateTime the model was last updated. |
created_at | Datetime | The DateTime the model was created. |
versions | Integer | The number of versions of the model. |
The following example retrieves a list of all models in workspaces the user is a member of in a Wallaroo instance, then selects one model from the list to display its details.
import wallaroo
wl = wallaroo.Client()
display(wl.list_models())
Name | # of Versions | Owner ID | Last Updated | Created At |
---|---|---|---|---|
mlflowpostprocess | 1 | "" | 2024-01-30 16:11:56.917877+00:00 | 2024-01-30 16:11:56.917877+00:00 |
mlflowstatmodels | 1 | "" | 2024-01-30 16:11:55.848172+00:00 | 2024-01-30 16:11:55.848172+00:00 |
modeltest = wl.list_models()[0]
display(modeltest)
Name | mlflowpostprocess |
---|---|
# of Versions | 1 |
Owner ID | "" |
Last Updated | 2024-01-30 16:11:56.917877+00:00 |
Created At | 2024-01-30 16:11:56.917877+00:00 |
Models are listed from a workspace with the wallaroo.workspace.Workspace.models()
methods.
N/A
returns wallaroo.model.ModelList
which is a List of wallaroo.model.Model
. Each Model has the following attributes.
Field | Type | Description |
---|---|---|
id | Integer | The numerical identifier of the model. |
name | String | The name of the model. |
owner_id | String | The Wallaroo model owner identifier. |
last_update_time | Datetime | The DateTime the model was last updated. |
created_at | Datetime | The DateTime the model was created. |
versions | Integer | The number of versions of the model. |
The following example retrieves a workspace, lists all of the models in that workspace, then select one models and displays its details.
import wallaroo
wl = wallaroo.Client()
workspace = wl.list_workspaces()[1]
print(workspace)
{'name': 'unet-detection', 'id': 7, 'archived': False, 'created_by': 'df2b4a6c-b749-466a-95b4-60cf14fc354d', 'created_at': '2024-01-18T19:56:59.030291+00:00', 'models': [{'name': 'pt-unet', 'versions': 2, 'owner_id': '""', 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 12, 603652, tzinfo=tzutc()), 'created_at': datetime.datetime(2024, 1, 18, 19, 57, 0, 984506, tzinfo=tzutc())}], 'pipelines': [{'name': 'pt-unet', 'create_time': datetime.datetime(2024, 1, 18, 20, 8, 13, 687565, tzinfo=tzutc()), 'definition': '[]'}]}
sample_model_list = workspace.models()
print(sample_model_list)
[{'name': 'pt-unet', 'versions': 2, 'owner_id': '""', 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 12, 603652, tzinfo=tzutc()), 'created_at': datetime.datetime(2024, 1, 18, 19, 57, 0, 984506, tzinfo=tzutc())}]
sample_model = sample_model_list[0]
print(sample_model)
{'name': 'pt-unet', 'versions': 2, 'owner_id': '""', 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 12, 603652, tzinfo=tzutc()), 'created_at': datetime.datetime(2024, 1, 18, 19, 57, 0, 984506, tzinfo=tzutc())}
Name | pt-unet |
---|---|
# of Versions | 2 |
Owner ID | "" |
Last Updated | 2024-01-18 19:58:12.603652+00:00 |
Created At | 2024-01-18 19:57:00.984506+00:00 |
A list of versions of a model are retrieved from the wallaroo.model.Model.versions()
method.
N/A
A List of wallaroo.model_version.ModelVersion
associated with the Model. Each Model Version includes:
Field | Type | Description |
---|---|---|
name | String | The name assigned to the model version. This matches the Model name the model version is assigned to. |
version | String | The model version identifier in UUID format. |
file_name | String | The file name for an uploaded model version. |
image_path | String | The image path of a registered model version. |
arch | **String | NULL** |
last_update_time | Datetime | The DateTime the model version was last updated. |
The following example retrieves a model, lists the model versions, then retrieves a specific model version from the List of model versions.
print(sample_model)
{'name': 'pt-unet', 'versions': 2, 'owner_id': '""', 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 12, 603652, tzinfo=tzutc()), 'created_at': datetime.datetime(2024, 1, 18, 19, 57, 0, 984506, tzinfo=tzutc())}
print(sample_model.versions())
[{'name': 'pt-unet', 'version': '8a9e998c-6758-4868-b7ca-ba910ba3d70c', 'file_name': 'unet.pt', 'image_path': None, 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 3, 394868, tzinfo=tzutc())},
{'name': 'pt-unet', 'version': '9bbb0039-074b-4a49-8c3a-e86a543dcbb7', 'file_name': 'unet.pt', 'image_path': 'proxy.replicated.com/proxy/wallaroo/ghcr.io/wallaroolabs/mlflow-deploy:v2023.4.1-4351', 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 20, 2, 44, 866594, tzinfo=tzutc())}]
print(sample_model.versions()[-1])
{'name': 'pt-unet', 'version': '9bbb0039-074b-4a49-8c3a-e86a543dcbb7', 'file_name': 'unet.pt', 'image_path': 'proxy.replicated.com/proxy/wallaroo/ghcr.io/wallaroolabs/mlflow-deploy:v2023.4.1-4351', 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 20, 2, 44, 866594, tzinfo=tzutc())}
Most Wallaroo model operations involve model versions. A model’s specific model version is access through the wallaroo.model.Model.versions()
method. wallaroo.model.Model.versions()
returns wallaroo.model.ModelList
which is a List of wallaroo.model.Model
.
The following example demonstrates accessing a specific model version and storing the reference to a local variable.
print(sample_model)
{'name': 'pt-unet', 'versions': 2, 'owner_id': '""', 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 12, 603652, tzinfo=tzutc()), 'created_at': datetime.datetime(2024, 1, 18, 19, 57, 0, 984506, tzinfo=tzutc())}
print(sample_model.versions())
[{'name': 'pt-unet', 'version': '8a9e998c-6758-4868-b7ca-ba910ba3d70c', 'file_name': 'unet.pt', 'image_path': None, 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 19, 58, 3, 394868, tzinfo=tzutc())},
{'name': 'pt-unet', 'version': '9bbb0039-074b-4a49-8c3a-e86a543dcbb7', 'file_name': 'unet.pt', 'image_path': 'proxy.replicated.com/proxy/wallaroo/ghcr.io/wallaroolabs/mlflow-deploy:v2023.4.1-4351', 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 20, 2, 44, 866594, tzinfo=tzutc())}]
print(sample_model.versions()[-1])
{'name': 'pt-unet', 'version': '9bbb0039-074b-4a49-8c3a-e86a543dcbb7', 'file_name': 'unet.pt', 'image_path': 'proxy.replicated.com/proxy/wallaroo/ghcr.io/wallaroolabs/mlflow-deploy:v2023.4.1-4351', 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 20, 2, 44, 866594, tzinfo=tzutc())}
The model versions configuration defines how the model is used in the Wallaroo Inference Engine. Settings include:
The model version configuration is retrieved with the method wallaroo.model_version.ModelVersion.config()
.
N/A
The method wallaroo.model_version.ModelVersion.config()
returns wallaroo.model_config.ModelConfig
. The following fields are part of the model config object.
Method | Return Type | Description |
---|---|---|
id() | Integer | The id of model version the configuration is assigned to. |
to_yaml() | String | A YAML output of the model configuration options that are not None. |
tensor_fields() | List[String] | A list of tensor field names that override the default model fields. Only applies to onnx models. |
model_version() | wallaroo.model_version.ModelVersion | The model version the model configuration is assigned to. |
runtime() | String* | The model runtime as defined by wallaroo.framework.Framework |
The following examples retrieves a model version, and displays the fields from the methods listed above.
import wallaroo
print(sample_model.versions()[-1])
model_config = sample_model.versions()[-1].config()
print(model_config.id())
2
print(model_config.tensor_fields())
None
print(model_config.model_version())
{'name': 'pt-unet', 'version': '9bbb0039-074b-4a49-8c3a-e86a543dcbb7', 'file_name': 'unet.pt', 'image_path': 'proxy.replicated.com/proxy/wallaroo/ghcr.io/wallaroolabs/mlflow-deploy:v2023.4.1-4351', 'arch': None, 'last_update_time': datetime.datetime(2024, 1, 18, 20, 2, 44, 866594, tzinfo=tzutc())}
print(model_config.runtime())
flight
print(model_config.to_yaml())
model_id: pt-unet
model_version: 9bbb0039-074b-4a49-8c3a-e86a543dcbb7
runtime: flight
How to manage tags and models.