Search code examples
google-cloud-platformgoogle-bigquery

BigQuery ML model to predict outside BQ


I've successfully built a BigQuery ML model which I can call with ML.predict.

If I wanted to call the same model from an external source like an API, is there a way to do so? are there some endpoints like Vertex endpoints?


Solution

  • BQML models can be deployed outside BigQuery. https://cloud.google.com/bigquery/docs/export-model-tutorial has more details. In general, there are two ways:

    • If the BQML model is registered on Vertex AI, you can find it in Vertex model registry. Then you can deploy it in the same way as other Vertex models. The Vertex endpoint will be available for prediction request.

    • If you want to deploy the BQML model outside Vertex, you can export BQML models to GCS. It will be in SavedModel or Booster format.