Gemma 4 31B IT QAT NVFP4 Blackwell
[!TIP] There is a newer version of this model: gemma-4-31B-it-qat-NVFP4-mse-Blackwell. Same base model and calibration set, but with MSE-based weight scaling instead of absmax, which keeps outliers from crushing the rest of each block. This repo stays as it is so existing deployments don't change under their feet.
Gemma 4 31B IT quantized to NVFP4 for native FP4 inference on NVIDIA Blackwell
GPUs. Quantized from Google's unquantized QAT weights
(google/gemma-4-31B-it-qat-q4_0-unquantized) with NVIDIA Model Optimizer
(modelopt 0.44.0), default absmax scaling.
Model Details
- Base Model: google/gemma-4-31B-it-qat-q4_0-unquantized
- Quantization Format:
NVFP4(native FP4 on Blackwell) - Group Size: 16 (per-group scaling)
- Excluded Modules:
lm_head,model.embed_vision*,model.vision_tower*(kept in high precision) - KV cache scales: none in the checkpoint; use
--kv-cache-dtype fp8and let vLLM scale dynamically - Producer: NVIDIA Model Optimizer (
modelopt0.44.0)
[!NOTE] Why does Hugging Face show "17B params" instead of "31B"? Hugging Face calculates the parameter count from the tensor shapes in the
safetensorsfiles. NVFP4 weights are packed two per byte, so the tensors are half-size (a shape of[5376, 21504]is stored as[5376, 10752]) and the auto-count comes out near 17.7B. The architecture is the full 31B dense model.
Serving with vLLM
Needs a Blackwell GPU and vLLM 0.20.0 or newer, the first release with Gemma 4
support. vLLM detects the NVFP4 format from hf_quant_config.json, so no
--quantization flag is required.
vllm serve melcheikh/gemma-4-31B-it-qat-NVFP4-Blackwell \
--kv-cache-dtype fp8
Speculative Decoding
Gemma 4 drafts with its MTP assistant model. This needs vLLM 0.21.0 or newer,
and the assistant goes through --speculative-config:
vllm serve melcheikh/gemma-4-31B-it-qat-NVFP4-Blackwell \
--kv-cache-dtype fp8 \
--speculative-config '{"method": "mtp", "model": "google/gemma-4-31B-it-qat-q4_0-unquantized-assistant", "num_speculative_tokens": 3}'
Use Google's unquantized BF16 assistant here. It is under 1 GB, so quantizing it saves almost nothing, and vLLM releases before 0.25.0 cannot load a quantized assistant on this path.
An earlier version of this card recommended --speculative-model and
--speculative-draft-limit. Those flags don't exist in any vLLM release that
supports Gemma 4, so that command failed. Sorry if it cost you time.
License
Apache 2.0, same as the base model. See the Gemma 4 license.