A model alias is a mutable, named reference to a model version unique within a model resource. An alias is "mutable" because aliases can be moved from one model version to another and "named" because they are user-defined, arbitrary strings. Model aliases are helpful for fetching or deploying a particular model version by reference without needing to know the specific version's ID. In this way, they operate similarly to Docker Tags or Branch references in Git.
When you create a new model in Model Registry, the first version automatically gets assigned the default alias. The default alias references the model version that is used if a user runs a command on a model without specifying a particular version. One version of a model is required to carry the default alias at all times. Otherwise, the default alias behaves as any other user-defined alias.
From the Google Cloud console the alias marker can help stakeholders understand at a glance which model is the stable version ready for deployment. In addition to the default alias, you can create and assign your own custom aliases to models in the Model Registry.
In Model Registry, you can see at a glance which model version has the default alias by looking at the alias column.
If you decide you want to reassign the alias to a different model version, you can easily move aliases to a different version.
Some considerations for using aliases:
- Your version aliases should be unique; and an alias can only be assigned to a single version, by model, at a time.
- Version aliases must be non-numerical.
- If you don't specify a model version for production, the default model is used.
- An alias is different from a label. Learn more about model labels here.
- If you apply an existing alias that is used in another model version, the alias is removed from that version.
Set a model version as default
In the Google Cloud console, go to the Vertex AI Model Registry page.
From the Model Registry, select the name of the model you want to edit. The model details window opens. All of the model versions are listed. One of the model versions has the default alias.
Select the Actions button for the model version you want to assign the default version.
Click Set as default.
Add an alias to a model version
In the Google Cloud console, go to the Vertex AI Model Registry page.
From the Model Registry, select the name of the model you want to edit. The model details window opens.
From the details page, select the model version you want and click More.
Click Edit alias. Select Add New.
Edit alias: Click Add alias and enter the name of the alias you want to add to the model version.
Click Save.
Upload a new aliased model version
API
Python
Delete a model alias
When you delete a model version assigned the default alias, the alias is automatically assigned to the next most recent version.
Console
In the Google Cloud console, go to the Vertex AI Model Registry page.
From the Model Registry, select the name of the model you want to edit. The model details window opens.
From the details page click the Actions button on the model version.
Click Edit alias.
A list of the aliases attached to the model version displays. Hover your cursor to the right of the Alias textbox for the label to display the delete icon.
Click the delete icon for the alias you want to delete.
Click Save.