All Products
Search
Document Center

Realtime Compute for Apache Flink:Model settings

Last Updated:Nov 05, 2025

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.

  • column_name

  • column_type

  • COMMENT

Exactly one STRING field is required.

INPUT (`input_text` STRING COMMENT 'User comment')

OUTPUT

Defines the fields, field types, and field order of output data.

  • column_name

  • column_type

  • COMMENT

Constraints for different task types:

OUTPUT (`sentiment_label` STRING COMMENT 'Sentiment label')

WITH

See Parameters.

  • provider

  • endpoint

  • apiKey

  • model

None.

WITH ('provider'='bailian', 'endpoint'='${ENDPOINT}', 'model'='qwen-turbo', 'apiKey'='${KEY}')

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.

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.

  1. Log on to the PAI console.

  2. In the left navigation pane, choose Model Gallery > Job Management > Deployment Jobs, and click the corresponding task name.

  3. Click View Invocation Information.

    Important
    • The 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.

    • Token is the value for the api-key parameter.

Parameters

General

Parameter

Description

Data type

Required

Default value

Note

provider

The model service provider.

String

Yes

No default value

Always set it to bailian.

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

  • For endpoints for Alibaba Cloud Model Studio and PAI, see Examples.

  • For other services, refer to the service's API documentation.

api-key

The API key used to access Alibaba Cloud Model Studio APIs.

String

Yes

No default value

See Obtain API key.

In VVR 11.1, the parameter is as apiKey.

max-context-size

The maximum context length in a single request.

Integer

No

No default value

  • This parameter is supported in VVR 11.2 and later.

  • A context window exceeding this limit triggers behavior as defined in context-overflow-action.

context-overflow-action

Specifies how to handle a context exceeding the context length limit.

String

No

truncated-tail

This parameter is supported in VVR 11.2 and later versions.

Valid values:

  • truncated-tail: Truncates the context from the end to fit max-context-size, without logging the trucation.

  • truncated-tail-log: Truncates the context from the end to fit max-context-size and logs the truncation.

  • truncated-head: Truncates the context from the end to fit max-context-size, without logging the truncation.

  • truncated-head-log: Truncates the context from the end to fit max-context-size and logs the truncation.

  • skipped: Aborts the data without logging.

  • skipped-log: Aborts the data and logs it.

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: systemPrompt

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: topP

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: maxTokens

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_name

Example

DROP MODEL m;