Downloads · 30 days
744
3% of all-time downloads
GadflyII/GLM-4.7-Flash-MTP-NVFP4
GLM-4.7-Flash-MTP-NVFP4 is a text generation model from GadflyII. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
https://github.com/Gadflyii/vllm/tree/main
Downloads · 30 days
744
3% of all-time downloads
All-time downloads
23K
Public
Parameters
18.6B
20.9 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors20.9 GB · 100%
How the weights are stored.
U814.4B · 78%
From the Hugging Face model README
https://github.com/Gadflyii/vllm/tree/main
This is a mixed precision NVFP4 quantization of zai-org/GLM-4.7-Flash, a 30B-A3B (30B total, 3B active) Mixture-of-Experts model. This version preserves MTP (Multi-Token Prediction) layers in BF16 for speculative decoding compatibility.
| Feature | GLM-4.7-Flash-NVFP4 | This Model |
|---|---|---|
| MTP Layers | NVFP4 | BF16 |
| Calibration Samples | 128 | 512 |
| Calibration Seq Length | 2048 | 4096 |
| MMLU-Pro Accuracy | 23.56% | 23.91% |
This model uses mixed precision to preserve accuracy and MTP functionality:
| Component | Precision | Rationale |
|---|---|---|
| MLP Experts | FP4 (E2M1) | 64 routed experts, 4 active per token |
| Dense MLP | FP4 (E2M1) | First layer dense MLP |
| Attention (MLA) | BF16 | Low-rank compressed Q/KV projections are sensitive |
| MTP Layers | BF16 | eh_proj, shared_head.head for speculative decoding |
| Norms, Gates, Embeddings | BF16 | Standard practice |
| Metric | BF16 | NVFP4 | This Model |
|---|---|---|---|
| MMLU-Pro | 24.83% | 23.56% | 23.91% |
| Size | 62.4 GB | 20.4 GB | 20.9 GB |
| Compression | 1x | 3.1x | 3.0x |
| Accuracy Loss | - | -1.27% | -0.92% |
| Model | Acceptance Rate | Mean Accepted Length |
|---|---|---|
| BF16 (baseline) | 60% | 1.60 |
| This Model | 63% | 1.63 |
MTP quality is preserved (actually slightly improved) after quantization.
MTP speculative decoding currently shows overhead rather than speedup due to missing torch.compile support for the MTP drafter model in vLLM. For best throughput, run without MTP enabled until this is resolved upstream.
| Configuration | Tokens/sec |
|---|---|
| Without MTP | 78.1 tok/s |
| With MTP (1 token) | 64.7 tok/s |
| With MTP (2 tokens) | 56.8 tok/s |
| With MTP (4 tokens) | 44.5 tok/s |
glm4_moe_lite architecture)pip install vllm>=0.8.0
pip install git+https://github.com/huggingface/transformers.git
from vllm import LLM, SamplingParams
model = LLM(
"GadflyII/GLM-4.7-Flash-MTP-NVFP4",
tensor_parallel_size=1,
max_model_len=4096,
trust_remote_code=True,
gpu_memory_utilization=0.90,
)
params = SamplingParams(temperature=0.7, max_tokens=512)
outputs = model.generate(["Explain quantum computing in simple terms."], params)
print(outputs[0].outputs[0].text)
# Standard serving (recommended for performance)
VLLM_ATTENTION_BACKEND=TRITON_MLA vllm serve GadflyII/GLM-4.7-Flash-MTP-NVFP4 \
--tensor-parallel-size 1 \
--max-model-len 4096 \
--trust-remote-code \
--gpu-memory-utilization 0.90
# With MTP speculative decoding (experimental)
VLLM_ATTENTION_BACKEND=TRITON_MLA vllm serve GadflyII/GLM-4.7-Flash-MTP-NVFP4 \
--tensor-parallel-size 1 \
--max-model-len 4096 \
--trust-remote-code \
--gpu-memory-utilization 0.90 \
--speculative-config '{"method": "mtp", "num_speculative_tokens": 1}'
Glm4MoeLiteForCausalLM| Precision | Count | Description |
|---|---|---|
| NVFP4 | 9,168 | MLP/FFN weights |
| BF16 | 240 | Attention weights (MLA) |
| BF16 | 2 | MTP layers (eh_proj, shared_head.head) |
| Model | Accuracy | Correct | Total |
|---|---|---|---|
| BF16 (baseline) | 24.83% | 2988 | 12032 |
| NVFP4-v1 | 23.56% | 2835 | 12032 |
| This Model | 23.91% | 2877 | 12032 |
| Category | BF16 | This Model | Difference |
|---|---|---|---|
| Social Sciences | 32.70% | 31.26% | -1.44% |
| Other | 31.57% | 29.85% | -1.72% |
| Humanities | 23.78% | 22.82% | -0.96% |
| STEM | 19.94% | 19.48% | -0.46% |
| Subject | BF16 | This Model | Difference |
|---|---|---|---|
| Biology | 50.35% | 48.12% | -2.23% |
| Psychology | 44.99% | 41.23% | -3.76% |
| History | 33.60% | 34.12% | +0.52% |
| Health | 35.21% | 34.11% | -1.10% |
| Economics | 36.37% | 33.06% | -3.31% |
| Philosophy | 31.46% | 29.26% | -2.20% |
| Other | 28.35% | 26.08% | -2.27% |
| Computer Science | 26.10% | 21.95% | -4.15% |
| Business | 16.35% | 19.26% | +2.91% |
| Law | 16.89% | 15.99% | -0.90% |
| Math | 14.06% | 14.73% | +0.67% |
| Physics | 15.32% | 15.24% | -0.08% |
| Engineering | 16.00% | 14.96% | -1.04% |
| Chemistry | 14.13% | 14.84% | +0.71% |
If you use this model, please cite the original GLM-4.7-Flash:
@misc{glm4flash2025,
title={GLM-4.7-Flash},
author={Zhipu AI},
year={2025},
howpublished={\url{https://huggingface.co/zai-org/GLM-4.7-Flash}}
}
This model inherits the Apache 2.0 license from the base model.