您的应用可以使用 google_ml_integration 扩展程序访问模型端点管理。google_ml_integration 扩展程序包含 public、google_ml 和 ai 架构中的函数。所有函数都包含在 google_ml 架构中,而某些函数可在 public 和 ai 架构中使用。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[[["\u003cp\u003eModel endpoint management allows registration of AI model endpoints, management of their metadata within a database cluster, and the invocation of these models via SQL queries.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle_ml_integration\u003c/code\u003e extension facilitates interaction with registered model endpoints, including functions for model registration, secret management, embedding generation, and generic model prediction.\u003c/p\u003e\n"],["\u003cp\u003eModel providers can be specified (e.g., \u003ccode\u003egoogle\u003c/code\u003e, \u003ccode\u003ehugging_face\u003c/code\u003e, \u003ccode\u003eanthropic\u003c/code\u003e, \u003ccode\u003eopen_ai\u003c/code\u003e, or \u003ccode\u003ecustom\u003c/code\u003e), influencing authentication methods and header formatting, with \u003ccode\u003ecustom\u003c/code\u003e being the default.\u003c/p\u003e\n"],["\u003cp\u003eSupported model types include \u003ccode\u003etext-embedding\u003c/code\u003e for text-based models and \u003ccode\u003egeneric\u003c/code\u003e for any other JSON-based models, with \u003ccode\u003egeneric\u003c/code\u003e as the default when the type is not specified.\u003c/p\u003e\n"],["\u003cp\u003eFor \u003ccode\u003etext-embedding\u003c/code\u003e models without built-in support, transform functions and HTTP header generation functions can be created to manage input/output formats and header requirements, respectively.\u003c/p\u003e\n"]]],[],null,["# Register and call remote AI models in AlloyDB overview\n\nThis page describes key concepts that you must know before registering an AI model endpoint\nand invoking predictions with Model endpoint management.\n\nTo register remote model endpoints with AlloyDB Omni, see [Register and call remote AI models in AlloyDB Omni](/alloydb/omni/docs/model-endpoint-overview).\n\nOverview\n--------\n\n*Model endpoint management* is an AlloyDB AI feature that includes\nfunctions and operators that help you register and manage AI model metadata. You\ncan register a model endpoint, manage model endpoint metadata in your database\ncluster, and make calls to the remote model endpoints using SQL queries.\n\nModel endpoint management provides the\n[`google_ml_integration`](/alloydb/docs/reference/model-endpoint) extension that\nincludes functions that let you register the metadata related to AI models with\nAlloyDB. This registered metadata is used to generate vector\nembeddings or invoke predictions.\n\nAlloyDB AI query engine is a suite of functions that build on model endpoint management ([Preview](/products#product-launch-stages)), and adds support for AI operators that let you combine natural language phrases with SQL queries, like `ai.if()` for filters and joins, `ai.rank()` for ordering, and `ai.generate()` for generating summaries of your data. It also adds support for Vertex AI multimodal and ranking models.\n\nSome of the example model types that you can register using model endpoint management are as follows:\n\n- [Vertex AI](/vertex-ai/docs) text embedding and generic models\n- [Vertex AI Multimodal model](/vertex-ai/generative-ai/docs/embeddings/get-multimodal-embeddings) ([Preview](/products#product-launch-stages))\n- [Vertex AI ranking models](/generative-ai-app-builder/docs/ranking) ([Preview](/products#product-launch-stages))\n- Embedding models provided by third-party providers, such as Hugging Face or OpenAI\n- Custom-hosted text embedding models, including self-hosted models or models available through private endpoints\n- Generic models with a JSON-based API---for example, `facebook/bart-large-mnli` model hosted on Hugging Face, `gemini-pro` model from the Vertex AI Model Garden, or `claude` models by Anthropic\n\n| **Note:** Vertex AI model support is governed by Vertex AI model versioning and lifecycle guidelines. For more information about stable versions, see [Model versions and lifecycle](/vertex-ai/docs/model-registry/model-versions).\n\nUse cases\n---------\n\nYou can call the registered model endpoints to interact with existing data in your database to generate embeddings or predictions. Some application use cases are as follows:\n\n- **Real-time inference with transaction application**: provides real-time recommendations based on the user's current browsing history and in-cart content.\n- **Identify sentiment and generate summaries**: for a database of customer reviews, generates summaries or identify the key sentiment for each review.\n- **Intelligent search and retrieval systems**: build search systems for a database of internal knowledge base, and query using AI powered SQL operators instead of keywords.\n- **Personalized user experiences**: optimize a content platform to dynamically personalize what content is displayed to each user based on their past interactions.\n\nFor more information about AlloyDB AI use cases, see [AlloyDB AI use cases](/alloydb/docs/ai/alloydb-ai-use-cases).\n\nHow it works\n------------\n\nYou can use model endpoint management to register a model endpoint that complies to the following:\n\n- Model input and output supports JSON format.\n- Model can be called using the REST protocol.\n\nWhen you [register a model endpoint with the model endpoint management](/alloydb/docs/ai/register-model-endpoint), it registers each endpoint with a unique model ID that you provided as a reference to the model.\n\nYou can use the model endpoint ID to query models to do the following:\n\n- Generate embeddings to translate text prompts to numerical vectors. You can\n store generated embeddings as vector data when the `vector` extension is enabled in the database. For\n more information, see [Query and index embeddings with\n pgvector](/alloydb/docs/ai/store-embeddings).\n\n- Generate multimodal embeddings to translate multimodal data such as text,\n images, and videos to embeddings. ([Preview](/products#product-launch-stages))\n\n- Rank or score a list of items in a query based on a criteria stated using natural language. ([Preview](/products#product-launch-stages))\n\n- Invoke predictions using SQL.\n\nKey concepts\n------------\n\nBefore you start using model endpoint management, understand the concepts required to connect to and use the models.\n\n### Schemas\n\nYour applications can access model endpoint management using the `google_ml_integration`\nextension. The `google_ml_integration` extension includes functions in `public`, `google_ml`, and `ai` schema. All the functions are included in the `google_ml` schema, and certain functions are available in the `public` and `ai` schemas.\n\nFor more information about schemas, see [Schemas](/alloydb/docs/reference/model-endpoint#namespaces).\n\n### Model provider\n\n*Model provider* indicates the supported model hosting providers. Setting the\nmodel provider is optional, but helps model endpoint management by identifying the\nprovider, and automatically formatting headers for supported models.\n\nFor more information about model provider, see [Model provider](/alloydb/docs/reference/model-endpoint#model-provider).\n\n### Model type\n\n*Model type* indicates the type of the AI model. The extension supports text embedding as\nwell as any generic model type. The supported model type you can set when\nregistering a model endpoint are `text-embedding` and `generic`.\n\nSetting model type is\noptional when registering generic model endpoints as `generic` is the default model type.\n\nFor more information about model type, see [Model type](/alloydb/docs/reference/model-endpoint#model-type).\n\n### Authentication\n\n*Auth types* indicate the authentication type that you can use to connect to the\nmodel endpoint management using the `google_ml_integration` extension. Setting\nauthentication is optional and is required only if you need to authenticate to access your model.\n\nFor more information about authentication, see [Authentication](/alloydb/docs/reference/model-endpoint#authentication).\n\n### Prediction functions\n\nPrediction functions are SQL functions that let you interact with AI models from\nwithin your AlloyDB database. These functions let you use\nstandard SQL queries to send data to a model endpoint and generate embeddings or\npredictions.\n\nFor more information about prediction functions, see [Prediction functions](/alloydb/docs/reference/model-endpoint#prediction-functions).\n\n### Operator functions\n\nThe `google_ml_integration` extension includes the following operator functions,\nwhich use default Gemini to query using AI powered SQL operators.\n\nFor more information about operator functions, see [Operator functions](/alloydb/docs/reference/model-endpoint#operator-functions).\n\n### Transform functions\n\nTransform functions modify the input to a format that the model understands, and\nconverts the model response to the format that the prediction function expects. The\ntransform functions are used when registering the `text-embedding` model endpoint without\nbuilt-in support. The signature of the transform functions depends on the\ninput expected by the model.\n\nFor more information about transform functions, see [Transform functions](/alloydb/docs/reference/model-endpoint#transform-functions).\n\n### HTTP header generation function\n\nThe HTTP header generation function generates the output in JSON key value pairs\nthat are used as HTTP headers. The signature of the prediction function defines\nthe signatures of the header generation function.\n\nFor more information about HTTP header generation function, see [HTTP header generation function](/alloydb/docs/reference/model-endpoint#header-gen-function).\n\nWhat's next\n-----------\n\n- [Set up authentication](/alloydb/docs/ai/register-model-endpoint#before-you-begin) for model providers.\n- [Register a model endpoint with model endpoint management](/alloydb/docs/ai/register-model-endpoint).\n- Learn about the [model endpoint management reference](/alloydb/docs/reference/model-endpoint)."]]