AI Models & Assistant
Leaflow Console provides two complementary AI capabilities: Canopy for unified OpenAI-compatible model inference APIs, and AI Assistant for automated workflows, scheduled runs, and team chat integration.
1. Model API Gateway (Canopy)
Section titled “1. Model API Gateway (Canopy)”- Drop-In OpenAI Compatibility: Use
https://llm.leaflow.cloud/v1directly with existing OpenAI SDKs, agent frameworks, and CLI clients by updating onlybase_urlandapi_key. - Scoped Keys & Usage Visibility: Issue separate API keys per app or environment, rotate or revoke them anytime, and inspect request volume and costs per model and key.
Quickstart
Section titled “Quickstart”-
Open AI Models in the console, click Create API Key, and store the generated key safely.
-
Pick an available model ID from the console model catalog.
-
Send your first request using any OpenAI-compatible client:
chat.sh curl https://llm.leaflow.cloud/v1/chat/completions \-H "Authorization: Bearer $LEAFLOW_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<model-id>","messages": [{"role": "user", "content": "Summarize 3 daily cloud server security practices."}]}'client.ts import OpenAI from 'openai';const client = new OpenAI({apiKey: process.env.LEAFLOW_API_KEY,baseURL: 'https://llm.leaflow.cloud/v1',});const res = await client.chat.completions.create({model: '<model-id>',messages: [{ role: 'user', content: 'Hello from Leaflow!' }],});console.log(res.choices[0]?.message?.content);client.py import osfrom openai import OpenAIclient = OpenAI(api_key=os.environ["LEAFLOW_API_KEY"],base_url="https://llm.leaflow.cloud/v1",)res = client.chat.completions.create(model="<model-id>",messages=[{"role": "user", "content": "Hello from Leaflow!"}],)print(res.choices[0].message.content)
2. AI Assistant
Section titled “2. AI Assistant”AI Assistant lets individuals and teams configure custom agents, knowledge files, form triggers, schedules, and multi-step workflows—and connect them to Feishu (Lark), Telegram, and WeChat.
Human-in-the-Loop Approval Flow
Section titled “Human-in-the-Loop Approval Flow”Before executing sensitive actions or when additional context is needed, the assistant pauses cleanly and sends an interactive confirmation card to the console and connected chat apps, then resumes from the exact checkpoint once approved:
sequenceDiagram actor User as User (Console / Feishu / Telegram / WeChat) participant Assistant as Leaflow AI Assistant participant Tools as Authorized Tools & Workflows User->>Assistant: Start a task or trigger workflow Assistant->>Tools: Run read and analysis steps Assistant-->>User: Stream live step progress Assistant->>User: Pause before sensitive action and request approval User->>Assistant: Approve or reply with input Assistant->>Tools: Resume remaining steps from checkpoint Assistant-->>User: Deliver final result