Downloads · 30 days
1K
17% of all-time downloads
FreedomAISVR/Gemma-4-12B-it-QAT-NVFP4-GGUF
Gemma-4-12B-it-QAT-NVFP4-GGUF is a machine learning model from FreedomAISVR. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
NVFP4 (4-bit) GGUF of Google's official QAT release, rebuilt from google/gemma-4-12B-it-qat-q40-unquantized and verified on llama.cpp with vision and 256K context at KV Q80.
Downloads · 30 days
1K
17% of all-time downloads
All-time downloads
6K
Public
Repo size
21.3 GB
Likes
0
Public
Click a slice to open those files.
.gguf7.4 GB · 100%
From the Hugging Face model README
NVFP4 (4-bit) GGUF of Google's official QAT release, rebuilt from google/gemma-4-12B-it-qat-q4_0-unquantized and verified on llama.cpp with vision and 256K context at KV Q8_0.
general.file_type = 39) — NVIDIA Blackwell 4-bit E2M1 values with E4M3 scaling per 16 values plus an FP32 tensor scale.| File | Size | Description |
|---|---|---|
gemma-4-12b-it-qat-nvfp4.gguf | 7,219,672,864 B (7.22 GB) | Text model, NVFP4 + Q8_0 embeddings, F32 norms |
mmproj-gemma-4-12b-it-qat.gguf | 175,115,616 B (175 MB) | Vision projector, F32/BF16 — byte-identical to Google's official mmproj |
The mmproj is shipped at F32/BF16 on purpose. Converting it to F16 breaks vision (see Limitations).
Tested on llama.cpp b1868 (4fea119d), RTX 5060 Ti 16 GB, CUDA 13.2:
Vision — OCR test image with five lines including PART-NUMBER: XK-9942, LOT: 7734-B, and 12 + 37 = 49. Output:
GEMMA VISION TEST
PART-NUMBER: XK-9942
LOT: 7734-B
Q4_0 or NVFP4?
12 + 37 = 49
49
All five lines transcribed exactly, arithmetic result correct.
256K context with KV cache at Q8_0 — -c 262144 -ctk q8_0 -ctv q8_0:
K (q8_0) 1088 MiB + V (q8_0) 1088 MiB over 262,144 cells (8 layers), plus 850 MiB SWA cache (5,120 cells, 40 layers)Both formats were benchmarked head-to-head on the same machine, same llama.cpp build, same flags, same KV cache setting. Choose based on which half of inference you care about — the result is a genuine trade-off, not a clean win.
| Test | MXFP4 | NVFP4 | Delta |
|---|---|---|---|
pp8192, short context | 2,936 | 3,434 | NVFP4 +17.0% |
pp4096 @ d125000 | 761.8 | 798.9 | NVFP4 +4.9% |
pp4096 @ d250000 | 438.7 | 462.6 | NVFP4 +5.4% |
| Test | MXFP4 | NVFP4 | Delta |
|---|---|---|---|
tg128, short context | 51.65 | 47.74 | MXFP4 +8.2% |
tg128 @ d125000 | 29.28 | 28.51 | MXFP4 +2.7% |
tg128 @ d250000 | 20.56 | 20.84 | NVFP4 +1.4% (tie) |
Both formats take the same native Blackwell FP4 tensor-core path. This build does not privilege one over the other:
const bool use_native_fp4 = blackwell_mma_available(cc) &&
(src0->type == GGML_TYPE_MXFP4 || src0->type == GGML_TYPE_NVFP4);
The build was compiled with CMAKE_CUDA_ARCHITECTURES=native and ggml-cuda.dll contains sm_120, so the gate is satisfied on RTX 50-series. The difference is therefore file size vs. compute efficiency, not kernel availability:
| Your workload | Use |
|---|---|
| Long prompts, RAG, agentic loops, large code context | NVFP4 — prefill dominates and it is up to 17% faster |
| Streaming chat, long generations, interactive use | MXFP4 — about 8% faster decode at normal context |
| Accuracy matters most | NVFP4 — finer block scaling (16 vs 32) generally quantizes more accurately |
| Tied at long context | Either — the gap is ~5% or less at 128K+, so pick on accuracy |
Sizes to plan VRAM around: MXFP4 6.41 GiB · NVFP4 6.72 GiB. At 256K context with KV Q8_0, the KV cache adds ~2.4 GiB either way.
# text
llama-cli -m gemma-4-12b-it-qat-nvfp4.gguf -ngl 99 --jinja
# 256K context, KV cache at Q8_0
llama-server -m gemma-4-12b-it-qat-nvfp4.gguf -ngl 99 --jinja \
-c 262144 -ctk q8_0 -ctv q8_0
# vision / multimodal
llama-mtmd-cli -m gemma-4-12b-it-qat-nvfp4.gguf \
--mmproj mmproj-gemma-4-12b-it-qat.gguf \
--image photo.png -ngl 99 --jinja
--jinja is requiredGemma 4's chat template cannot be expressed in llama.cpp's legacy template converter. Without --jinja, llama-mtmd-cli throws an uncaught C++ exception during chat-template setup and dies with silent exit code 0xC0000409 (-1073740791) — no error message, no output. With --jinja the template renders correctly (<|turn>…<turn|>, <|think|>).
Do not regenerate the mmproj with a plain F16 conversion. F16 conversion of v.patch_embd.weight (6912×3840) overflows F16 accumulation during the patch-embedding matmul. Observed outcomes on this exact model:
<unused49> tokens, orThe F32/BF16 mmproj shipped here is unaffected. This matches upstream llama.cpp issue #24146 (closed not-planned, unfixed), root cause 2: "The patch_embeddings_0 matmul overflows F16 accumulation… forcing F32 accumulation fixes it."
Upstream #24146 root cause 1 (resize not filling the soft-token budget) is also unfixed and was not worked around here; it affects token-count accuracy for images, not correctness of this build's OCR results.
Architecture: Gemma4UnifiedForConditionalGeneration, 48 layers, hidden 3840, FFN 15360, 16 KV heads, sliding-window (1024) + full attention in a 40:8 per-layer pattern (matching the KV cache: 40 SWA layers at 5,120 cells + 8 full layers at 262,144 cells). Native 262,144-token context (gemma4.context_length = 262144). Thinking is enabled by default via the <|think|> token.
convert_hf_to_gguf.py, build b1868 (4fea119d)llama-quantize NVFP4 (locally patched build; NVFP4 is not in stock llama.cpp)chat_template.jinjaApache 2.0 (same as the base model).