Generate vector embeddings with model endpoint management

This page describes a preview 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:

    model_id => 'MODEL_ID',
    content => 'CONTENT');

Replace the following:

  • MODEL_ID: the model ID you defined when registering the model.
  • CONTENT: the text to translate into a vector embedding.


Some examples for generating embeddings using registered models are listed in this section.

Text embedding models with in-built support

To generate embeddings for a registered textembedding-gecko@002 model, run the following statement:

        model_id => 'textembedding-gecko@002',
        content => 'AlloyDB is a managed, cloud-hosted SQL database service');