Downloads · 30 days
11
13% of all-time downloads
pirola/GLM-4.7-Flash-REAP-23B-A3B-NVFP4-NVembed
GLM-4.7-Flash-REAP-23B-A3B-NVFP4-NVembed is a machine learning model from pirola. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
NVFP4-quantized GLM-4.7-Flash-REAP-23B-A3B — a 23B-parameter MoE reasoning model (3B active) that fits in 12 GB VRAM and runs 44K context on a single RTX 5080.
Downloads · 30 days
11
13% of all-time downloads
All-time downloads
83
Public
Parameters
12.9B
13 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors12.9 GB · 100%
How the weights are stored.
U811.5B · 89%
From the Hugging Face model README
NVFP4-quantized GLM-4.7-Flash-REAP-23B-A3B — a 23B-parameter MoE reasoning model (3B active) that fits in 12 GB VRAM and runs 44K context on a single RTX 5080.
lm_head, and embed_tokens quantized to NVFP4model.safetensors<think> tokens) with --reasoning-parser deepseek_r1qk_nope_head_dim=128, this model has 192)Should work on any Blackwell GPU (RTX 50-series, B-series datacenter). Context length scales with available VRAM.
git clone https://github.com/vllm-project/vllm.git
cd vllm
git checkout 628302114 # v0.16.1rc1.dev34
# Apply patches (required for NVFP4 lm_head, embed_tokens, MLA FP8 KV cache)
git apply ../GLM-4.7-Flash-REAP-23B-A3B-NVFP4-NVembed/vllm_patches.diff
# Build
pip install -e . --no-build-isolation
pip install flashinfer==0.6.4 # or latest compatible
export VLLM_TEST_FORCE_FP8_MARLIN=1
export VLLM_NVFP4_GEMM_BACKEND=marlin
export PYTORCH_ALLOC_CONF=expandable_segments:True
export VLLM_FLASHINFER_WORKSPACE_BUFFER_SIZE=$((64 * 1024 * 1024))
BLOCKS=2750
BYTES_PER_BLOCK=433152 # 47 layers x 576 MLA head x 1 FP8 x 16 tokens
MAX_MODEL_LEN=$((BLOCKS * 16)) # 44,000
vllm serve ./GLM-4.7-Flash-REAP-23B-A3B-NVFP4-NVembed \
--trust-remote-code \
--dtype bfloat16 \
--quantization modelopt \
--kv-cache-dtype fp8_e4m3 \
--max-model-len $MAX_MODEL_LEN \
--no-enable-prefix-caching \
--max-num-seqs 1 \
--kv-cache-memory-bytes $((BLOCKS * BYTES_PER_BLOCK)) \
--num-gpu-blocks-override $BLOCKS \
--tensor-parallel-size 1 \
--enable-chunked-prefill \
--max-num-batched-tokens 256 \
--enforce-eager \
--reasoning-parser deepseek_r1 \
--override-generation-config '{"temperature": 0.0, "max_tokens": 44000}'
curl -s http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "GLM-4.7-Flash-REAP-23B-A3B-NVFP4-NVembed",
"messages": [{"role": "user", "content": "What is the capital of France?"}]}' \
| python3 -m json.tool
| Flag | Why |
|---|---|
--trust-remote-code | Required for GLM4 MoE architecture |
--quantization modelopt | NVFP4 weight format from NVIDIA Model Optimizer |
--kv-cache-dtype fp8_e4m3 | FP8 KV cache — halves KV memory vs BF16 |
--no-enable-prefix-caching | Prefix caching incompatible with MLA + FP8 KV |
--max-num-seqs 1 | Single sequence — 16 GB VRAM budget |
--kv-cache-memory-bytes | Precise KV allocation (bypasses gpu_memory_utilization startup check) |
--num-gpu-blocks-override | Binary-searched max stable blocks for RTX 5080 |
--enforce-eager | CUDA graphs disabled — saves VRAM |
--reasoning-parser deepseek_r1 | Separates <think> reasoning from response content |
--override-generation-config | temperature=0 prevents reasoning spirals |
| Metric | Value |
|---|---|
| Model size | 12.1 GiB |
| Max context | 44,000 tokens |
| KV cache blocks | 2,750 |
| KV cache size | ~1.14 GiB |
| KV per block | 433,152 bytes |
| Architecture | MoE: 47 layers, 48 experts, top-4, 1 shared |
| Active params | ~3B per token |
nvidia-modelopt==0.41.0)The included vllm_patches.diff modifies 6 files based on vLLM commit 628302114:
| File | Change |
|---|---|
modelopt.py | NVFP4 lm_head + embed_tokens support; PerTensorScaleParameter init fix (uninitialized slots caused inf in merged linears) |
vocab_parallel_embedding.py | FP8 weight dtype preservation + BF16 cast in embedding() |
linear.py | FP8 weight cast in forward pass |
mla_attention.py | kv_b_proj dtype guard for quantized layers (prevents crash on NVFP4/INT4) |
glm4_moe_lite.py | name=None guard in weight loading |
triton_mla.py | FP8 KV cache support for Triton MLA backend |
Some of these patches have been submitted upstream and may become unnecessary in future vLLM releases: