This topic describes the data definition language (DDL) statements for registering, viewing, modifying, and deleting AI models.
Usage notes
The system supports Alibaba Cloud Model Studio, Platform for AI, and other large model services with OpenAI compatible interfaces.
Large model services deployed on Platform for AI must be in the same region as the real-time computing Flink service.
Only Ververica Runtime (VVR) 11.1 or later is supported.
CREATE MODEL
Register a model
Create a script, and enter a CREATE TABLE command in the SQL editor. Syntax:
CREATE [TEMPORARY] MODEL [catalog_name.][db_name.]model_name
INPUT ( { <physical_column_definition> [, ...n] )
OUTPUT ( { <physical_column_definition> [, ...n] )
WITH (key1=val1, key2=val2, ...)
<physical_column_definition>:
column_name column_type [COMMENT column_comment]Clause | Description | Key parameters | Schema requirements | Example |
INPUT | Defines the fields, field types, and field order of input data. |
| Exactly one STRING field is required. |
|
OUTPUT | Defines the fields, field types, and field order of output data. |
| Constraints for different task types:
|
|
WITH | See Parameters. |
| None. |
|
Examples
Alibaba Cloud Model Studio
CREATE MODEL model_bailian
INPUT (`input` STRING)
OUTPUT (`content` STRING)
WITH (
'provider'='bailian',
'endpoint'='<Endpoint>',
'api-key'='<bailian-key>',
'model'='qwen3-235b-a22b'
);Alibaba Cloud Model Studio's endpoint format: <base-url>/compatible-mode/v1/<task>. For example https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions.
base-url:
Internet access:
https://dashscope-intl.aliyuncs.com. To access Alibaba Cloud Model Studio via the internet, enable public access for your Flink workspace. For more information, see Network connectivity selection.Internal access: Access Alibaba Cloud Model Studio platform through endpoints over internal network. Currently only supports workspaces deployed in the Singapore region.
task: Model task type. Valid values:
PAI
CREATE MODEL model_pai
INPUT (`input` STRING)
OUTPUT (`embedding` ARRAY<FLOAT>)
WITH (
'provider'='bailian',
'endpoint'='<vpc_endpoint>',
'api-key'='<Token>',
'model'='qwen3-235b-a22b'
);To obtain the VPC endpoint and an API key, see One-click deployment of DeepSeek-V3 and DeepSeek-R1 models.
Log on to the PAI console.
In the left navigation pane, choose , and click the corresponding task name.
Click View Invocation Information.
ImportantThe VPC invocation address uses http, which needs to be changed to https. The address suffix needs to be appended with
/v1/<task>. task: Model task type. The following values are supported:Example:
https://************.vpc.cn-hangzhou.pai-eas.aliyuncs.com/api/predict/quickstart_deploy_20250722_7b22/v1/chat/completions.Tokenis the value for theapi-keyparameter.
Parameters
General
Parameter | Description | Data type | Required | Default value | Note |
provider | The model service provider. | String | Yes | No default value | Always set it to |
endpoint | The API endpoint of Alibaba Cloud Model Studio or other services that offer OpenAI API compatibility for chat, completions, or embeddings. | String | Yes | No default value |
|
api-key | The API key used to access Alibaba Cloud Model Studio APIs. | String | No default value | See Obtain API key. In VVR 11.1, the parameter is as | |
max-context-size | The maximum context length in a single request. | Integer | No | No default value |
|
context-overflow-action | Specifies how to handle a context exceeding the context length limit. | String | No |
| This parameter is supported in VVR 11.2 and later versions. Valid values:
|
chat/completions
chat/completions model tasks depend on the following parameters:
Parameter | Description | Data type | Required | Default value | Note |
model | The model to call. | String | Yes | No default value | Supports text generation models. Note You are billed based on the LLM selected and the number of input and output tokens. |
system-prompt | The system prompt when you request a response. | String | Yes | "You are a helpful assistant." | Parameter name in VVR 11.1: |
temperature | Controls the randomness of the model's output. | float | No | No default value | Valid value range: [0, 2). Note: The value 0 is meaningless and thus not recommended. A higher temperature makes the less probable token more likely to be selected; a lower temperature increases a model's likelihood of selecting tokens with higher probability. |
top-p | Specifies a cumulative probability of tokens considered for sampling. | float | No | No default value | A greater value introduces more randomness to the generated content. Parameter name in VVR 11.1: |
stop | The stop sequence. | String | No | No default value | The model stops generating more text after the specified string appears. |
max-tokens | Specifies the maximum length of generated texts. | Integer | No | No default value | Parameter name in VVR 11.1: |
embeddings
Embeddings model tasks depend on the following parameters:
Parameter | Description | Data type | Required | Default value | Note |
model | The model to call. | String | Yes | No default value | Supports text embedding models. Note You are billed based on the LLM selected and the number of input and output tokens. |
dimension | Controls the output vector dimension. | Integer | No | 1024 | Valid values:: 1024, 768, 512. Using other values will result in an error. |
View models
Create a script and enter the query in the SQL editor.
Show the names of the registered models.
SHOW MODELS [ ( FROM | IN ) [catalog_name.]database_name ];Show the statement used to register a model.
SHOW CREATE MODEL [catalog_name.][db_name.]model_name;Show the input and output schema of the model.
DESCRIBE MODEL [catalog_name.][db_name.]model_name;
Example
SHOW MODELS;
-- RESULT
--+------------+
--| model name |
--+------------+
--| m |
--+------------+
DESCRIBE MODEL m;
-- RESULT
-- +---------+--------+------+----------+
-- | name | type | null | is input |
-- +---------+--------+------+----------+
-- | content | STRING | TRUE | TRUE |
-- | label | BIGINT | TRUE | FALSE |
-- +---------+--------+------+----------+
Modify models
Create a script and enter the query in the SQL editor.
ALTER MODEL [IF EXISTS] [catalog_name.][db_name.]model_name {
RENAME TO new_table_name
SET (key1=val1, ...)
RESET (key1, ...)
}Examples
Rename a registered model.
ALTER MODEL m RENAME TO m1; -- Rename to m1;Modify model parameters.
ALTER MODEL m SET ('endpoint' = '<Your_Endpoint>'); -- Adjust the endpoint path;Reset model parameters to default values.
ALTER MODEL m RESET ('endpoint'); -- Reset the endpoint path;
Delete models
Create a script and enter the query in the SQL editor.
DROP [TEMPORARY] MODEL [IF EXISTS] [catalog_name.][db_name.]model_nameExample
DROP MODEL m;