All Products
Search
Document Center

MaxCompute:MaxCompute AI functions

Last Updated:Mar 31, 2026

AI functions are a set of predefined functions in MaxCompute for AI-related tasks. They encapsulate complex model inference operations into concise SQL or Python operators. You can use these functions to invoke large models or machine learning models directly from standard SQL or MaxFrame (a distributed Python engine) without writing underlying model invocation code. This significantly lowers the barrier to entry for using AI in data processing and big data analytics.

Use cases

With their significantly enhanced ability to understand data, large models can extract precise semantic information from multimodal data, such as structured data, text, and unstructured data. Based on their instruction-following capabilities, these models can transform the semantic information into normalized data, enabling relational algebra operations. This enables unified queries and processing of both structured and unstructured data within a big data platform.

As use cases expand, the demand for unified computing within big data platforms is growing. MaxCompute addresses this demand by providing multiple computing engines, such as MaxFrame (Python) and SQL. In combination with AI functions, MaxCompute offers a more accessible way for users to leverage AI. This enhances the capability and quality of tasks in various data analysis and computing scenarios, including multimodal data processing, content generation, information extraction, and image and text analysis. Typical scenarios include:

  1. Data preprocessing for large model pre-training: Web data processing tasks for large model pre-training require using fine-tuned, small-parameter large language models for tasks like calculating text quality scores, text filtering, and text classification.

  2. Multimodal content understanding: Video and image data processing tasks in traditional e-commerce and emerging autonomous driving fields require using multimodal models for tasks such as object detection, image tagging, and classification.

  3. Intelligent risk control: In intelligent risk control scenarios, you can use fine-tuned, small-parameter large language models (LLMs) for tasks such as user behavior classification and risk alerts.

image.png

Features

  • Low-code development: Get started quickly. Perform model inference with a single function call, without deploying model services or writing complex inference logic. This significantly shortens the development cycle and lowers the barrier to building AI applications.

  • Seamless integration: AI functions integrate seamlessly with MaxCompute model objects, computing resources, and the permission system, which simplifies adoption.

  • Unified multi-engine support: MaxCompute provides unified AI function capabilities across both its SQL and MaxFrame engines. This allows data analysts to use familiar SQL to call powerful AI models, while data scientists can leverage the distributed Python computing power of MaxFrame to continuously improve their data preprocessing tasks.

AI functions

SQL AI functions

MaxCompute provides SQL-based AI functions that support inference calls by specifying MaxCompute model objects. These include built-in public large language models, user-imported models, and remote models from PAI-EAS. For more information about model types, see Model types.

  • The following table describes the SQL AI functions that MaxCompute supports.

    Function

    Description

    Model types

    AI_GENERATE

    Generates natural language text. Use it for complex reasoning, multimodal tasks, and processing unstructured data.

    • LLM

    • MLLM

    ML_PREDICT

    Makes predictions on structured data. Use it for traditional machine learning tasks like classification and regression.

    • BOOSTED_TREE_REGRESSOR

    • BOOSTED_TREE_CLASSIFIER

Billing

When you use a SQL AI function to call a model:

  • If you use subscription standard computing resources (also called a subscription CU quota), this consumes your CU quota.

  • If you use pay-as-you-go standard computing resources (also called a pay-as-you-go CU quota), you are billed based on the amount of data scanned by the SQL job. This does not incur separate CU computing fees.

MaxFrame AI functions

MaxCompute also provides Python-based AI functions through MaxFrame.

The model call consumes CPU or GPU resources based on the required resource type. For more information, see MaxFrame AI functions.

Examples

For more use cases of MaxCompute models and AI functions, see the following topics: