GLM-5.1
GLM-5.1
模型代码:glm-5.1
技术规格
| 项目 | 规格 |
|---|---|
| 模型参数 | 7540亿(MoE架构,激活约400亿参数) |
| 训练数据 | 28.5万亿 Tokens |
| 上下文长度 | 200K |
| 最大输出 Token | 128K(约 131,072 tokens) |
| 支持语言 | 中文, 英文, 多语言 |
| 多模态能力 | ✗ 不支持 |
核心能力
- 自主长时任务处理(单次最长8小时)
- 数百次迭代循环
- 代码能力极大增强(SWE-Bench Pro领先)
- 高情商高智商交互
- 多种思考模式
API 示例
Python
from openai import OpenAI
client = OpenAI(
base_url="https://openapi.youdao.com/llmgateway/api/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="glm-5.1",
messages=[
{"role": "user", "content": "你好,请介绍一下你自己"}
],
stream=False
)
print(response.choices[0].message.content)
JavaScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://openapi.youdao.com/llmgateway/api/v1",
apiKey: "YOUR_API_KEY",
});
async function chat() {
const response = await client.chat.completions.create({
model: "glm-5.1",
messages: [
{ role: "user", content: "你好,请介绍一下你自己" }
],
});
console.log(response.choices[0].message.content);
}
chat();
cURL
curl https://openapi.youdao.com/llmgateway/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "glm-5.1",
"messages": [
{"role": "system", "content": "你是人工智能助手"},
{"role": "user", "content": "你是谁?"}
],
"stream": false
}'