# GLM-5

> Open-weights LLM family from Z.ai built for coding and long-running agent tasks

- Repository: https://github.com/zai-org/GLM-5
- Category: Models & local AI
- Stars: 7,373 · Forks: 993 · Language: n/a · License: Apache-2.0
- Experience: Advanced
- Page: https://ir.adyog.com/repos/zai-org/glm-5/

This repo is a hub, not a code library. It describes the GLM-5 series of large language models from Z.ai and points to the weights on Hugging Face and ModelScope. The models are aimed at coding and long-horizon agent work, where a model has to plan, call tools and keep going for many steps.

The flagship models are mixture-of-experts: 744B total parameters with 40B active per token. GLM-5.3-Flash is a smaller 320B model with 18B active, and uses a mix of sparse and linear attention to cut the cost of long contexts. GLM-5.2 supports a 1M-token context. Each model comes in FP8 and BF16 precision, so you can trade memory for fidelity.

The README gives benchmark numbers, but they come from the authors, so treat them as claims to check. The practical content is the serving list (SGLang, vLLM, Transformers, KTransformers, Unsloth, Ascend NPU) and the fine-tuning options (slime, ms-swift). You can also skip the self-hosting and use the models through the Z.ai API.

## What it does

- **Several model sizes and precisions**: GLM-5, 5.1, 5.2 and 5.3 are 744B-A40B models. GLM-5.3-Flash is 320B-A18B. Most come in FP8 and BF16 versions.
- **Long context**: GLM-5.2 is described as handling a 1M-token context. GLM-5.3-Flash combines sparse and linear attention to lower long-context serving costs.
- **Adjustable thinking effort**: GLM-5.3 and 5.3-Flash take a reasoning_effort setting of low, high or max, defaulting to max. GLM-5.2 accepts only high and max.
- **Many ways to serve locally**: The README links guides for SGLang, vLLM, Transformers, KTransformers and Unsloth. It also covers Ascend NPU deployment.
- **Fine-tuning support**: Slime (v0.3.0+) is the reinforcement learning framework the GLM team uses. ms-swift (v4.4.0+) supports SFT, PPO and GRPO.

## What you could build

- Run an open-weights coding model on your own GPU cluster with vLLM or SGLang.
- Call GLM-5.3 through the Z.ai API to power a coding agent or terminal assistant.
- Fine-tune the model on your own data with ms-swift using SFT, PPO or GRPO.
- Test long-context tasks, such as reading a large codebase, with GLM-5.2's 1M-token window.
- Compare GLM-5.3 against other open and closed models on your own agent benchmarks.

## Who it's for

Suits ML engineers and teams who want to self-host or fine-tune a large open model, and developers who just want to try it through the API; self-hosting the full models needs serious GPU hardware and some inference-server experience.

## Get started

The README gives no install commands. Pick a model from the download table on Hugging Face or ModelScope, then follow the SGLang, vLLM or other cookbook linked for that model. If you don't have the hardware, use the Z.ai API or the z.ai site instead. When chatting, pass clear_thinking=true as the README advises.



Tags: llm, open-weights, coding, agents, long-context
