The REGISTER_PROVIDER procedure is used to create an AI service provider configuration within a tenant for managing vendor connection information and access credentials. After configuration, AI functions can be called in the provider/model format. Built-in vendors and custom vendors are supported.
Note
This procedure is supported starting from V4.6.2.1.
Syntax
PROCEDURE register_provider(
IN provider_name VARCHAR(256),
IN json_params JSON);
Parameters
Parameter |
Description |
Type |
Value range |
Nullable |
|---|---|---|---|---|
| provider_name | Vendor name. | VARCHAR(256) | Up to 256 bytes | NO |
| json_params | Vendor configuration, which must be a JSON object. | JSON | See the following table. | NO |
The json_params parameter supports the following fields:
field |
Type |
Whether required |
Description |
|---|---|---|---|
protocol |
VARCHAR(256) | No | Communication protocol. Default: custom vendor. openai, or it can be set to vllm; Built-in parameters can be omitted during the first registration by a vendor, as the system automatically fills in the default built-in values. |
base_url |
VARCHAR(2048) | Yes (required when a custom vendor is created for the first time) | The base URL of the model service. This parameter can be omitted for built-in models, as the system automatically fills it in. |
access_key |
VARCHAR(2048) | Yes | Access credentials, which are stored in encrypted form during write operations. |
Notice
If a provider with the same name already exists, use ALTER_PROVIDER to update the configuration.
Built-in vendors
The current version includes built-in default values for the protocol and base_url parameters of the following providers. These built-in defaults serve as preset configurations and are not directly written to system tables. When executing REGISTER_PROVIDER, if a provider is of the built-in type and either the protocol or base_url parameter is missing, the system will automatically fill in the value:
provider |
protocol |
base_url |
|---|---|---|
aliyun |
openai |
https://dashscope.aliyuncs.com/compatible-mode/v1 |
aliyun-dashscope |
dashscope |
https://dashscope.aliyuncs.com/api/v1 |
deepseek |
openai |
https://api.deepseek.com |
siliconflow |
openai |
https://api.siliconflow.cn/v1 |
openai |
openai |
https://api.openai.com/v1 |
cohere |
cohere |
https://api.cohere.com/v2 |
tencent |
openai |
https://api.hunyuan.cloud.tencent.com/v1 |
Examples
To register a built-in vendor, you only need to specify the access_key:
CALL DBMS_AI_SERVICE.REGISTER_PROVIDER('aliyun', '{
"access_key": "sk-xxxx"
}');
Register a custom vendor:
CALL DBMS_AI_SERVICE.REGISTER_PROVIDER('ob-mass', '{
"protocol": "openai",
"base_url": "https://example.com/v1",
"access_key": "sk-xxxx"
}');
Register the VLLM service (protocol set to vllm, and base_url filled with the /v1 address; currently only embedding is supported, text generation and reordering are not supported):
CALL DBMS_AI_SERVICE.REGISTER_PROVIDER('vllm', '{
"protocol": "vllm",
"base_url": "https://vllm.example.com/v1",
"access_key": "sk-xxxx"
}');