Update a BigQuery ML model

Register an existing BigQuery ML model to the Vertex AI Model Registry

By default, BigQuery ML models, when trained without the model_registry parameter, are not automatically added to the Vertex AI Model Registry. Using ALTER MODEL, you can update the model to include in the Vertex AI Model Registry and update important metadata like the model ID, the description, and labels. To learn more, see The ALTER MODEL statement.

To learn more about generally updating your BigQuery ML models, see Update model metadata.

To register an existing model:

bq

You can update a model using the bq command-line tool by running the 'bq update' and adding a 'vertex_ai_model_id' to the model. Keep in mind, the vertex_model_id can either be a new ID or an existing Vertex AI Model Registry model ID. Each BigQuery ML model can only be registered to one model_id in the Vertex AI Model Registry.

bq update --model --vertex_ai_model_id "[VERTEX_AI_MODEL_ID]" [PROJECT_ID]:[DATASET].[MODEL]

SQL

ALTER MODEL [IF EXISTS]  SET OPTIONS (vertex_ai_model_id="[VERTEX_AI_MODEL_ID]");

API

  1. Go to Method: models.patch
  2. Fill out the Request parameters and Request body.
  3. Click the EXECUTE button.
  {
    "trainingRuns": [
      {
        "vertexAiModelId": "vertex_model_id"
      }
  }
 ```

If you set it to a new ID when adding the model, the BigQuery ML model displays as model version 1 in the Vertex AI Model Registry. To add as a new version of an existing model in the Vertex AI Model Registry, add the existing model's ID - it automatically registers as the latest version.

Once registered, you can deploy your BigQuery ML model to a Vertex AI endpoint for online prediction. To learn more about Vertex AI prediction, see Vertex AI Prediction documentation.

What's next