Real-Time Compute for Apache Flink provides built-in AI models that you can call directly in Flink SQL jobs and Flink Agent without configuring an API key or endpoint.
This feature is in whitelisted Beta. You must submit an application and be approved before you can use it. No separate activation is required. During the Beta, model invocations are free of charge. The billing methods and service models described below take effect after commercial release. For the release date, see product announcements.
Overview
Flink AI service (built-in models) is a managed AI model invocation capability in Real-Time Compute for Apache Flink. You can call built-in models in Flink SQL jobs and Flink Agent without configuring an API key, enabling streaming AI inference and embedding.
Core advantages
|
Feature |
Description |
|
Out-of-the-box |
No need to configure an API-Key, endpoint, or PrivateLink. |
|
Billed by token |
Token-based billing with clear, controllable costs. |
|
Multi-model support |
Supports popular large models for text generation, visual understanding, translation, and embedding. |
|
Global region coverage |
Available in multiple regions inside and outside the Chinese mainland, with automatic cross-region access. |
How it works
Built-in model vs. custom model (BYOK)
|
Dimension |
Item |
Built-in model (Recommended) |
Custom model (Not recommended) |
|
Access configuration |
endpoint |
Not required. The system configures it automatically. |
Required. |
|
api-key |
Not required. The system manages it. |
You must provide and maintain it. |
|
|
Supported models |
Only models in the built-in model list. |
Any model compatible with the OpenAI/DashScope protocol. |
|
|
Prerequisites |
The primary account must enable the Flink AI feature in the desired region. |
You must enable the model service and obtain an API-Key. |
|
|
Network and security |
Access path |
Access is direct over the Alibaba Cloud internal network. Traffic does not leave the VPC. |
Requires public internet access. |
|
Data security |
High security. Traffic is transmitted end-to-end over the Alibaba Cloud internal network. |
Data is transmitted over the public internet. You are responsible for assessing the risks. |
|
|
Network configuration cost |
Zero configuration. |
Public internet access requires a NAT Gateway, an EIP, or a public IP address. |
|
|
Performance |
Invocation latency |
Low latency. Direct internal connection avoids extra network hops. |
Higher and less stable latency due to public network fluctuations. |
|
Availability |
SLA-backed with stable network and lower latency. |
Depends on the model service provider's SLA and network link stability. |
|
|
Billing |
Model invocation fees |
Billed by token. |
Billed directly by the model service provider. |
|
Network fees |
No extra fees. |
You must pay for the NAT Gateway, EIP, and public network traffic. |
|
|
Billing consolidation |
Consolidated in your Flink bill. |
Model and network fees are billed separately. |
|
|
Capability boundaries |
Token limits |
Up to 8K for input, and up to 2K for output. |
Determined by the model service provider. |
Enable and disable the service
This feature is in whitelisted Beta. You must submit an application and be approved before you can use it. No separate activation is required.
Prerequisites
-
A primary account must enable the feature.
-
Once enabled in a region, all workspaces in that region can use it.
-
This feature is pay-as-you-go. You are charged only for model invocations, not for enabling the feature. For details, see
Log on to the Real-Time Compute for Apache Flink console. On the Flink AI Service page, click Enable Now.
Disable the service
On the Flink AI Service page, click Disable Service and confirm the following:
-
After you disable the feature, all jobs in the region can no longer use the built-in model service.
-
Before you disable the feature, make sure that no jobs depend on the built-in models.
Supported regions
|
Flink AI service region |
Region ID |
Endpoint region |
Inference execution region |
|
China (Beijing) |
cn-beijing |
China (Beijing) |
Chinese mainland (dynamic scheduling) |
|
China (Zhangjiakou) |
cn-zhangjiakou |
||
|
China (Ulanqab) |
cn-wulanchabu |
||
|
China (Shanghai) |
cn-shanghai |
||
|
China (Hangzhou) |
cn-hangzhou |
||
|
China (Shenzhen) |
cn-shenzhen |
||
|
China (Chengdu) |
cn-chengdu |
||
|
Singapore |
ap-southeast-1 |
Singapore |
Regions outside the Chinese mainland (dynamic scheduling) |
|
China (Hong Kong) |
cn-hongkong |
||
|
Malaysia (Kuala Lumpur) |
ap-southeast-3 |
||
|
Indonesia (Jakarta) |
ap-southeast-5 |
||
|
Japan (Tokyo) |
ap-northeast-1 |
||
|
UK (London) |
eu-west-1 |
||
|
Germany (Frankfurt) |
eu-central-1 |
||
|
UAE (Dubai) |
me-east-1 |
||
|
Mexico |
na-south-1 |
Choose a region based on your data compliance requirements. The selected region determines where data is accessed and where inference runs.
-
Endpoint region: Determines the access point and data storage location.
-
Inference execution region: Where inference runs. Dynamically scheduled within a defined scope.
Built-in models
Inference models (chat/completions)
|
Model name |
Use case |
Input |
Output |
Supported regions |
|
qwen3.6-plus |
Visual understanding and text generation. The latest flagship Qwen model. |
Text/Image/Video |
Text |
All |
|
qwen3.6-flash |
Visual understanding and text generation. A cost-effective model. |
Text/Image/Video |
Text |
All |
|
qwen3.5-plus |
Visual understanding and text generation. A high-performance model. |
Text/Image/Video |
Text |
All |
|
qwen3.5-flash |
Visual understanding and text generation. A fast, low-cost model. |
Text/Image/Video |
Text |
All |
Embedding models (embeddings)
|
Model name |
Use case |
Input |
Output |
Supported regions |
|
text-embedding-v4 |
Text embedding |
Text |
Vector |
All |
|
qwen3-vl-embedding |
Multimodal embedding |
Image/Text/Video |
Vector |
Chinese mainland |
Usage
Basic syntax
To use a built-in model, specify the task and model parameters in the CREATE MODEL statement. Do not specify endpoint or api-key.
CREATE MODEL model_name
INPUT (column_name STRING)
OUTPUT (column_name {STRING | ARRAY<FLOAT>})
WITH (
'provider' = 'openai-compact',
'task' = 'chat/completions | embeddings',
'model' = '<model-name>'
);
For more details, see Model configuration.
Relationship with custom models
|
Scenario |
endpoint |
api-key |
Behavior |
|
Use a built-in model |
Not specified |
Not specified |
Automatically uses the Flink-managed model service. |
|
Use a custom model |
Specified |
Specified |
Uses a custom model service (BYOK mode). |
Your primary account must first enable the Flink AI feature before you can use built-in models. Otherwise, jobs that omit endpoint and api-key fail.
Limitations
|
Item |
Limit |
Description |
|
Maximum input tokens |
8K |
The system default limit. If you specify |
|
Maximum output tokens |
2K |
The system default limit. If you specify |
|
Model scope |
Built-in model list |
Only models in the list are supported. Specifying any other model causes an error. |
Use cases
|
Scenario |
Recommended model |
Description |
|
Real-time text classification and tagging |
qwen3.5-flash / qwen3.6-flash |
Real-time sentiment analysis and classification tagging on streaming data. |
|
Real-time information extraction |
qwen3.5-plus / qwen3.6-plus |
Extract structured information from unstructured text. |
|
Real-time embedding |
text-embedding-v4 |
Generate embeddings from streaming data for similarity searches. |
|
Multimodal embedding |
qwen3-vl-embedding |
Generate unified embeddings for images, text, and videos. |