Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aliyun avatar

Alibabacloud Odps Maxframe Coding

  • 172 installs
  • 208 repo stars
  • Updated August 4, 2026
  • aliyun/alibabacloud-aiops-skills

Author MaxFrame Python jobs on Alibaba ODPS/MaxCompute to transform warehouse tables, train features, and ship reproducible batch analytics without leaving the agent session.

About

alibabacloud-odps-maxframe-coding enables agents to write MaxFrame Python for Alibaba ODPS/MaxCompute: define data transforms, query partitioned tables, optimize job performance, and deliver reproducible batch analytics pipelines on managed big-data compute.

  • MaxFrame Python job authoring
  • ODPS table read/write patterns
  • Partitioning and performance tuning
  • Reproducible batch analytics workflows
  • MaxCompute integration best practices

Alibabacloud Odps Maxframe Coding by the numbers

  • 172 all-time installs (skills.sh)
  • Ranked #711 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aliyun/alibabacloud-aiops-skills --skill alibabacloud-odps-maxframe-coding

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs172
repo stars208
Last updatedAugust 4, 2026
Repositoryaliyun/alibabacloud-aiops-skills

What it does

Author MaxFrame Python jobs on Alibaba ODPS/MaxCompute to transform warehouse tables, train features, and ship reproducible batch analytics without leaving the agent session.

Files

assets/examples/ai_function_basic.pyPythonGitHub ↗
"""
Example: Basic AI function usage with MaxFrame ManagedTextLLM.

This example demonstrates the minimum setup for using MaxFrame's AI functions
with the managed LLM models. It shows how to perform basic Q&A tasks using
the built-in managed models without requiring external API keys.

Environment variables required:
- ODPS_PROJECT, ODPS_ACCESS_ID, ODPS_ACCESS_KEY, ODPS_ENDPOINT
"""

import os

import dotenv
import maxframe.dataframe as md
from maxframe import options
from maxframe.learn.contrib.llm.models.managed import ManagedTextLLM
from maxframe.session import new_session
from odps import ODPS

# Load environment variables from .env file
# Replace with your actual .env file path or use environment variables directly
dotenv.load_dotenv()

# Configure SQL settings for AI functions
options.sql.settings = {
    "odps.sql.split.dop": '{"*":10}',
}

# Create ODPS connection
o = ODPS(
    access_id=os.getenv("ODPS_ACCESS_ID"),
    secret_access_key=os.getenv("ODPS_ACCESS_KEY"),
    project=os.getenv("ODPS_PROJECT"),
    endpoint=os.getenv("ODPS_ENDPOINT"),
    user_agent='AlibabaCloud-Agent-Skills/alibabacloud-odps-maxframe-coding'
)

# Create MaxFrame session
session = new_session(o)
print(f"Session created: {session.session_id}")

# Create a DataFrame with questions
df = md.DataFrame(
    {
        "query": [
            "地球距离太阳的平均距离是多少?",
            "美国独立战争是从哪一年开始的?",
            "什么是水的沸点?",
        ]
    }
)
df.execute()

# Use ManagedTextLLM for inference
# Available managed models: qwen2.5-0.5b-instruct, qwen2.5-1.5b-instruct,
# qwen2.5-3b-instruct, Qwen2.5-7B-instruct, DeepSeek-R1-Distill-Qwen-1.5B, etc.
llm = ManagedTextLLM(name="qwen2.5-1.5b-instruct")

# Define prompt template
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "{query}"},
]

# Generate responses
result = llm.generate(df, prompt_template=messages)
result.execute()

# Display results
print("AI Function Results:")
print(
    result.response.mf.flatjson(
        ["$.choices[0].message.content"],
        dtypes=["str"],
    )
    .execute()
    .fetch()
)

# Clean up session
session.destroy()
print("Session destroyed")

Related skills

Data Science & MLpipelinesetlanalytics

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.