Views
No views yet
NVFP4-quantized google/gemma-4-26B-A4B-it for vLLM....experts.<n>.* (no moe. namespace). Vanilla upstream vllm
v0.20.1 and later load the checkpoint directly — no runtime patch
required. Earlier snapshots of this repo stored the same weights
under ...moe.experts.<n>.* and relied on a bundled gemma4_patched.py
to disable a non-idempotent regex in vllm/model_executor/models/gemma4.py;
that workaround is no longer needed.NVFP4NVFP4NVFP4lm_head: higher precisionFP8quantize_gemma4_moe.py — quantization/export script, redistributed under Apache-2.0gemma4_patched.py — kept for historical reference only; not required since the flat-key snapshotquantize_gemma4_moe.py is based on the community release published by bg-digitalservices / marioiseligemma4_patched.py is derived from vLLM's Apache-2.0 Gemma 4 implementation1docker run -d \
2 --name gemma4-a4b-nvfp4 \
3 --gpus all \
4 --ipc=host \
5 --network host \
6 -e VLLM_NVFP4_GEMM_BACKEND=marlin \
7 -v "${HOME}/.cache/huggingface:/root/.cache/huggingface" \
8 vllm/vllm-openai:v0.20.1 \
9 --model Neural-ICE/Gemma-4-26B-A4B-IT-NVFP4 \
10 --served-model-name gemma-4 \
11 --host 0.0.0.0 \
12 --port 8000 \
13 --generation-config vllm \
14 --quantization modelopt \
15 --dtype auto \
16 --kv-cache-dtype fp8 \
17 --gpu-memory-utilization 0.85 \
18 --max-model-len 32768 \
19 --max-num-seqs 4 \
20 --moe-backend marlin \
21 --trust-remote-codevllm serve1source .venv-vllm/bin/activate
2
3VLLM_NVFP4_GEMM_BACKEND=marlin \
4vllm serve Neural-ICE/Gemma-4-26B-A4B-IT-NVFP4 \
5 --served-model-name gemma-4 \
6 --host 0.0.0.0 \
7 --port 8000 \
8 --generation-config vllm \
9 --quantization modelopt \
10 --dtype auto \
11 --kv-cache-dtype fp8 \
12 --gpu-memory-utilization 0.85 \
13 --max-model-len 32768 \
14 --max-num-seqs 4 \
15 --moe-backend marlin \
16 --trust-remote-code--quantization modelopt: required for ModelOpt NVFP4 checkpoints--moe-backend marlin: required for the MoE expert pathVLLM_NVFP4_GEMM_BACKEND=marlin: uses Marlin on the non-MoE NVFP4 path as well--kv-cache-dtype fp8: reduces KV memory pressure--trust-remote-code: required for Gemma 4vLLM recipe:1VLLM_NVFP4_GEMM_BACKEND=marlin \
2vllm serve Neural-ICE/Gemma-4-26B-A4B-IT-NVFP4 \
3 --served-model-name gemma-4 \
4 --generation-config vllm \
5 --max-model-len 32768 \
6 --quantization modelopt \
7 --kv-cache-dtype fp8 \
8 --moe-backend marlin \
9 --trust-remote-code \
10 --reasoning-parser gemma4 \
11 --tool-call-parser gemma4 \
12 --enable-auto-tool-choice--reasoning-parser gemma4 parses Gemma 4 reasoning outputchat_template_kwargs.enable_thinking=trueextra_body={"chat_template_kwargs": {"enable_thinking": True}}--limit-mm-per-prompt '{"image":0,"video":0}' to skip multimodal encoder allocation. In practice, --gpu-memory-utilization 0.75 to 0.85 is safer than hard-coding 0.90.1curl http://localhost:8000/v1/chat/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "gemma-4",
5 "messages": [
6 {"role": "user", "content": "Explain quantum entanglement in simple terms."}
7 ],
8 "max_tokens": 512
9 }'