All Products
Search
Document Center

MaxCompute:Introduction to MaxCompute AI functions

Last Updated:Oct 28, 2025

AI functions are a set of predefined functions in MaxCompute for AI scenarios. These functions package complex AI inference operations into simple SQL or Python operators. You can directly invoke large language models (LLMs) or machine learning models using standard SQL or MaxFrame, a distributed Python engine, without writing low-level code for model calls. This significantly lowers the barrier to using AI for data processing and big data analytics.

Scenario overview

Large language models have significantly improved their ability to understand data. They can extract precise semantic information from multimodal data, including structured data, text, and unstructured data. These models can also follow instructions to convert semantic information into normalized data, which enables relational algebra operations. This makes it possible to unify the querying and processing of both structured and unstructured data on a big data platform.

As user scenarios expand, the demand for integrated computing on big data platforms is growing. MaxCompute provides multiple compute engines, such as MaxFrame (Python) and SQL. When combined with AI functions, these engines offer an easier and more accessible way to use AI. This helps you improve the performance and quality of data analytics and computing scenarios, such as multimodal data processing, content generation, information extraction, and image and text parsing. Typical scenarios include the following:

  1. Large model pre-training data processing: For WebData Processing tasks in large model pre-training, you can use fine-tuned, small-parameter large language models for tasks such as text quality scoring, text filtering, and text classification.

  2. Multimodal content understanding: For video and image data processing tasks in traditional E-commerce and emerging autonomous driving fields, you can use 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 LLMs for tasks such as user behavior classification and risk alerting.

image.png

Features

  • Low-code development: AI functions are easy to use. You can complete AI inference with a single function call without the need to deploy model services or write complex inference logic. This significantly shortens the development cycle and lowers the barrier to using AI.

  • Seamless integration: AI functions integrate seamlessly with MaxCompute model objects, computing resources, and permission systems.

  • Unified multi-engine support: The MaxCompute SQL and MaxFrame engines both provide unified AI function capabilities. This allows data analysts to use familiar SQL to call powerful AI models. It also allows data scientists to use the distributed Python computing power of MaxFrame with models to continuously improve the performance and quality of data pre-processing.

AI function overview

SQL AI functions

MaxCompute provides SQL-based AI functions. These functions support inference calls that specify MaxCompute model objects. These models can be built-in public large language models, user-imported models, or remote models in PAI-EAS. For more information about models, see Model types.

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

    AI function name

    Description

    Supported model types

    AI_GENERATE

    Generates natural language text. Supports complex logical reasoning, multimodal tasks, and unstructured data processing.

    • LLM

    • MLLM

    ML_PREDICT

    Makes predictions on structured data. It is often used for traditional machine learning tasks, such as classification and regression.

    • BOOSTED_TREE_REGRESSOR

    • BOOSTED_TREE_CLASSIFIER

Billing (SQL AI functions)

When you use a SQL AI function to call a model, model deployment and inference consume MaxCompute computing resources. If you use the subscription billing method, your CU quota is consumed. If you use the pay-as-you-go billing method, you are billed based on the amount of data scanned by the SQL job, and no separate CU computing fees are generated.

MaxFrame AI functions

MaxCompute also provides Python-based AI functions on MaxFrame. These functions support inference calls on CPUs and GPUs. For more information about how to use these functions, see MaxFrame AI functions.

Use cases

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

  • Use a public MaxCompute model for sentiment analysis of online reviews.

  • Use MaxCompute to train and make predictions with an XGBoost model.

  • Use a remote MaxCompute model to automatically generate E-commerce product descriptions.