Register BigQuery ML models to Vertex AI

Overview

When you create a BigQuery ML model you can use the optional model_registry training option in CREATE MODEL syntax to register the model to Vertex AI Model Registry. The CREATE MODEL syntax also contains options for adding the model ID and the version alias, which can be used for streamlined deployment, model management, and for enabling Vertex Explainable AI in Vertex AI.

Once your BigQuery ML model has finished training from the BigQuery ML side, it automatically displays in the Model Registry alongside your other models. From the Source column, you can see where your models are sourced from. A quick way to find your BigQuery ML models is to filter by source.

Once your BigQuery ML model is registered, you can use Vertex AI Model Registry functionalities with your model. You can deploy to an endpoint, compare model versions, make predictions, monitor your models, and view model evaluations from the Evaluations tab. Additionally, if you want to look deeper to understand what features contribute to your predictions, you can use Vertex Explainable AI to get feature-based explanations about your model.

Remember, BigQuery ML models are not automatically registered to the Model Registry. All models created using BigQuery ML still display in the BigQuery ML user interface, regardless of Vertex AI Model Registry registration.

Add a Vertex AI model ID

To help model management, you can specify a Vertex AI model ID which is associated with your BigQuery ML model. This ID is visible from the Model Registry.

The Vertex AI model ID does not accept uppercase letters. If the Vertex AI model ID is not specified, the BigQuery ML model ID is used. In this case, make sure the BigQuery ML model ID is also lowercase. To see a full list of the model ID requirements, see the specifications in upload reference documentation.

Add a Vertex AI model alias

Model aliases are helpful for fetching or deploying a particular model version by reference without needing to know the specific version ID. In this way, they operate similarly to Docker Tags or Branch references in Git.

To learn more about how Model Registry aliases work, see How to use model version aliases.

Register a BigQuery ML model

To register a new BigQuery ML model with Model Registry, you must run the CREATE MODEL syntax. To learn more, see The CREATE MODEL statement from the reference documentation. When you create a new model using the CREATE MODEL syntax, the model_registry="vertex_ai" line in the SQL command is required to register your BigQuery ML model.

To register an existing BigQuery ML model with Model Registry, see Register existing trained models.

CREATE MODEL syntax

{CREATE MODEL| CREATE MODEL IF NOT EXISTS| CREATE OR REPLACE MODEL}
model_name
[TRANSFORM (select_list)]
[OPTIONS
(MODEL_REGISTRY = {'VERTEX_AI' }
   [,VERTEX_AI_MODEL_ID = string_value ]
   [,VERTEX_AI_MODEL_VERSION_ALIASES = string_array ]
   , ...)
   

Model versioning with a BigQuery ML model

If you want to create a new version of an existing BigQuery ML model and compare it to others in the Vertex AI Model Registry, when you create the model you need to use a different BigQuery ML model ID and then register it to the original Model Registry model ID.

If you create a BigQuery ML model with a CREATE OR REPLACE MODEL statement and use an existing BigQuery ML ID, the existing Model Registry model version is deleted and replaced with a new version.

What's next