Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Google Cloud · Associate Data Practitioner

LLMs in BigQuery and Model Registry

Associate Data Practitioner · Lesson 9 of 16 · 55:53

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Google Cloud Associate Data Practitioner exam, on the official exam guide. In this lesson: remote models and connections, generating text with SQL and a Gemini model, Model Registry, and choosing between a pretrained model, BigQuery ML, and AutoML. Includes three original practice questions, with Cymbal Energy, a fictional electricity and gas supplier, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Thousands of complaints

Cymbal Energy receives thousands of written complaints every week, through the app and the call centers. The customer team wants each one summarized and sorted by topic, but the text sits in BigQuery, and nobody wants to copy it anywhere else. Meanwhile, the churn model keeps getting retrained, and the team must know which version is in use.

Remote models and connections

Large language models, like Gemini, are already trained on huge amounts of text, so there is nothing to train. From BigQuery, you use one through a remote model: a model object in your dataset that points to a model hosted in Gemini Enterprise Agent Platform. The create model statement adds remote with connection, and an endpoint option that names the Gemini model. The connection is a Cloud resource connection, with its own service account, so analysts never handle credentials. That service account needs the Agent Platform User role, and the same approach also reaches partner models, like Claude, Llama, or Mistral, and open models.

Generating text with SQL

The AI.GENERATE_TEXT function takes the remote model, and a table or a query with a column named prompt. A prompt usually joins an instruction to each row: summarize this complaint in one sentence, then label it billing, outage, or meter. Options shape the answer: a maximum number of output tokens for the length, and a temperature, where a low value gives consistent answers, the right choice for sorting into labels. The answers come back as a new column, so you can save them to a table, join them, and chart them. Each row is a request to the model, so test the prompt on a small sample table first.

Model Registry

Models get retrained, and teams need to know which version is in use. Model Registry, in Gemini Enterprise Agent Platform, is a central place to manage the lifecycle of models: versions, evaluation, and deployment. A BigQuery ML model is registered without being exported: in create model, set the model registry option to Vertex AI, and give a model ID. Another BigQuery ML model registered with the same model ID becomes its next version, and aliases, like default, point to the version that is ready for production. From the registry, a version can be compared with others, deployed to an endpoint for online predictions, or used for batch predictions.

Pretrained, custom, or AutoML

So which approach fits? For language tasks, like summarizing, classifying text, or extracting fields, a pretrained model like Gemini needs no training data, only a good prompt. To predict a number or a category from your own history, like consumption or churn, train a BigQuery ML model on labeled data. And when you want a strong model with little machine learning expertise, AutoML searches for it, on tabular data or images.

Recap

Let's recap. A remote model points BigQuery to a pretrained model, like Gemini, through a Cloud resource connection and its service account. The AI.GENERATE_TEXT function sends a prompt for each row, with options like the maximum output tokens and the temperature. Model Registry, in Gemini Enterprise Agent Platform, tracks versions, aliases, and deployments, and BigQuery ML models register without an export. The same model ID adds a new version. And pretrained models handle language tasks with no training, while BigQuery ML and AutoML learn from your own labeled data.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The customer team wants every complaint stored in BigQuery summarized by Gemini, in SQL, without exporting the text anywhere. What does the data practitioner need first?

    • Export the complaints and paste them into a chatbot
    • A boosted tree classifier trained on past labels
    • A Looker dashboard on the complaints table
    • A remote model over Gemini, with a connection
    Show the answer

    A remote model over Gemini, with a connection

    A remote model over Gemini, created with a Cloud resource connection, lets the AI.GENERATE_TEXT function work on the rows in BigQuery. “Export the complaints and paste them into a chatbot” would send the text outside BigQuery, by hand. “A boosted tree classifier trained on past labels” would need labeled data, and it cannot write a summary. And “A Looker dashboard on the complaints table” only displays the complaints, without generating anything.

  2. The team trained a new BigQuery ML model for churn, and wants it to appear as version 2 of the churn model already in Model Registry, without exporting it. What should they set?

    • The same vertex_ai_model_id as version 1
    • An export to Cloud Storage, then an import
    • A new model ID for every version
    • A scheduled query running ML.EVALUATE
    Show the answer

    The same vertex_ai_model_id as version 1

    Registering the new BigQuery ML model with the same model ID makes it the next version of that model. “An export to Cloud Storage, then an import” would add an export and an import that registration does not need. “A new model ID for every version” would create a separate model, not a new version. And “A scheduled query running ML.EVALUATE” only measures the model, without registering anything.

  3. The team wants to pull the meter number and the outage date out of thousands of free-text emails, and it has no labeled examples at all. Which approach fits best?

    • A LINEAR_REG model in BigQuery ML
    • A KMEANS model to group the emails
    • Gemini through AI.GENERATE_TEXT, with a prompt
    • An AutoML model trained on the emails
    Show the answer

    Gemini through AI.GENERATE_TEXT, with a prompt

    A pretrained Gemini model pulls fields out of text with a prompt, and needs no labeled examples. “A LINEAR_REG model in BigQuery ML” only predicts a number, from labeled history. “A KMEANS model to group the emails” only groups similar emails, without extracting any field. And “An AutoML model trained on the emails” would need labeled examples to train on.