GLM-4.7-Flash ยท NVFP4A16 (W4A16, FP4 weights)

4-bit quantization of zai-org/GLM-4.7-Flash for vLLM serving. Quantized by axteam.

Base model zai-org/GLM-4.7-Flash
Method NVFP4A16 (W4A16, FP4 weights)
Format compressed-tensors nvfp4-pack-quantized
Weights / activations W4A16 โ€” FP4 (E2M1) weights group 16 + FP8 scale, BF16 activations
Architecture MoE (GLM-4.7 Lite ยท Glm4MoeLite) ยท 31.2B ยท 202K context ยท text-only
Size on disk ~18.9 GB
Calibration None (data-free, name-based model_free_ptq)
License mit

Quantization details

  • Scheme โ€” W4A16 โ€” FP4 (E2M1) weights group 16 + FP8 scale, BF16 activations, stored as compressed-tensors nvfp4-pack-quantized.
  • Kept in BF16 โ€” token embeddings, the LM head, and all RMSNorms. Only attention & MLP projections are quantized. In addition, the MoE router is left unquantized: mlp.gate.weight in BF16 and mlp.gate.e_score_correction_bias in FP32, as in the original. The MTP layer (model.layers.47: eh_proj, shared_head.head) is quantized like the other layers.
  • Post-training quantization (no retraining). Tokenizer / chat_template identical to the original.
  • FP4 global scales are shared across the pairs vLLM fuses โ€” q_a_proj + kv_a_proj_with_mqa (MLA) and gate_proj + up_proj of every routed and shared expert.

Revision 2026-10-31: the first upload of this repo (same day) quantized those pairs with separate global scales. vLLM runs each pair as one GEMM with one scale, so that build produced corrupted text. The weights were re-quantized and replaced; if you downloaded this repo before the fix, please download it again.

Benchmarks (measured)

Every column was measured with the same harness and settings โ€” lm-evaluation-harness on vLLM, greedy, completion-style prompts without a chat template (0- or 5-shot, as listed in each row). MMLU here is lm-eval's generative variant (mmlu_generative: the model writes the answer letter and only an exact match on the first line counts), so it is not directly comparable with MMLU scores measured another way (e.g. log-likelihood scoring). Percentages are recovery vs. the BF16 original.

Benchmark BF16 (original) FP8-dynamic NVFP4A16 (this repo)
MMLU (5-shot, generative) 72.19 71.78 (99.4%) 69.97 (96.9%)
GSM8K (5-shot, strict) 83.70 82.71 (98.8%) 79.83 (95.4%)
ARC-Challenge (0-shot) 57.51 57.51 (100.0%) 55.03 (95.7%)
Winogrande (5-shot) 74.51 73.32 (98.4%) 73.40 (98.5%)
KMMLU (5-shot, direct) 50.04 50.15 (100.2%) 47.38 (94.7%)
HAE-RAE (0-shot) 64.89 63.89 (98.4%) 59.67 (91.9%)
Average 67.14 66.56 (99.1%) 64.21 (95.6%)

โš ๏ธ Note: average recovery is 95.6% โ€” noticeable degradation at this precision; prefer an 8-bit build if quality matters most.

Requirements

Runtime vLLM โ€” the architecture is in vLLM โ‰ฅ 0.15.0; tested here with vLLM 0.32.0.
vLLM install vLLM 0.32 itself needs Python 3.11โ€“3.14, torch 2.13 (CUDA 13.0 build, so an NVIDIA driver with CUDA 13 support), transformers โ‰ฅ5.16.1,<5.20 and compressed-tensors 0.17.0 (both pinned by vLLM; 0.17.0 reads this checkpoint, which was saved with 0.19.0 โ€” do not upgrade it separately).
GPU NVIDIA Turing (sm75) or newer โ€” weight-only FP4, no FP4 tensor cores needed. V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.)
Memory Weights: 18.9 GB. Add KV cache (grows with context length ร— concurrent requests) and a few GB for activations / CUDA graphs; use --tensor-parallel-size N when the weights do not fit one GPU.
Transformers (without vLLM) Not loadable correctly by Transformers (checked up to 5.22.1) โ€” use vLLM.
trust_remote_code not needed

Usage (vLLM)

Start an OpenAI-compatible server:

vllm serve axteam/GLM-4.7-Flash-NVFP4A16 --max-model-len 32768

Query it:

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "axteam/GLM-4.7-Flash-NVFP4A16",
  "messages": [{"role": "user", "content": "๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์ˆ˜๋„๋Š” ์–ด๋””์ธ๊ฐ€์š”?"}],
  "temperature": 1.0, "max_tokens": 512
}'

Offline inference in Python:

from vllm import LLM, SamplingParams

llm = LLM(model="axteam/GLM-4.7-Flash-NVFP4A16", max_model_len=32768)
params = SamplingParams(temperature=1.0, max_tokens=1024)
out = llm.chat([{"role": "user", "content": "Explain model quantization in two sentences."}], params)
print(out[0].outputs[0].text)

Recommended sampling (from the original generation_config.json): temperature=1.0. Thinking mode is on by default in the chat template; to turn it off pass chat_template_kwargs={"enable_thinking": False} (Python llm.chat(..., chat_template_kwargs=...), or "chat_template_kwargs": {"enable_thinking": false} in the request body).

Reducing KV-cache memory (optional, serve-time)

The KV cache is kept in BF16 by default. KV-cache precision is a runtime choice, independent of the weight quantization above; for long contexts or large batches FP8 roughly halves KV-cache memory:

vllm serve axteam/GLM-4.7-Flash-NVFP4A16 --kv-cache-dtype fp8

License

Quantized derivative of zai-org/GLM-4.7-Flash (mit).


ํ•œ๊ตญ์–ด ์š”์•ฝ

zai-org/GLM-4.7-Flash์˜ NVFP4A16 (W4A16) ์–‘์žํ™” ๋นŒ๋“œ ยท ์ œ์ž‘ axteam

๊ฐœ์š”

ํ•ญ๋ชฉ ๋‚ด์šฉ
์›๋ณธ ๋ชจ๋ธ zai-org/GLM-4.7-Flash
์–‘์žํ™” ๋ฐฉ์‹ NVFP4A16 (W4A16, FP4 ๊ฐ€์ค‘์น˜)
์ €์žฅ ํ˜•์‹ compressed-tensors nvfp4-pack-quantized
๋ชจ๋ธ ๊ตฌ์กฐ MoE (GLM-4.7 Lite, Glm4MoeLite) ยท 31.2B ยท ์ปจํ…์ŠคํŠธ 202K ยท ํ…์ŠคํŠธ ์ „์šฉ
์šฉ๋Ÿ‰ ์•ฝ 18.9 GB
๋ณด์ • ๋ฐ์ดํ„ฐ ์—†์Œ (๊ฐ€์ค‘์น˜๋งŒ์œผ๋กœ ์Šค์ผ€์ผ ๊ณ„์‚ฐ, ์ด๋ฆ„ ๊ธฐ๋ฐ˜ model_free_ptq)

์–‘์žํ™” ์ƒ์„ธ

  • ๊ฐ€์ค‘์น˜: FP4(E2M1), ๊ทธ๋ฃน ํฌ๊ธฐ 16 + ๊ทธ๋ฃน๋ณ„ FP8 ์Šค์ผ€์ผ (์•„๋ž˜ ๊ฒฐํ•ฉ ์Œ์€ ์ „์—ญ ์Šค์ผ€์ผ ๊ณต์œ )
  • ํ™œ์„ฑํ™”: BF16 (์–‘์žํ™”ํ•˜์ง€ ์•Š์Œ)
  • ์–‘์žํ™” ์ ˆ์ฐจ: PTQ(ํ•™์Šต ํ›„ ์–‘์žํ™”, ์žฌํ•™์Šต ์—†์Œ), ๋ณด์ • ๋ฐ์ดํ„ฐ ์—†์ด ๊ฐ€์ค‘์น˜๋งŒ์œผ๋กœ ์Šค์ผ€์ผ์„ ์ •ํ•ด ๋ฐ˜์˜ฌ๋ฆผ(RTN)
  • BF16 ์œ ์ง€: ํ† ํฐ ์ž„๋ฒ ๋”ฉ, LM ํ—ค๋“œ, ๋ชจ๋“  RMSNorm, MoE ๋ผ์šฐํ„ฐ ๊ฐ€์ค‘์น˜(mlp.gate.weight)
  • FP32 ์œ ์ง€: MoE ๋ผ์šฐํ„ฐ ๋ณด์ • ํŽธํ–ฅ(mlp.gate.e_score_correction_bias), ์›๋ณธ๊ณผ ๋™์ผ
  • ์–‘์žํ™” ๋Œ€์ƒ: ์–ดํ…์…˜ยทMLP ์„ ํ˜•์ธต(projection) (MTP ์ธต model.layers.47๋„ ๋‹ค๋ฅธ ์ธต๊ณผ ๊ฐ™์ด ์–‘์žํ™”)
  • ์ „์—ญ ์Šค์ผ€์ผ ๊ณต์œ : vLLM์ด ํ•œ GEMM์œผ๋กœ ํ•ฉ์ณ ๊ณ„์‚ฐํ•˜๋Š” ์Œ(MLA q_a_proj+kv_a_proj_with_mqa, ๋ชจ๋“  ๋ผ์šฐํŒ… ๋Œ€์ƒ ์ „๋ฌธ๊ฐ€(routed expert)ยท๊ณต์œ  ์ „๋ฌธ๊ฐ€์˜ gate_proj+up_proj)์€ FP4 ์ „์—ญ ์Šค์ผ€์ผ ํ•˜๋‚˜๋ฅผ ๊ณต์œ 
  • ์›๋ณธ ํŒŒ์ผ: ํ† ํฌ๋‚˜์ด์ €ยทchat template์€ ์›๋ณธ๊ณผ ๋™์ผ

ํ’ˆ์งˆ (์‹ค์ธก)

  • ๋ฒค์น˜๋งˆํฌ ํ‰๊ท : 64.21 (์›๋ณธ 67.14, 95.6%) โ€” MMLU(์ƒ์„ฑํ˜•)ยทGSM8KยทARC-ChallengeยทWinograndeยทKMMLUยทHAE-RAE 6์ข… ํ‰๊ท , lm-evaluation-harness + vLLM, chat template ์—†๋Š” ์™„์„ฑํ˜• ํ”„๋กฌํ”„ํŠธ(๊ณผ์ œ๋ณ„ 0ยท5-shot, ํ‘œ ์ฐธ๊ณ )ยทgreedy, ๋ชจ๋“  ๋นŒ๋“œ๋ฅผ ๊ฐ™์€ ์„ค์ •์œผ๋กœ ์ธก์ •
  • ํ•œ๊ตญ์–ด ๋ฒค์น˜๋งˆํฌ: KMMLU 47.38 (์›๋ณธ 50.04, 94.7%) ยท HAE-RAE 59.67 (์›๋ณธ 64.89, 91.9%)
  • MMLU ๋ฐฉ์‹: lm-eval ์ƒ์„ฑํ˜• ๋ณ€ํ˜•(mmlu_generative) โ€” ๋ชจ๋ธ์ด ๋‹ต ๊ธ€์ž๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์ฒซ ์ค„์ด ์ •ํ™•ํžˆ ์ผ์น˜ํ•ด์•ผ ์ •๋‹ต์œผ๋กœ ์ฑ„์ ํ•˜๋ฏ€๋กœ, ๋‹ค๋ฅธ ๋ฐฉ์‹(์˜ˆ: log-likelihood ์ฑ„์ )์œผ๋กœ ์žฐ MMLU ์ ์ˆ˜์™€ ์ง์ ‘ ๋น„๊ต ๋ถˆ๊ฐ€
  • ์ฃผ์˜: โš ๏ธ ์ด ์ •๋ฐ€๋„์—์„œ ํ’ˆ์งˆ ์ €ํ•˜๊ฐ€ ๋šœ๋ ทํ•จ (๋ฒค์น˜๋งˆํฌ ํ‰๊ท  ์›๋ณธ ๋Œ€๋น„ 95.6%) โ€” ํ’ˆ์งˆ์ด ์ค‘์š”ํ•˜๋ฉด 8๋น„ํŠธ ๋นŒ๋“œ(axteam/GLM-4.7-Flash-FP8-dynamic) ๊ถŒ์žฅ

์š”๊ตฌ์‚ฌํ•ญ

  • ์‹คํ–‰ ์—”์ง„: vLLM 0.15.0 ์ด์ƒ(์ด ๊ตฌ์กฐ๋ฅผ ์ง€์›ํ•˜๋Š” ์ฒซ ๋ฒ„์ „), ์ด ๋นŒ๋“œ๋Š” vLLM 0.32.0์—์„œ ์‹คํ–‰ ํ™•์ธ
  • vLLM 0.32 ์„ค์น˜ ์กฐ๊ฑด: Python 3.11~3.14, torch 2.13(CUDA 13.0 ๋นŒ๋“œ, CUDA 13 ์ง€์› ๋“œ๋ผ์ด๋ฒ„ ํ•„์š”), transformers 5.16.1 ์ด์ƒ 5.20 ๋ฏธ๋งŒ, compressed-tensors 0.17.0 โ€” transformersยทcompressed-tensors๋Š” vLLM์ด ๋ฒ„์ „์„ ๊ณ ์ •ํ•˜๋ฏ€๋กœ compressed-tensors๋ฅผ ๋”ฐ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜์ง€ ๋ง ๊ฒƒ (์ด ์ฒดํฌํฌ์ธํŠธ๋Š” 0.19.0์œผ๋กœ ์ €์žฅ๋์ง€๋งŒ 0.17.0์—์„œ๋„ ๋กœ๋“œ๋จ)
  • GPU: NVIDIA Turing(sm75) ์ด์ƒ, V100(sm70) ๋ฏธ์ง€์› โ€” ๊ฐ€์ค‘์น˜ ์ „์šฉ FP4๋ผ FP4 ์ „์šฉ ํ…์„œ์ฝ”์–ด ๋ถˆํ•„์š” (GPU๋ณ„ ์ง€์› ์—ฌ๋ถ€๋Š” vLLM 0.32 ์ปค๋„ ์„ ํƒ ์ฝ”๋“œ ๊ธฐ์ค€, ์‹ค์ œ ์‹คํ–‰์€ B200์—์„œ๋งŒ ํ™•์ธ)
  • ๋ฉ”๋ชจ๋ฆฌ: ๊ฐ€์ค‘์น˜ 18.9 GB + KV ์บ์‹œ(์ปจํ…์ŠคํŠธ ๊ธธ์ด ร— ๋™์‹œ ์š”์ฒญ ์ˆ˜์— ๋น„๋ก€) + ํ™œ์„ฑํ™”ยทCUDA graph์šฉ ์ˆ˜ GB โ€” GPU ํ•œ ์žฅ์— ๋‹ค ๋“ค์–ด๊ฐ€์ง€ ์•Š์œผ๋ฉด --tensor-parallel-size N์œผ๋กœ ๋ถ„์‚ฐ
  • Transformers๋กœ ์ง์ ‘ ์‚ฌ์šฉ: ๋ถˆ๊ฐ€ โ€” 5.22.1๊นŒ์ง€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋กœ๋“œ๋˜์ง€ ์•Š์Œ ํ™•์ธ, vLLM ์‚ฌ์šฉ
  • trust_remote_code: ๋ถˆํ•„์š”

์‚ฌ์šฉ๋ฒ•

  • ์„œ๋ฒ„ ์‹คํ–‰: vllm serve axteam/GLM-4.7-Flash-NVFP4A16 --max-model-len 32768 โ€” OpenAI ํ˜ธํ™˜ API
  • Python: LLM(model="axteam/GLM-4.7-Flash-NVFP4A16", max_model_len=32768).chat(...) โ€” ์ „์ฒด ์˜ˆ์‹œ๋Š” ์œ„ ์˜์–ด ๋ณธ๋ฌธ 'Usage (vLLM)' ์ ˆ ์ฐธ๊ณ 
  • ๊ถŒ์žฅ ์ƒ˜ํ”Œ๋ง: temperature=1.0 (์›๋ณธ generation_config.json ๊ธฐ์ค€)
  • thinking ๋ชจ๋“œ: ๊ธฐ๋ณธ ์ผœ์ง โ€” ๋„๋ ค๋ฉด chat_template_kwargs={"enable_thinking": False} ์ „๋‹ฌ(Python์€ llm.chat() ์ธ์ž, HTTP๋Š” ์š”์ฒญ ๋ณธ๋ฌธ์˜ "chat_template_kwargs": {"enable_thinking": false})
  • KV ์บ์‹œ ์ ˆ๊ฐ(์„ ํƒ): vllm serve์— --kv-cache-dtype fp8 ์ถ”๊ฐ€ โ€” ๊ธฐ๋ณธ BF16์ธ KV ์บ์‹œ๋ฅผ FP8๋กœ ์ €์žฅํ•ด KV ์บ์‹œ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์•ฝ ์ ˆ๋ฐ˜์œผ๋กœ ์ค„์ž„ (๊ธด ์ปจํ…์ŠคํŠธยท๋™์‹œ ์š”์ฒญ์ด ๋งŽ์„ ๋•Œ ์œ ๋ฆฌ, ๊ฐ€์ค‘์น˜ ์–‘์žํ™”์™€ ๋ณ„๊ฐœ์ธ ์‹คํ–‰ ์˜ต์…˜)

์ฐธ๊ณ 

  • ์ˆ˜์ • ์ด๋ ฅ (2026-10-31): ์ฒ˜์Œ ์˜ฌ๋ฆฐ ๋นŒ๋“œ๋Š” vLLM์ด ํ•œ GEMM์œผ๋กœ ๊ณ„์‚ฐํ•˜๋Š” ๊ฐ€์ค‘์น˜ ์Œ์˜ FP4 ์ „์—ญ ์Šค์ผ€์ผ์ด ์„œ๋กœ ๋‹ฌ๋ผ ์ถœ๋ ฅ์ด ๊นจ์กŒ์Œ โ€” ๋‹ค์‹œ ์–‘์žํ™”ํ•ด ๊ต์ฒด, ์ด์ „์— ๋ฐ›์•˜๋‹ค๋ฉด ๋‹ค์‹œ ๋ฐ›์„ ๊ฒƒ

๋ผ์ด์„ ์Šค

  • ๋ผ์ด์„ ์Šค: MIT โ€” ์›๋ณธ ๋ชจ๋ธ์˜ ๋ผ์ด์„ ์Šค๋ฅผ ๊ทธ๋Œ€๋กœ ๋”ฐ๋ฆ„
  • ๊ถŒ๋ฆฌ: ์›๋ณธ ๋ชจ๋ธ์˜ ๊ถŒ๋ฆฌ๋Š” Z.ai์—๊ฒŒ ์žˆ์Œ, ์ด ๋ฆฌํฌ๋Š” ์–‘์žํ™” ํŒŒ์ƒ๋ฌผ
Downloads last month
1,242
Safetensors
Model size
31B params
Tensor type
F32
ยท
BF16
ยท
U8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for axteam/GLM-4.7-Flash-NVFP4A16

Quantized
(111)
this model