Access Models

How to access models and model versions in your Wallaroo Ops environment.

View Models via the Wallaroo Dashboard

How to View Uploaded Models

Models uploaded to the current workspace can be seen through the following process:

  1. From the Wallaroo Dashboard, select the workspace to set as the current workspace from the navigation panel above. The number of models for the workspace will be displayed.
  2. Select View Models. A list of the models in the workspace will be displayed.
  3. To view details on the model, select the model name from the list.

Model Details

From the Model Details page the following is displayed.

Wallaroo Dashboard Models page
  • (A) The name of the model.
  • (B) The unique ID of the model represented as a UUID.
  • (C) The file name and SHA hash the ML Model file of the current model version.
  • (D) Any tags assigned to the model.
  • (E) The version history of the model: Models uploaded to a workspace with the same name are assigned a a new model version.
    • (F) The unique ID of the model version represented as a UUID and creation date - the date the model was uploaded to the Wallaroo Ops.
    • (G) The filename for this model version and SHA hash of the ML Model file for this model version.
  • Associated pipelines: Pipelines where a version of this model is added as a model step.
    • (H) The model version assigned as a pipeline step.
    • (I) The pipeline version the model version is assigned to.

View Models via the Wallaroo SDK

List Models Across Workspaces

The method wallaroo.client.list_models() lists all models in the workspaces the user is a member of.

List Models Across Workspaces Parameters

None.

List Models Across Workspaces Returns

wallaroo.client.list_models() returns wallaroo.model.ModelList which is a List of wallaroo.model.Model. Each Model has the following attributes.

FieldTypeDescription
idIntegerThe numerical identifier of the model.
nameStringThe name of the model.
owner_idStringThe Wallaroo model owner identifier.
last_update_timeDatetimeThe DateTime the model was last updated.
created_atDatetimeThe DateTime the model was created.
versionsIntegerThe number of versions of the model.

List Models Across Workspaces Example

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 VersionsOwner IDLast UpdatedCreated At
mlflowpostprocess1""2024-01-30 16:11:56.917877+00:002024-01-30 16:11:56.917877+00:00
mlflowstatmodels1""2024-01-30 16:11:55.848172+00:002024-01-30 16:11:55.848172+00:00
modeltest = wl.list_models()[0]
display(modeltest)
Namemlflowpostprocess
# of Versions1
Owner ID""
Last Updated2024-01-30 16:11:56.917877+00:00
Created At2024-01-30 16:11:56.917877+00:00

List Models Within A Workspace

Models are listed from a workspace with the wallaroo.workspace.Workspace.models() methods.

List Models Within A Workspace Parameters

N/A

List Models Within A Workspace Returns

returns wallaroo.model.ModelList which is a List of wallaroo.model.Model. Each Model has the following attributes.

FieldTypeDescription
idIntegerThe numerical identifier of the model.
nameStringThe name of the model.
owner_idStringThe Wallaroo model owner identifier.
last_update_timeDatetimeThe DateTime the model was last updated.
created_atDatetimeThe DateTime the model was created.
versionsIntegerThe number of versions of the model.

List Models Within A Workspace Example

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())}
Namept-unet
# of Versions2
Owner ID""
Last Updated2024-01-18 19:58:12.603652+00:00
Created At2024-01-18 19:57:00.984506+00:00

List Model Versions

A list of versions of a model are retrieved from the wallaroo.model.Model.versions() method.

List Model Versions Parameters

N/A

List Model Versions Returns

A List of wallaroo.model_version.ModelVersion associated with the Model. Each Model Version includes:

FieldTypeDescription
nameStringThe name assigned to the model version. This matches the Model name the model version is assigned to.
versionStringThe model version identifier in UUID format.
file_nameStringThe file name for an uploaded model version.
image_pathStringThe image path of a registered model version.
arch**StringNULL**
last_update_timeDatetimeThe DateTime the model version was last updated.

List Model Versions Example

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())}

Access Specific Model Versions

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.

Access Specific Model Versions Example

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())}

Get Model Config

The model versions configuration defines how the model is used in the Wallaroo Inference Engine. Settings include:

  • The runtime
  • Input and output schemas
  • Tensor field name overrides

The model version configuration is retrieved with the method wallaroo.model_version.ModelVersion.config().

Get Model Config Parameters

N/A

Get Model Config Returns

The method wallaroo.model_version.ModelVersion.config() returns wallaroo.model_config.ModelConfig. The following fields are part of the model config object.

MethodReturn TypeDescription
id()IntegerThe id of model version the configuration is assigned to.
to_yaml()StringA 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.ModelVersionThe model version the model configuration is assigned to.
runtime()String*The model runtime as defined by wallaroo.framework.Framework

Get Model Config Example

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

Wallaroo Model Tag Management

How to manage tags and models.