On the AI service page, you can configure the default model, manage the database registration of AI models, and view API and SQL call examples for models. With these capabilities, you can directly call models in your applications or use AI functions in the database to leverage model capabilities.
Features
The AI model page provides the following capabilities:
Configure the default model: Select the default model for scenarios such as text generation, text embedding, text reranking, multi-modal embedding, and multi-modal reranking.
Automatically activate database-registered AI models: When it is enabled, the system automatically handles AI model registration in the database, making it easier to directly call models in the database.
View provider models: View the list of models and their types provided by the current provider to choose the appropriate model.
Generate call examples: Generate API and SQL call examples to help you quickly integrate and verify the models.
Prerequisites
You have accessed the AI service page.
You have created a valid API Key. For operation instructions, see Manage AI API Keys.
If you need to call models in the database using SQL, log in to the database using a database account with the
ACCESS AI MODELprivilege. For more information, see Enable AI function built-in models.
Base models
Go to the Model page of the AI service.
In the Base Model section, select the default model for each task as needed. For more information, see Built-in models.
Default modelDescriptionText generation Used for scenarios such as dialog generation, content creation, and question-answering. Text embedding Converts text into vectors, suitable for semantic search and similarity calculations. Text reranking Ranks the retrieved results by relevance to improve search quality. Multi-modal embedding Converts multi-modal content such as images and text into vectors, suitable for cross-modal search. Multi-modal reranking Ranks the retrieved multi-modal results to enhance the effectiveness of multi-modal search. After saving the configuration, subsequent calls will prioritize the default models you set.
Enhanced model calling capabilities:
Auto-Routing Policy: Dynamically routes and load balances requests based on request context, model capabilities, and predefined business rules, ensuring service quality while balancing cost, latency, and stability.
Fall Back to Default Model: When it is enabled, if the specified model is unavailable, an exception occurs, or configurations change, the system automatically falls back to the default model, improving call continuity.
You can view the information of the current available base model providers in the Model Providers section. The page typically displays provider names, model sources, and model counts in card format.
Database model registration
The Database Model Registration switch is used to control database-side model registration capabilities. When it is enabled, the system automatically handles the capabilities required for database model registration. When it is disabled, you can still manually generate SQL and complete registration on the database side.
If your main use case involves calling models through SQL and AI functions, it is recommended to enable this option to simplify the database integration process.
Procedure
On the Model page, click Database Model Registration.
In the pop-up window, complete the following configuration:
Select Instance: Supported only for instances of version V4.4.2 and later. Select the target instance for registering the AI model.
Select Tenant: Select a tenant under the target instance.
In the Models Callable by AI Functions section, select the model source:
Default Model: Directly select the already configured default model.
Custom Models: Specify a model from the list as needed.
Select API Key: Select the API Key used for authentication. To create a new API Key, click Create API Key.
Click Generate SQL to obtain the SQL statement for registering the AI model.
For actual calls, you must log in to the database with a database account that has the ACCESS AI MODEL privilege to call the AI model.
The generated SQL can be used to complete the model registration in the target database.
View model call examples
The page provides API and SQL examples for model calls.
Call a model via API
On the Call Model via API tab, the page displays an example of calling a model through an HTTP interface. The process is as follows:
Create an API Key for authentication.
Use the API Key to call the model through an HTTP request.
For more information, see AI APIs.
curl -X POST https://api.example.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3-max", "messages": [{"role": "user", "content": "Hello"}]}'
Call a model via SQL
On the Call Model via SQL tab, the page displays an example of calling a model in the database using the AI function. You can call the model in SQL as follows:
SELECT AI_COMPLETE("ob_complete","How are you") AS ans;
SELECT AI_EMBEDDING("ob_embed","I am OceanBase Cloud AI") AS embedding;
SELECT AI_RERANK("ob_rerank","Apple",'["apple","banana","fruit","vegetable"]') AS rerank_result;
Rate limiting
Project admins and project owners can set model rate limits for the current project. The upper limit for model rates depends on the organization-level rate limit. To request a higher quota, contact the organization admin to increase the organization-level rate limit.
The default rate limits for each model type are as follows:
Model type |
Token per minute (TPM) |
Requests per minute (RPM) |
|---|---|---|
| Text generation | 100,000 | 10 |
| Text embedding | 100,000 | 10 |
| Text reordering | 100,000 | 10 |
| Multi-modal embedding | 100,000 | 10 |
| Multi-modal reordering | 100,000 | 10 |
Modify the rate limit
You can modify the rate limit for each model type. The procedure is as follows:
In the rate limit list, find the model type you want to modify.
Click ··· in the Actions column of the corresponding row. In the dialog box that appears, adjust the values for Tokens Per Minute (TPM) and Requests Per Minute (RPM). The modified values must not exceed the upper limit of the organization-level rate limit.
Click the checkmark icon to complete the modification.
