Generate vector embeddings with Model endpoint management

This page describes a preview available with AlloyDB Omni that lets you experiment with registering AI models and invoking predictions with Model endpoint management. For using AI models in production environments, see Build generative AI applications using AlloyDB AI and Work with vector embeddings.

After the models are added and registered in the Model endpoint management, you can reference them using the model ID to generate embeddings.

Before you begin

Make sure that you have registered your model with Model endpoint management. For more information, see Register a model with model endpoint management

Generate embeddings

Use the google_ml.embedding() SQL function to call the registered models with the text embedding model type to generate embeddings.

To call the model and generate embeddings, use the following SQL query:

SELECT
  google_ml.embedding(
    model_id => 'MODEL_ID',
    content => 'CONTENT');

Replace the following:

  • MODEL_ID: the model ID you defined when creating the model.
  • CONTENT: the text to translate into a vector embedding-for example, AlloyDB is a managed, cloud-hosted SQL database service.