Manage Models

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

Table of Contents

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

Get Model

The method wallaroo.client.get_model retrieves the most recent model version in the current workspace that matches the provided model name unless a specific version is requested.

For more details on workspaces, see How to Set the Current Workspace.

Get Model Parameters

wallaroo.client.get_model takes the following parameters.

ParameterTypeDescription
nameString (Required)The name of the model to reference in the current workspace.
versionString (Optional) (Default: None)Returns the model version matching the version parameter. By default, returns the most recent model version for the model.

Get Model Returns

wallaroo.client.get_model returns the wallaroo.model_version.ModelVersion that matches the parameters. If no model version exists, an error is returned.

This includes the following fields:

FieldTypeDescription
name(String)The model name.
version(String)The model version in UUID format.
file_name(String)The model file name used at upload.
image_path(String)The model image path used.
archString|NULLThe architecture of the model version from wallaroo.engine_config.Architecture. Values are:
  • x86
  • arm
By default None is wallaroo.engine_config.Architecture.X86.
last_update_time(DateTime)The date and time the model was last updated.

The following fields are provided when displayed via the Wallaroo SDK:

FieldTypeDescription
Name(String)The model name.
Version(String)The model version in UUID format.
file_name(String)The model file name used at upload.
SHA(String)The model’s SHA hash.
Status(String)The model status; ready indicates the model is ready for deployment.
Image Path(String)The model image path used.
Architecture(String)The assigned hardware architecture.
Acceleration(String)The assigned AI accelerator.
Updated At(DateTime)The date and time the model was last updated.
Workspace id(Integer)The numerical identifier for the workspace the model is assigned to.
Workspace name(String)The name of the workspace the model is assigned to.

Get Model Examples

Get Model Default Example

The following demonstrates retrieving the most recent model version of the requested model.

model = wl.get_model(name=model_name, version=model_version)
display(model)
Namehelper-demo-model-1
Versionde7a7b93-1cff-4ca0-8b3b-cce2ac48af17
File Namerf_model.onnx
SHAe22a0831aafd9917f3cc87a15ed267797f80e2afa12ad7d8810ca58f173b8cc6
Statusready
Image PathNone
Architecturex86
Accelerationnone
Updated At2024-15-Jul 18:13:54
Workspace id25
Workspace namehelper-demo-workspace-1
Get Model Specific Version Example

The following demonstrates retrieving a specific model version of the requested model.

model_name="helper-demo-model-1"
model_version = wl.get_model(name=model_name, version="522e5e85-74f5-44d3-a734-4dfe2f70d790")
display(model_version)
Namehelper-demo-model-1
Version522e5e85-74f5-44d3-a734-4dfe2f70d790
File Namerf_model.onnx
SHAe22a0831aafd9917f3cc87a15ed267797f80e2afa12ad7d8810ca58f173b8cc6
Statusready
Image PathNone
Architecturex86
Accelerationnone
Updated At2024-04-Apr 18:03:38
Get Model No Matching Model Name Error Example

The following demonstrates an error when a requested model name does not exist in the current workspace.

wl.get_model(name="no-such-model")

---------------------------------------------------------------------------

Exception                                 Traceback (most recent call last)

/tmp/ipykernel_208/498292295.py in <module>
----> 1 wl.get_model(name="no-such-model")


~/.local/lib/python3.9/site-packages/wallaroo/client.py in get_model(self, name, version)
    1182         )
    1183         if model is None:
-> 1184             raise Exception(f"Error: A model with the name {name} does not exist.")
    1185         if version is not None:
    1186             model_version = next(

Exception: Error: A model with the name no-such-model does not exist.
Get Model No Matching Model Version Error Example

The following demonstrates an error when a requested model version does not exist for the specified model.

model_name="helper-demo-model-1"

wl.get_model(name=model_name, version="no-such-version")

---------------------------------------------------------------------------

Exception                                 Traceback (most recent call last)

/tmp/ipykernel_208/3669316954.py in <module>
----> 1 wl.get_model(name=model_name, version="no-such-version")


~/.local/lib/python3.9/site-packages/wallaroo/client.py in get_model(self, name, version)
    1190                 return model_version
    1191             else:
-> 1192                 raise Exception(
    1193                     f"Error: A model with the version {version} not found in this workspace."
    1194                 )

Exception: Error: A model with the version no-such-version not found in this workspace.

Get Model by Name and Version Across Workspaces

The method get_model retrieves the most recent model version or the specified model version within the user’s current workspace.

The method wallaroo.client.Client.model_by_name finds the model filtered by workspaces the user is a member of and uploaded time ranges in reverse chronological order.

Admin users have unrestricted access to all workspaces. For more details, see Wallaroo Enterprise User Management.

Get Model by Name and Version Across Workspaces Parameters

ParameterTypeDescription
name(String) (Required)The name of the model to search for.
version(String) (Required)The model version in UUID format.
workspace_id(Int) (Optional)The numerical identifier of the workspace to filter by.
workspace_name(String) (Optional)The name of the workspace to filter by.

Get Model by Name and Version Across Workspaces Returns

Returns the wallaroo.model_version.ModelVersion that matches filters.

Get Model by Name and Version Across Workspaces Examples

Search by model name and version.

wl.model_by_name(name=model_name, version="728a7528-8ed4-4ee2-aa15-3b3e9901fd40")
Namehelper-demo-model-1
Version728a7528-8ed4-4ee2-aa15-3b3e9901fd40
File Namerf_model.onnx
SHAe22a0831aafd9917f3cc87a15ed267797f80e2afa12ad7d8810ca58f173b8cc6
Statusready
Image PathNone
Architecturex86
Accelerationnone
Updated At2024-15-Jul 18:19:56
Workspace id25
Workspace namehelper-demo-workspace-1

Search by model name and version filtered by workspace id.

wl.model_by_name(name=model_name, 
                 version="409fb78f-bea8-4f27-bd47-a4d26514b861",
                 workspace_id=26)
Namehelper-demo-model-1
Version409fb78f-bea8-4f27-bd47-a4d26514b861
File Namerf_model.onnx
SHAe22a0831aafd9917f3cc87a15ed267797f80e2afa12ad7d8810ca58f173b8cc6
Statusready
Image PathNone
Architecturex86
Accelerationnone
Updated At2024-16-Jul 13:29:27
Workspace id26
Workspace namehelper-demo-workspace-2

Search by model name and version filtered by workspace name.

wl.model_by_name(name=model_name, 
                 version="728a7528-8ed4-4ee2-aa15-3b3e9901fd40",
                 workspace_name=workspace_name)
Namehelper-demo-model-1
Version728a7528-8ed4-4ee2-aa15-3b3e9901fd40
File Namerf_model.onnx
SHAe22a0831aafd9917f3cc87a15ed267797f80e2afa12ad7d8810ca58f173b8cc6
Statusready
Image PathNone
Architecturex86
Accelerationnone
Updated At2024-15-Jul 18:19:56
Workspace id25
Workspace namehelper-demo-workspace-1

Search Models

The method wallaroo.client.Client.search_models searches for models by the matching name or tags the user is a member of, filtered by workspace and uploaded time ranges in reverse chronological order.

Admin users have unrestricted access to all workspaces. For more details, see Wallaroo Enterprise User Management.

Search Models Parameters

ParameterTypeDescription
search_term(String) (Optional)The name or tags of the model to search for.
uploaded_time_start(Datetime) (Optional)Date range to start for when the model was created.
uploaded_time_end(Datetime) (Optional)Date range to end for when the model was created.
workspace_id(Int) (Optional)The numerical identifier of the workspace to filter by.
workspace_name(String) (Optional)The name of the workspace to filter by.

Search Models Returns

Returns List[ModelVersion], which includes the following fields filtered by workspaces the user is a member of and uploaded time ranges in reverse chronological order.

FieldTypeDescription
name(String)The model name.
version(String)The model version in UUID format.
image_path(String)The model file name assigned at upload.
arch(String)The assigned hardware architecture.
accel(String)The assigned AI accelerator.
last_update_time(DateTime)The date and time the model was last updated.

Search Models Examples

Search by model name.

wl.search_models(search_term=model_name)
nameversionfile_nameimage_patharchaccellast_update_timeworkspace_idworkspace_name
helper-demo-model-10b2a1702-e9e4-4251-9533-e6f329a7c247rf_model.onnxNonex86none2024-07-15 21:45:12.529732+00:008john.hummel@wallaroo.ai - Default Workspace
helper-demo-model-136163cc4-775e-4d87-b5ca-75c6ceb9927drf_model.onnxNonex86none2024-07-15 18:43:44.180282+00:0026helper-demo-workspace-2
helper-demo-model-1728a7528-8ed4-4ee2-aa15-3b3e9901fd40rf_model.onnxNonex86none2024-07-15 18:19:56.113108+00:0025helper-demo-workspace-1
helper-demo-model-1de7a7b93-1cff-4ca0-8b3b-cce2ac48af17rf_model.onnxNonex86none2024-07-15 18:13:54.709321+00:0025helper-demo-workspace-1

Search by model name, filtered by workspace name.

wl.search_models(search_term=model_name, workspace_name=workspace_name)
nameversionfile_nameimage_patharchaccellast_update_timeworkspace_idworkspace_name
helper-demo-model-1728a7528-8ed4-4ee2-aa15-3b3e9901fd40rf_model.onnxNonex86none2024-07-15 18:19:56.113108+00:0025helper-demo-workspace-1
helper-demo-model-1de7a7b93-1cff-4ca0-8b3b-cce2ac48af17rf_model.onnxNonex86none2024-07-15 18:13:54.709321+00:0025helper-demo-workspace-1

Search by model name, filtered by workspace id.

wl.search_models(search_term=model_name, workspace_id=25)
nameversionfile_nameimage_patharchaccellast_update_timeworkspace_idworkspace_name
helper-demo-model-1728a7528-8ed4-4ee2-aa15-3b3e9901fd40rf_model.onnxNonex86none2024-07-15 18:19:56.113108+00:0025helper-demo-workspace-1
helper-demo-model-1de7a7b93-1cff-4ca0-8b3b-cce2ac48af17rf_model.onnxNonex86none2024-07-15 18:13:54.709321+00:0025helper-demo-workspace-1

Search Model Versions

The method wallaroo.client.Client.search_model_versions searches across all workspaces the user has access to for model versions that match:

  • names, shas, versions, file names, and tags matching a search string.
  • Upload time start and end.
  • Workspace ID and workspace name.

Admin users have unrestricted access to all workspaces. For more details, see Wallaroo Enterprise User Management.

Search Model Versions Parameters

ParameterTypeDescription
search_term(String) (Optional)Searches by model name, sha hash, version id, file names, and model tags.
uploaded_time_start(Datetime) (Optional)The inclusive start date to search by model upload date.
uploaded_time_end(Int) (Optional)The inclusive end date to search by model upload date.
workspace_id(Int) (Optional)The numerical identifier of the workspace to filter by.
workspace_name(String) (Optional)The name of the workspace to filter by.

Search Model Versions Returns

A List[ModelVersion] with the following fields:

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.
archString|NULLThe architecture of the model version from wallaroo.engine_config.Architecture. Values are:
  • x86
  • arm
By default None is wallaroo.engine_config.Architecture.X86.
last_update_time`DatetimeThe DateTime the model version was last updated.

Search Model Versions Examples

The following demonstrates searching for all model versions in workspaces a user is a member of.

wl.search_model_versions("helper-demo-model-1")
nameversionfile_nameimage_patharchaccellast_update_timeworkspace_idworkspace_name
helper-demo-model-1409fb78f-bea8-4f27-bd47-a4d26514b861rf_model.onnxNonex86none2024-07-16 13:29:27.269598+00:0026helper-demo-workspace-2
helper-demo-model-191edbb72-a7fb-470b-ae5b-85b895966375rf_model.onnxNonex86none2024-07-16 13:28:34.374392+00:0025helper-demo-workspace-1
helper-demo-model-10b2a1702-e9e4-4251-9533-e6f329a7c247rf_model.onnxNonex86none2024-07-15 21:45:12.529732+00:008john.hummel@wallaroo.ai - Default Workspace
helper-demo-model-136163cc4-775e-4d87-b5ca-75c6ceb9927drf_model.onnxNonex86none2024-07-15 18:43:44.180282+00:0026helper-demo-workspace-2
helper-demo-model-1728a7528-8ed4-4ee2-aa15-3b3e9901fd40rf_model.onnxNonex86none2024-07-15 18:19:56.113108+00:0025helper-demo-workspace-1
helper-demo-model-1de7a7b93-1cff-4ca0-8b3b-cce2ac48af17rf_model.onnxNonex86none2024-07-15 18:13:54.709321+00:0025helper-demo-workspace-1

The following demonstrates searching for all model versions in workspaces a user is a member of filtered by workspace id.

wl.search_model_versions("helper-demo-model-1", workspace_id=26)
nameversionfile_nameimage_patharchaccellast_update_timeworkspace_idworkspace_name
helper-demo-model-1409fb78f-bea8-4f27-bd47-a4d26514b861rf_model.onnxNonex86none2024-07-16 13:29:27.269598+00:0026helper-demo-workspace-2
helper-demo-model-136163cc4-775e-4d87-b5ca-75c6ceb9927drf_model.onnxNonex86none2024-07-15 18:43:44.180282+00:0026helper-demo-workspace-2

The following demonstrates searching for all model versions in workspaces a user is a member of filtered by workspace name.

wl.search_model_versions("helper-demo-model-1", workspace_name="helper-demo-workspace-1")
nameversionfile_nameimage_patharchaccellast_update_timeworkspace_idworkspace_name
helper-demo-model-191edbb72-a7fb-470b-ae5b-85b895966375rf_model.onnxNonex86none2024-07-16 13:28:34.374392+00:0025helper-demo-workspace-1
helper-demo-model-1728a7528-8ed4-4ee2-aa15-3b3e9901fd40rf_model.onnxNonex86none2024-07-15 18:19:56.113108+00:0025helper-demo-workspace-1
helper-demo-model-1de7a7b93-1cff-4ca0-8b3b-cce2ac48af17rf_model.onnxNonex86none2024-07-15 18:13:54.709321+00:0025helper-demo-workspace-1

List Models

The method wallaroo.client.list_models() lists all models lists all models the user’s current workspace or the workspace specified in the parameters, in reverse chronological order.

Admin users have unrestricted access to all workspaces. For more details, see Wallaroo Enterprise User Management.

List Models Parameters

ParameterTypeDescription
workspace_id(Int) (Optional)The numerical identifier of the workspace to filter by.
workspace_name(String) (Optional)The name of the workspace to filter by.

List Models Returns

wallaroo.client.list_models() returns a List of Models. 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.

The following fields are returned when displayed through the Wallaroo SDK.

FieldTypeDescription
NameStringThe name of the model.
# of versionsIntegerThe number of model versions.
Owner idStringThe model’s owner.
Last UpdatedDatetimeThe DateTime the model was last updated.
Created AtDatetimeThe model’s creation date and time.
Workspace idIntegerThe numerical id of the workspace the model is assigned to.
Workspace nameStringThe name of the workspace the model is assigned to.

List Models

List models in the current workspace.

wl.list_models()
Name# of VersionsOwner IDLast UpdatedCreated AtWorkspace idWorkspace name
helper-demo-model-12""2024-07-16 13:29:27.269598+00:002024-07-15 18:43:44.180282+00:0026helper-demo-workspace-2

List models across workspaces filtered by workspace id.

wl.list_models(workspace_id=25)
Name# of VersionsOwner IDLast UpdatedCreated AtWorkspace idWorkspace name
helper-model-replace1""2024-07-15 18:24:51.092644+00:002024-07-15 18:24:51.092644+00:0025helper-demo-workspace-1
helper-demo-model-13""2024-07-16 13:28:34.374392+00:002024-07-15 18:13:54.709321+00:0025helper-demo-workspace-1

List models across workspaces filtered by workspace name.

wl.list_models(workspace_name=workspace_name)
Name# of VersionsOwner IDLast UpdatedCreated AtWorkspace idWorkspace name
helper-demo-model-12""2024-07-16 13:29:27.269598+00:002024-07-15 18:43:44.180282+00:0026helper-demo-workspace-2

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[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.
archString|NULLThe architecture of the model version from wallaroo.engine_config.Architecture. Values are:
  • x86
  • arm
By default None is wallaroo.engine_config.Architecture.X86.
last_update_time`DatetimeThe 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())}

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()StringThe 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.

print(model_config.runtime())

flight