GLM-5 Model Series Documentation

repository·main·Indexed 27 days ago

https://github.com/zai-org/glm-5

Documentation for the GLM-5 series of large-scale models (including GLM-5.2, 5.1, and 5), featuring 744B parameters (40B active) and context windows up to 1M tokens. Covers local deployment via SGLang, vLLM, Transformers, KTransformers, and Unsloth, as well as Ascend NPU optimization. Includes guides for fine-tuning with Slime and ms-swift, configuring reasoning effort and thinking behavior, and installing GLM ecosystem skills via Clawhub.

Tokens
2.2K
Snippets
4
Records
14
Agent score
91%

What's inside GLM-5

  1. Deploy GLM-5 series models locally

    main

    The GLM-5 series supports deployment across several inference frameworks:

    • SGLang (v0.5.13.post1+)
    • vLLM (v0.23.0+)
    • Transformers (v0.5.12+)
    • KTransformers (v0.5.12+)
    • Unsloth (v0.1.47-beta+)
    • Ascend NPU: Supports vLLM-Ascend, xLLM, and SGLang.
  2. Deploy GLM-5.2 on Ascend NPU using vLLM

    main
    To deploy GLM-5.2 on the Ascend platform using vLLM, use the vLLM-Ascend plugin. This deployment method supports feature configuration, environment preparation, single-node and multi-node deployment, and Prefill-Decode disaggregation. For detailed verification steps including accuracy and performance evaluation, refer to the official vLLM-Ascend documentation.
  3. Fine-tune GLM-5 series models

    main

    You can fine-tune GLM-5 series models using the following frameworks:

    • Slime (v0.3.0+): An asynchronous RL infrastructure used by the GLM team.
    • ms-swift (v4.4.0+): Supports SFT, PPO, and GRPO.
  4. Download GLM-5 series models

    main

    The GLM-5 series models (GLM-5.2, GLM-5.1, and GLM-5) are available for download in both BF16 and FP8 precisions via Hugging Face and ModelScope. All models in this series have a parameter scale of 744B with 40B active parameters (744B-A40B).

    | 模型        | 下载链接                                                                                             |
    |-------------|------------------------------------------------------------------------------------------------------|
    | GLM-5.2     | [🤗 Hugging Face](https://huggingface.co/zai-org/GLM-5.2)<br> [🤖 ModelScope](https://modelscope.cn/models/ZhipuAI/GLM-5.2)         |
    | GLM-5.2-FP8 | [🤗 Hugging Face](https://huggingface.co/zai-org/GLM-5.2-FP8)<br> [🤖 ModelScope](https://modelscope.cn/models/ZhipuAI/GLM-5.2-FP8) |
    | GLM-5.1     | [🤗 Hugging Face](https://huggingface.co/zai-org/GLM-5.1)<br> [🤖 ModelScope](https://modelscope.cn/models/ZhipuAI/GLM-5.1)         |
    | GLM-5.1-FP8 | [🤗 Hugging Face](https://huggingface.co/zai-org/GLM-5.1-FP8)<br> [🤖 ModelScope](https://modelscope.cn/models/ZhipuAI/GLM-5.1-FP8) |
    | GLM-5       | [🤗 Hugging Face](https://huggingface.co/zai-org/GLM-5)<br> [🤖 ModelScope](https://modelscope.cn/models/ZhipuAI/GLM-5)             |
    | GLM-5-FP8   | [🤗 Hugging Face](https://huggingface.co/zai-org/GLM-5-FP8)<br> [🤖 ModelScope](https://modelscope.cn/models/ZhipuAI/GLM-5-FP8)   |
  5. Serve GLM-5 series models locally

    main

    The GLM-5 series supports local deployment using several inference frameworks. Ensure you use the minimum required versions listed below:

    • SGLang (v0.5.13.post1+)
    • vLLM (v0.23.0+)
    • Transformers (v0.5.12+)
    • KTransformers (v0.5.12+)
    • Unsloth (v0.1.47-beta+)
    • Ascend NPU: Supported via vLLM-Ascend, xLLM, and SGLang.
  6. Install GLM skills via Clawhub

    main

    The recommended way to install GLM ecosystem skills is using npx clawhub. You can install individual skills or multiple skills in a single command.

    Individual installation: npx clawhub@latest install <skill-name>

    Batch installation: npx clawhub@latest install <skill1> <skill2> ...

    npx clawhub@latest install glmocr
    npx clawhub@latest install glmv-caption
    npx clawhub@latest install glm-image-generation
    
    # Batch installation example
    npx clawhub@latest install glmocr glmocr-table glmocr-formula glmocr-handwriting glm-image-generation glmv-caption glmv-prompt-gen glmv-resume-screen glmv-grounding glmv-doc-based-writing glmv-pdf-to-ppt glmv-pdf-to-web glmv-prd-to-app glmv-web-replication
  7. Install GLM skills from GitHub source

    main

    If clawhub is rate-limited (e.g., receiving Rate limit exceeded errors), you can install skills directly from their official GitHub repositories.

    1. Identify the correct repository from the Official Skills Catalog.
    2. Clone the repository: git clone https://github.com/zai-org/<REPO>.git
    3. Follow the specific SKILL.md instructions within that repository for setup.
    git clone https://github.com/zai-org/<REPO>.git
  8. Configure the ZHIPU_API_KEY environment variable

    main

    Most downstream GLM skills require a Zhipu AI API key to function. You must set this via the ZHIPU_API_KEY environment variable.

    Steps:

    1. Obtain a key from bigmodel.cn.
    2. Export the key in your current shell session or add it to your shell profile (e.g., ~/.zshrc).

    Security Note: Never hardcode the key in source files. Use a .env file and ensure it is included in your .gitignore.

    export ZHIPU_API_KEY="your_key"
  9. Control reasoning effort in GLM-5

    main

    GLM-5 supports controlling the model's thinking intensity via the reasoning_effort parameter.

    • max (Default): Provides maximum performance. If reasoning_effort is not set or set to any value other than high, the model runs in Max mode.
    • high: Explicitly required to use the High tier. Use reasoning_effort="high" to enable this.

    To completely disable thinking, set enable_thinking=false.

  10. Configure reasoning effort and thinking in GLM-5

    main

    GLM-5 models allow you to control the 'thinking' behavior via two parameters:

    • reasoning_effort: Controls the thinking budget.
      • max: The default level. If unset or set to any value other than high, the model runs at Max.
      • high: Explicitly pass reasoning_effort="high" to use the High level.
    • enable_thinking: Set to false to turn off thinking entirely.