安装
npx skills add AIsa-team/agent-skills --skill cn-llm
npm install -g @aisa-one/cli
aisa skills install cn-llm
智能体可以用它做什么?
中文提示词
将中文任务路由至性能强劲的中文大模型。
模型选择
在 Qwen、DeepSeek、GLM、Baichuan 及相关模型之间自由选择。
双语工作流
在中文模型与全球模型系列之间灵活切换。
智能体默认配置
为智能体提供实用的路由启发式规则。
🔥 你可以做什么
智能对话
"用 Qwen 回答中文问题,用 DeepSeek 写代码"
深度推理
"使用 DeepSeek V4 Pro 处理复杂推理任务"
代码生成
"使用 DeepSeek-Coder 生成带解释的 Python 代码"
长文本处理
"使用 Qwen-Long 总结超长文档"
模型对比
"对比 Qwen3.7 Max 与 DeepSeek V4.1 Flash 的回答质量"
支持的模型
Qwen(阿里巴巴)
| 模型 | 特性 |
|---|---|
| qwen3.7-max | 最强通用模型 |
| qwen3-coder-flash | 快速代码生成 |
| qwen3-vl-plus | 视觉-语言模型 |
| qwen-plus-2025-12-01 | Plus 版本 |
| qwen-mt-flash | 快速机器翻译 |
| qwen-mt-lite | 轻量机器翻译 |
DeepSeek
| 模型 | 特性 |
|---|---|
| deepseek-v4-pro | 更强的推理与编程 |
| deepseek-v4.1-flash | 低成本通用对话,支持 Tools |
注意:模型可用性可能会发生变化。最新列表和当前价格请参阅 aisa.one/models。
快速开始
export AISA_API_KEY="your-key"
API 端点
OpenAI 兼容接口
POST https://api.aisa.one/v1/chat/completions
Qwen 示例
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-max",
"messages": [
{"role": "system", "content": "You are a professional Chinese assistant."},
{"role": "user", "content": "Please explain what a large language model is?"}
],
"temperature": 0.7,
"max_tokens": 1000
}'
DeepSeek 示例
# DeepSeek V4.1 Flash low-cost chat
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Write a quicksort algorithm in Python"}],
"temperature": 0.3
}'
# DeepSeek V4 Pro stronger reasoning
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [{"role": "user", "content": "A farmer needs to cross a river with a wolf, a sheep, and a cabbage. The boat can only carry the farmer and one item at a time. If the farmer is not present, the wolf will eat the sheep, and the sheep will eat the cabbage. How can the farmer safely cross?"}]
}'
Qwen3 代码生成示例
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-coder-flash",
"messages": [{"role": "user", "content": "Implement a thread-safe Map in Go"}]
}'
参数参考
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型标识符 |
messages | array | 是 | 消息列表 |
temperature | number | 否 | 随机性(0-2,默认为 1) |
max_tokens | integer | 否 | 生成的最大 token 数 |
stream | boolean | 否 | 流式输出(默认为 false) |
top_p | number | 否 | 核采样参数(0-1) |
响应格式
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1234567890,
"model": "qwen3.7-max",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "A large language model (LLM) is a deep learning-based..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 30,
"completion_tokens": 150,
"total_tokens": 180
}
}
流式输出
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-plus-2025-12-01",
"messages": [{"role": "user", "content": "Tell a Chinese folk story"}],
"stream": true
}'
data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":"Once"}}]}
data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":" upon"}}]}
...
data: [DONE]
Python 客户端
CLI 用法
# Qwen chat
python3 scripts/cn_llm_client.py chat --model qwen3.7-max --message "Hello, please introduce yourself"
# Qwen3 code generation
python3 scripts/cn_llm_client.py chat --model qwen3-coder-flash --message "Write a binary search algorithm"
# DeepSeek V4 Pro reasoning
python3 scripts/cn_llm_client.py chat --model deepseek-v4-pro --message "Which is larger, 9.9 or 9.11? Please reason in detail"
# DeepSeek V4.1 Flash chat
python3 scripts/cn_llm_client.py chat --model deepseek-v4.1-flash --message "Tell a story" --stream
# With system prompt
python3 scripts/cn_llm_client.py chat --model qwen3.7-max --system "You are a classical poetry expert" --message "Write a poem about plum blossoms"
# Model comparison
python3 scripts/cn_llm_client.py compare --models "qwen3.7-max,deepseek-v4.1-flash" --message "What is quantum computing?"
# List supported models
python3 scripts/cn_llm_client.py models
Python SDK 用法
from cn_llm_client import CNLLMClient
client = CNLLMClient() # Uses AISA_API_KEY environment variable
# Qwen chat
response = client.chat(
model="qwen3.7-max",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response["choices"][0]["message"]["content"])
# Qwen3 code generation
response = client.chat(
model="qwen3-coder-flash",
messages=[
{"role": "system", "content": "You are a professional programmer."},
{"role": "user", "content": "Implement a singleton pattern in Python"}
],
temperature=0.3
)
# Streaming output
for chunk in client.chat_stream(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Tell a story about an idiom"}]
):
print(chunk, end="", flush=True)
# Model comparison
results = client.compare_models(
models=["qwen3.7-max", "deepseek-v4.1-flash", "deepseek-v4-pro"],
message="Explain what machine learning is"
)
for model, result in results.items():
print(f"{model}: {result['response'][:100]}...")
使用场景
1. 中文内容生成
# Copywriting
response = client.chat(
model="qwen3.7-max",
messages=[
{"role": "system", "content": "You are a professional copywriter."},
{"role": "user", "content": "Write a product introduction for a smart watch"}
]
)
2. 代码开发
# Code generation and explanation
response = client.chat(
model="qwen3-coder-flash",
messages=[{"role": "user", "content": "Implement a thread-safe Map in Go"}]
)
3. 复杂推理
# Mathematical reasoning
response = client.chat(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Prove: For any positive integer n, n³-n is divisible by 6"}]
)
4. 视觉理解
# Image understanding
response = client.chat(
model="qwen3-vl-plus",
messages=[
{"role": "user", "content": [
{"type": "text", "text": "Describe the content of this image"},
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
]}
]
)
5. 模型路由策略
MODEL_MAP = {
"chat": "qwen3.7-max", # General chat
"code": "qwen3-coder-flash", # Code generation
"reasoning": "deepseek-v4-pro", # Complex reasoning
"vision": "qwen3-vl-plus", # Visual understanding
"fast": "qwen3.7-flash", # Fast response
"translate": "qwen-mt-flash" # Machine translation
}
def route_by_task(task_type: str, message: str) -> str:
model = MODEL_MAP.get(task_type, "qwen3.7-max")
return client.chat(model=model, messages=[{"role": "user", "content": message}])
错误处理
错误会返回带有error 字段的 JSON:
{
"error": {
"code": "model_not_found",
"message": "Model 'xxx' is not available"
}
}
401- 无效或缺失 API key402- 余额不足404- 未找到模型429- 超出速率限制500- 服务器错误
计费
基于 token 的计费因模型而异。当前费率请参阅 aisa.one/models。每个响应均包含usage.cost 与 usage.credits_remaining。
完整 API 参考
完整的端点文档请参阅 API 参考。开始使用
- 在 aisa.one 注册并在控制台中创建 API key。
- 在你的 Shell 中设置:
export AISA_API_KEY="your-key"。 - 使用安装中的命令安装 Skill,然后启动新的智能体会话。
相关
模型目录
AIsa 上的全部模型系列,以及模型 ID 和端点。
AIsa LLM 路由器
跨提供商的通用模型路由。
模型目录
浏览支持的模型 ID。