项目简介
GLM-5 系列包含 5、5.1 和 5.2 版本,参数量高达 744B。面向复杂系统工程和长期智能体任务,支持 1M token 上下文,编码能力强大。在编码和智能体基准测试中达到最优水平。
README 预览
# GLM-5.2 & GLM-5.1 & GLM-5\n\n\n\n\n\n 👋 Join our Wechat or Discord community.\n \n 📖 Check out the GLM-5.2 blog and GLM-5 Technical report.\n \n 📍 Use GLM-5.2 API services on Z.ai API Platform. \n \n 🔜 Try GLM-5.2 at z.ai.\n\n\n## Introduction\n\n### GLM-5.2\n\nGLM-5.2, our latest flagship model for long-horizon tasks. It marks a substantial leap in long-horizon task capability over its predecessor GLM-5.1 and, for the first time, delivers that capability on a **solid 1M-token context**. \n\nGLM-5.2's new capabilities include:\n- **Solid 1M Context:** A solid 1M-token context that stably sustains long-horizon work\n- **Advanced Coding with Flexible Effort**: Stronger coding capabilities with multiple thinking effort levels to balance performance and latency\n- **Improved Architecture**: We propose [IndexShare](https://arxiv.org/abs/2603.12201), which reuses the same indexer across every four sparse attention layers, reducing per-token FLOPs by 2.9× at a 1M context length. We also improve GLM-5.2’s MTP layer for speculative decoding, increasing the acceptance length by up to 20%\n\n\n\nOn standard coding benchmarks, GLM-5.2 is the strongest open-source model, improving on GLM-5.1 by a wide margin: 81.0 vs. 62.0 on Terminal-Bench 2.1 and 62.1 vs. 58.4 on SWE-bench Pro. It also closes much of the gap to the closed-source frontier — on Terminal-Bench 2.1 (81.0) it lands within a few points of Claude Opus 4.8 (85.0) — while staying ahead of Gemini 3.1 Pro.\n\nFor more detail, check our [blog](https://z.ai/blog/glm-5.2).\n\n### GLM-5.1\n\nGLM-5.1 is our next-generation flagship model for agentic engineering, with significantly stronger coding capabilities than its predecessor. It achieves state-of-the-art performance on SWE-Bench Pro and leads GLM-5 by a wide margin on NL2Repo (repo generation) and Terminal-Bench 2.0 (real-world terminal tasks).\n\n\n\nBut the most meaningful leap goes beyond first-pass performance. Previous models—including GLM
常见问题 (3)
故障排除为什么 GLM-5.1 在英文对话中会切换到中文?我该如何防止这种情况?
这是 GLM-5.1 中一个已知的语言锚定问题:与中国相关的实体(如中国公司名称、产品或 .cn 域名)可能触发中文输出,也可能出现无提示的语言切换。在所报告的问题中,目前尚无完整的模型侧修复方案。作为一种部分缓解的变通方法,可以在系统提示词的顶部添加一条明确的规则,例如:Always respond in English only. Do not output Chinese or any other language, even when discussing Chinese companies, products, domains, or sources. 这可以减少语言切换,但可能无法完全消除。
故障排除为什么 GLM-5.3-Flash 会在 reasoning_content 中重复输出 "Hmm",以及我该如何过滤它?
这是一种模型/权重层面的推理风格行为:GLM-5.3-Flash 可能会在 choices[0].message.reasoning_content 中过度生成反思性填充词,例如 "Hmm",包括 "Hmm hmm hmm" 这样的连续重复。这不一定是由客户端或提示词引起的。请直接通过启用 thinking 的 OpenAI 兼容请求进行验证,并检查 reasoning_content。
作为临时的客户端变通方案,可以在显示之前对推理内容进行清理,而不修改 message.content。示例:
import re
def clean_reasoning(text: str) -> str:
text = re.sub(r'(?i)(?:\bhmm?[\s,.!?-]*){2,}', '', text)
text = re.sub(r'\s+', ' ', text)
return text.strip()
reasoning = response["choices"][0]["message"].get("reasoning_content", "")
shown = clean_reasoning(reasoning)
该 issue 中未提供官方的模型端修复或配置更改;永久解决方案需要更新模型权重或由供应商端处理生成逻辑。
故障排除我上传了一个由图片创建的 PDF,但聊天却提示未附加 PDF,该如何解决?
请使用消息输入框中的回形针(📎)图标重新上传 PDF,从您的设备中选择文件,并等待文件出现在聊天编辑器中后再点击发送。如果未出现附件预览或文件标签,则说明上传未完成。请确认 PDF 能在您的设备上正常打开,然后重试上传。