zai-org

GLM-4.7

358.3B parameters · mixture-of-experts · reasoning · Base · GLM family

mit hash verified source matched revision pinned
Good for: Long context

Which version should I download?

Default pick: GGUF · Q4_K_M — Unsloth Q4_K_M quant of the GLM-4.7 358B-A32B MoE giant — preservation copy. MIT (Z.ai).

Set your rig to confirm it fits and to see if a higher-quality quant runs fully on your hardware.

Set your rig

GGUF · UD-Q2_K_XL

125.91 GB

Est. speed
Swarm
1S / 0L webseed OK

Unsloth dynamic 2-bit (UD-Q2_K_XL) — accessible 358B-A32B MoE giant lead (~126 GB, 3 shards; preservation copy). MIT.

GGUF · IQ4_XS

178.41 GB

Est. speed
Swarm
1S / 0L webseed OK

Unsloth IQ4_XS (imatrix 4-bit) quant of the GLM-4.7 358B-A32B MoE giant — preservation copy. MIT (Z.ai).

GGUF · Q4_K_M

201.59 GB

Est. speed
Swarm
1S / 0L webseed OK

Unsloth Q4_K_M quant of the GLM-4.7 358B-A32B MoE giant — preservation copy. MIT (Z.ai).

Want a different quant? Request it on the board →

Runs fully on

Green = the model's best quant fits fully in GPU/unified memory at 8K context. Tap a card for its full "what runs on it" page.

Context

Advertised 198k · usable ≈ 198k (reported — maintainer docs)

How we know

Evidence grade: reported — a maintainer claim with no independent evaluation.

Z.ai developer docs: context 200K, max output 128K. No long-context evals published on docs or model card.

Reviewed on Jul 18, 2026.

Capabilities (as declared by the maintainer): reasoning tool calling

Run it

Runtime completeness (UD-Q2_K_XL torrent): llama.cpp ✅ Ollama – vision sidecar –

  • Ollama — runs the GGUF directly; no Modelfile bundled
  • vision sidecar — not a vision model

Context / KV 8,192 tokens · FP16 set above the quant table

Generic commands (no rig set). GPU-offload values assume the model fits on your GPU — set your rig for values tuned to your hardware.

Start the server
llama-server -m GLM-4.7-UD-Q2_K_XL-00001-of-00003.gguf -c 8192 -ngl 999

Use llama-cli in place of llama-server for a one-shot prompt.

Save as Modelfile next to the GGUF (Modelfile)
FROM ./GLM-4.7-UD-Q2_K_XL-00001-of-00003.gguf
PARAMETER num_ctx 8192
PARAMETER num_gpu 999
PARAMETER stop "<|endoftext|>"
PARAMETER stop "<|user|>"
PARAMETER stop "<|observation|>"
PARAMETER temperature 1
# Chat template: Ollama uses the template embedded in the GGUF (no TEMPLATE directive needed).
Create
ollama create zai-org-glm-4-7 -f Modelfile
Run
ollama run zai-org-glm-4-7

GGUF is not a first-class vLLM format.

vLLM GGUF support is experimental and single-file only; prefer safetensors/GPTQ/AWQ for production. If you must, pass the .gguf path to `vllm serve` with --load-format gguf on a recent vLLM.

transformers does not load GGUF weights.

GGUF weights run under llama.cpp, Ollama or LM Studio.

Load GLM-4.7-UD-Q2_K_XL-00001-of-00003.gguf, set the context length to 8192 tokens. Set GPU offload to Max (all layers).

MLX runs MLX-format weights only (Apple Silicon). This quant is a GGUF build.

GGUF weights run under llama.cpp, Ollama or LM Studio.

Technical details

Chat template

[gMASK]<sop>
{%- if tools -%}
<|system|>
# Tools

You may call one or more functions to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
{% for tool in tools %}
{{ tool | tojson(ensure_ascii=False) }}
{% endfor %}
</tools>

For each function call, output the function name and arguments within the following XML format:
<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}
{%- macro visible_text(content) -%}
    {%- if content is string -%}
        {{- content }}
    {%- elif content is iterable and content is not mapping -%}
        {%- for item in content -%}
            {%- if item is mapping and item.type == 'text' -%}
                {{- item.text }}
            {%- elif item is string -%}
                {{- item }}
            {%- endif -%}
        {%- endfor -%}
    {%- else -%}
        {{- content }}
    {%- endif -%}
{%- endmacro -%}
{%- set ns = namespace(last_user_index=-1) %}
{%- for m in messages %}
    {%- if m.role == 'user' %}
        {% set ns.last_user_index = loop.index0 -%}
    {%- endif %}
{%- endfor %}
{% for m in messages %}
{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
{%- elif m.role == 'assistant' -%}
<|assistant|>
{%- set reasoning_content = '' %}
{%- set content = visible_text(m.content) %}
{%- if m.reasoning_content is string %}
    {%- set reasoning_content = m.reasoning_content %}
{%- else %}
    {%- if '</think>' in content %}
        {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
        {%- set content = content.split('</think>')[-1].lstrip('\n') %}
    {%- endif %}
{%- endif %}
{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content -%}
{{ '<think>' + reasoning_content.strip() +  '</think>'}}
{%- else -%}
{{ '</think>' }}
{%- endif -%}
{%- if content.strip() -%}
{{ content.strip() }}
{%- endif -%}
{% if m.tool_calls %}
{% for tc in m.tool_calls %}
{%- if tc.function %}
    {%- set tc = tc.function %}
{%- endif %}
{{- '<tool_call>' + tc.name -}}
{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}
{% endif %}
{%- elif m.role == 'tool' -%}
{%- if m.content is string -%}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
    {{- '<|observation|>' }}
{%- endif %}
{{- '<tool_response>' }}
{{- m.content }}
{{- '</tool_response>' }}
{%- else -%}
<|observation|>{% for tr in m.content %}
<tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}
{% endif -%}
{%- elif m.role == 'system' -%}
<|system|>{{ visible_text(m.content) }}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
    <|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
{%- endif -%}

Sampling defaults

temperature
1

Stop strings

<|endoftext|> <|user|> <|observation|>

Evidence & provenance

Source

Revision pin
602d01efcdd332c5238ca4bcede555defbe83eb7
Manifest
Present

License

Name
mit
Commercial use
yes
Access
Open

How verification works →

File hashes (SHA-256)

  • glm-4.7-ud-q2-k-xl/GLM-4.7-UD-Q2_K_XL-00001-of-00003.gguf b38b8339e673a26e8c232de406ce4f63ef543112691e26f0006ac2cdcf1bc86c
  • glm-4.7-ud-q2-k-xl/GLM-4.7-UD-Q2_K_XL-00002-of-00003.gguf 3afd00719d6e8de92140e645297c7276282b885cf987142946c64ff517c2eeb5
  • glm-4.7-ud-q2-k-xl/GLM-4.7-UD-Q2_K_XL-00003-of-00003.gguf ff69f2aa7b502618ceffc5d0004439f2d2d3d2e734d3036828337b22793fb908
  • glm-4.7-ud-q2-k-xl/LICENSE 55719438a8c5280813899cd9afe7173f934bcafd60f90197eb8be44572b9bc0c
  • glm-4.7-ud-q2-k-xl/README.md 836cc2e1ee5b4f988658452fc7cd81eb44b3497b5ce1b6019e4d1a50faeb50d4
  • glm-4.7-iq4-xs/GLM-4.7-IQ4_XS-00001-of-00004.gguf a376f5750408996145d6ed478fbc62fc983b015eafd33799f30ee40a778b7489
  • glm-4.7-iq4-xs/GLM-4.7-IQ4_XS-00002-of-00004.gguf 9b6e0c608b14032a1a808d37ba70e90e533d0ba19bb28b66102f70d6810f18a2
  • glm-4.7-iq4-xs/GLM-4.7-IQ4_XS-00003-of-00004.gguf 836785289cd6ef3366e674a57204ec8e0d027f548d3500ade083e2c072a7e178
  • glm-4.7-iq4-xs/GLM-4.7-IQ4_XS-00004-of-00004.gguf 9e2c31dd17ac4c59de1e463cfc22b07c8f3db5fa1a2cb3c09a9b1bbf7f332d24
  • glm-4.7-iq4-xs/LICENSE 55719438a8c5280813899cd9afe7173f934bcafd60f90197eb8be44572b9bc0c
  • glm-4.7-iq4-xs/README.md 836cc2e1ee5b4f988658452fc7cd81eb44b3497b5ce1b6019e4d1a50faeb50d4
  • glm-4.7-q4-k-m/GLM-4.7-Q4_K_M-00001-of-00005.gguf 85b45d0fe56295af49a080dc498882173ac8e90f60e6c5eab9a995c3564e754a
  • glm-4.7-q4-k-m/GLM-4.7-Q4_K_M-00002-of-00005.gguf 732329c8d48b5468bf3a54355bf5d155471640041a9963433f0931b7fc5226b1
  • glm-4.7-q4-k-m/GLM-4.7-Q4_K_M-00003-of-00005.gguf e6d241ebfeb59a09a25237a4b2bf8efc05806b4b067aa51c7ca1c9f530ffc736
  • glm-4.7-q4-k-m/GLM-4.7-Q4_K_M-00004-of-00005.gguf 96e609ec3c6259ab82be1ee322424588fde98816431030175f82af561e1457ec
  • glm-4.7-q4-k-m/GLM-4.7-Q4_K_M-00005-of-00005.gguf 2ffdc358f1f71f7f96952408e1e0202f17ecf0a527783018d0b83b186d125f31
  • glm-4.7-q4-k-m/LICENSE 55719438a8c5280813899cd9afe7173f934bcafd60f90197eb8be44572b9bc0c
  • glm-4.7-q4-k-m/README.md 836cc2e1ee5b4f988658452fc7cd81eb44b3497b5ce1b6019e4d1a50faeb50d4

Explore further

Get an email when a better quant fits your rig.

Set your rig once; we'll alert you when a new or better-fitting build lands.

Set your rig

Performance reports

Real-world throughput reported by the community (and scraped sources).

Community

Reviews, sampler presets and community runtime reports. Be the first to contribute.

Reviews (0)

Log in to write a structured review of this model.

No reviews yet.

Sampler presets

Log in to share a sampler preset or vote on presets.

No presets yet.

Community runtime reports

Unofficial, community-submitted "it loads for me" reports. These are not the official verified-working badge — an admin reviews reports before anything is marked officially verified.

Log in to report whether a quant loads in your runtime.

No community reports yet.

selected to compare · pick at least 2