GLM-5

Dataset & Model

zai-org/GLM-5

GLM-5 is a family of large language models for long-horizon agentic tasks.

Overview

GLM-5 series includes versions 5, 5.1, and 5.2 with up to 744B parameters. It targets complex systems engineering and long-horizon agentic tasks, featuring solid 1M token context and advanced coding capabilities. The model achieves state-of-the-art performance on coding and agentic benchmarks.

README Preview

# 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

FAQ (3)

Troubleshooting
Why does GLM-5.1 switch to Chinese during English conversations, and how can I prevent it?

This is a known language-anchoring issue in GLM-5.1: Chinese-associated entities such as Chinese company names, products, or .cn domains can trigger Chinese output, and unprompted switches can also occur. There is no complete model-side fix in the reported issue. As a partial workaround, add an explicit rule at the top of the system prompt, for example: Always respond in English only. Do not output Chinese or any other language, even when discussing Chinese companies, products, domains, or sources. This reduces but may not completely eliminate the switches.

GitHub Issue #54
Troubleshooting
Why does GLM-5.3-Flash repeat "Hmm" in reasoning_content, and how can I filter it?

This is a model/weights-level reasoning-style behavior: GLM-5.3-Flash can overgenerate reflection fillers such as "Hmm" in choices[0].message.reasoning_content, including clusters like "Hmm hmm hmm". It is not necessarily caused by the client or prompt. Verify directly with an OpenAI-compatible request that enables thinking and inspect reasoning_content.

As a temporary client-side workaround, sanitize the reasoning trace before displaying it, without modifying message.content. Example:

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)

No official model-side fix or configuration change is provided in the issue; the permanent resolution requires updated model weights or vendor-side generation handling.

GitHub Issue #146
Troubleshooting
How do I fix the chat saying no PDF is attached even though I uploaded a PDF created from images?

Re-upload the PDF using the paperclip (📎) icon in the message input, select the file from your device, and wait until the file appears in the chat composer before pressing send. If no attachment preview or file chip appears, the upload did not complete. Verify that the PDF opens correctly on your device, then retry the upload.

GitHub Issue #156