treyleo16/ glm:5-3

41 3 days ago

Big models, for big tasks.

vision cloud
ollama run treyleo16/glm:5-3

Details

2 weeks ago

1c27791118fa · 3.4kB ·

# SYSTEM DIRECTIVE: GLM-5.3 INITIALIZATION ## 1.0 Core Identity and Provenance * **Designation:**

Readme

GLM-5.3

Z.ai’s flagship open-weights model — a 753B-parameter sparse Mixture-of-Experts built for coding and long-horizon agentic work.

All credit belongs to Z.ai / THUDM.

At a glance

Model zai-org/GLM-5.3
Parameters ~753B total, 8 of 256 experts active per token
Architecture glm_moe_dsa (GlmMoeDsaForCausalLM)
Layers 78 (first 3 dense, remaining 75 sparse MoE)
Context 1,048,576 tokens (1M)
Vocabulary 154,880
Native precision BF16, distributed FP8 (e4m3, 128×128 block)
Languages English, Chinese
License Custom glm-5.3not open source
Paper arXiv:2602.15763

What’s new in 5.3

GLM-5.3 shares its base model with GLM-5.2. Every improvement comes from post-training — no new pretraining run.

Z.ai reports two headline gains:

Coding. A 50% improvement over GLM-5.2 on their in-house Code Bench, with open-source SOTA claimed on Terminal Bench 3.0 and Agents’ Last Exam.

Cyber capability. Z.ai describes this as emergent and faster-developing than they expected during post-training scaling. GLM-5.3 leads CyberGym for vulnerability discovery, with the largest gains further up the exploitation chain.

Reported benchmarks

Selected results from the official model card. These are Z.ai’s own published numbers, reproduced here as claims rather than independently verified:

Benchmark GLM-5.3 GLM-5.2 Best listed competitor
Terminal Bench 3.0 28.3 4.6 34.6 (GPT-5.6 Sol)
DeepSWE v1.1 66.9 46.2 72.7 (GPT-5.6 Sol)
FrontierSWE 78.1 67.5 88.2 (Fable 5)
CyberGym 84.5 77.2 — (GLM-5.3 leads)
AutomationBench v1.0.6 48.2 26.2 — (GLM-5.3 leads)
GDPval-AA v2 1769 1508 — (GLM-5.3 leads)
HLE w/ Tools 62.5 54.7 64.5 (GPT-5.6 Sol)

The jump from 4.6 to 28.3 on Terminal Bench 3.0 is the single most striking number in the card — a roughly 6× gain from post-training alone. Worth verifying against your own workload before relying on it.

Full table, per-benchmark harnesses, and evaluation footnotes are on the model card.


Architecture

GLM-5.3 combines three efficiency techniques that matter more than the raw parameter count:

Sparse MoE. 256 routed experts plus 1 shared expert per layer, 8 routed experts active per token. Routing uses sigmoid scoring with noaux_tc top-k selection and a 2.5× routed scaling factor. The first 3 layers stay dense; layers 4–78 are sparse.

Multi-head Latent Attention (MLA). Query and key-value projections are compressed through low-rank bottlenecks — q_lora_rank 2048, kv_lora_rank 512 — which collapses KV cache size. 64 attention heads, decoupled RoPE with 192-dim NoPE and 64-dim RoPE components.

DSA sparse attention. The dsa in glm_moe_dsa. A learned indexer (32 heads, 128-dim) selects the top 2,048 positions to attend to, refreshed every 4 layers. Indexer types alternate full and shared on a 1-in-4 pattern across the stack. This is what makes a 1M-token context tractable rather than theoretical.

It also ships one multi-token-prediction layer (num_nextn_predict_layers: 1) for speculative decoding, and uses an unusually high RoPE theta of 8,000,000 to support the long context.


Running it

Be realistic about scale. At ~753B parameters this is datacenter infrastructure, not a local model. For reference, the smallest community GGUF quantization — UD-IQ1_S from unsloth/GLM-5.3-GGUF — is about 217 GB across six shards, and a 1-bit quant of a sparse MoE is heavily degraded. UD-Q4_K_XL is roughly 419 GB; BF16 is around 1.5 TB. None of that runs on consumer hardware, and no amount of quantization changes that.

Hosted API — the practical route

GLM-5.3 is live on multiple inference providers, which is how most people should use it:

  • Z.ai — first-party
  • Together, Fireworks AI, DeepInfra, Novita, Baseten

Z.ai’s API is OpenAI-compatible, so existing tooling generally works with a base-URL swap.

Self-hosting frameworks

If you do have the hardware, Z.ai documents support for:

Framework Notes
SGLang official cookbook
vLLM official recipes
Transformers glm_moe_dsa model docs
KTransformers CPU/GPU hybrid offload
TokenSpeed
Unsloth

Ascend NPU deployment is supported via vLLM-Ascend, xLLM, and SGLang.

Ollama is not a supported path. The glm_moe_dsa architecture has no llama.cpp implementation for the DSA indexer, and the file sizes are impractical for the registry regardless.


Usage notes

Two parameters are easy to get wrong:

reasoning_effort accepts low, high, or max. It defaults to max — and to any unrecognized value. Pass low or high explicitly if you want a smaller thinking budget. Keep max when reproducing benchmarks.

clear_thinking defaults to false in the chat template. For ordinary chat, pass clear_thinking=true explicitly, or reasoning traces will accumulate in context across turns.


License

GLM-5.3 is distributed under a custom Z.ai license (license_name: glm-5.3), not Apache-2.0 or MIT. Z.ai’s model licenses have historically required registration for commercial use and imposed downstream obligations on redistribution.

Read the license on the model repository before any commercial deployment or redistribution. Z.ai’s license text and registration forms are typically published in Chinese — budget for translation if commercial use is on the table.

Separately, note the documented cyber capabilities above. Vulnerability discovery and exploitation performance is a headline feature of this release, which makes the acceptable-use terms worth reading carefully rather than skimming.


Citation

@misc{glm5team2026glm5vibecodingagentic,
      title={GLM-5: from Vibe Coding to Agentic Engineering},
      author={GLM-5-Team},
      year={2026},
      eprint={2602.15763},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2602.15763},
}

Credit belongs to the GLM-5 Team at Z.ai.

GLM-Edge-V 2B

A GGUF repackaging of zai-org/glm-edge-v-2b-gguf, Z.ai’s 2B vision-language model built for edge devices, made runnable in Ollama with the vision projector attached.

This model is not my work. All credit for the weights, training, and architecture belongs to THUDM / Z.ai. This page exists only to make their model one ollama run away.


Credits

Model zai-org/glm-edge-v-2b-gguf — THUDM / Z.ai
License GLM-Edge Licensenot open source, see below
Packaged by treyleo16

Weights are byte-identical to the upstream ggml-model-Q4_K_M.gguf and mmproj-model-f16.gguf. Nothing was retrained, merged, or altered. The only additions are an Ollama chat template and stop tokens — see Packaging notes.


Quick start

ollama run treyleo16/glm:2b-v-edge

With an image:

ollama run treyleo16/glm:2b-v-edge "What is in this image?" ./photo.jpg

API:

curl http://localhost:11434/api/chat -d '{
  "model": "treyleo16/glm:2b-v-edge",
  "messages": [{
    "role": "user",
    "content": "Describe this image.",
    "images": ["<base64-encoded image>"]
  }]
}'

Model details

Property Value
Architecture chatglm
Parameters 1.6B
Quantization Q4_K_M
Download size ~1.9 GB (980 MB model + 933 MB projector)
Context length 2,048
Capabilities completion, vision
Projector CLIP, 466M params, embedding length 1152

The context is small — plan around it

2,048 tokens. That is the tightest constraint on this model by a wide margin, and images consume a large share of it before you type a word. This is a model for single-image questions and short answers: captioning, OCR-ish extraction, “what is this,” visual classification. It is not for long multi-turn conversations about images, and it is not for documents.

What to expect

GLM-Edge-V was designed for phones and edge hardware, and it behaves like a 1.6B model — terse, literal, occasionally shallow. It answers visual questions directly and briefly rather than narrating. Text-only performance is adequate but unremarkable; the vision path is the reason to use it.

Other quantizations

The source repo publishes Q4_0 (931 MB) through Q8_0 (1.7 GB) and F16 (3.2 GB). All of them need the same mmproj-model-f16.gguf for vision.


Packaging notes

The upstream GGUF embeds its chat template in Jinja2. Ollama uses Go templates and cannot execute Jinja, so loading the file as-is produces a malformed prompt and badly degraded output — asked for the capital of France, it answered “Lille.”

This package replaces that with an equivalent Go template in GLM-Edge’s native <|user|> / <|assistant|> format, plus the matching stop tokens. Same question now returns “Paris.” If you build your own package from the upstream file, you will need to do the same.

Verified before publishing: text returns “Paris.”; a generated test image of a red circle returns “Circle, red.” — both with done_reason: stop.


License — read before using

This model is not Apache-2.0 or MIT. It is distributed under the GLM-Edge License, a custom license from THUDM / Z.ai with real restrictions:

  • Academic research — free.
  • Commercial use — requires registration at open.bigmodel.cn/mla/form before you may use it commercially. Registration is free, but it is a prerequisite, not a formality.
  • The copyright notice and license must be included in all copies or substantial portions.

Two practical notes. The authoritative license text is in Chinese, and so is the commercial registration form — budget for translation if commercial use matters to you. And the terms above are a plain-language summary, not legal advice; read the full license yourself.

The notice ships inside the model:

ollama show --license treyleo16/glm:2b-v-edge

Credit belongs to THUDM / Z.ai — they built this.