v0 — quantization artifact, no engine-side verification yet.
This release contains the NVFP4 (W4A4) quantization of
google/gemma-4-12B-it
produced with NVIDIA Model Optimizer.
The artifact is complete and self-consistent;
we have not
yet verified a full inference-engine run end-to-end on this
checkpoint
(see "Engine support" below). A v0.1 follow-up
will ship with throughput, latency, and wikitext-2
perplexity numbers once the engine side is wired up.
Engine support (status as of 2026-06-03)
Engine
Status
transformers
(≥ dev main)
Loads the BF16 base model. Cannot load NVFP4 packed weights (uint8 FP4).
vLLM (≥ 0.22.0)
Blocked:
Gemma4UnifiedForConditionalGeneration
is not in vLLM's model registry; it falls back to
TransformersMultiModalForCausalLM
which crashes inside
flashinfer_scaled_fp4_mm
with a 3D→2D activation shape mismatch. We are working on a custom registry registration.
SGLang (dev image)
Blocked: same registry gap as vLLM, plus a deeper issue — SGLang's
Gemma4DecoderLayer
does not match the 12B Unified's full-attention layer shape (
head_dim=512
, no
v_proj
because
attention_k_eq_v=True
).
TensorRT-LLM
Not yet evaluated.
llama.cpp / GGUF
Not yet evaluated.
Practical advice right now:
if you want to use this
checkpoint, the cleanest path is to
load it in
transformers
(dev main) and dequantize the FP4 weights to
BF16 yourself
, then run inference. This loses the speed
benefit of FP4 but lets you validate the model. A v0.1
follow-up will publish a working engine path.
Credits and Attribution
This checkpoint was produced by
r0b0tlab
(@mr-r0b0t on X). It is derived work built on top of the
following projects, models, datasets, and tools — all of which
deserve direct credit:
Base model
google/gemma-4-12B-it
— Google DeepMind. The Gemma 4 12B Unified
instruction-tuned multimodal model. The architecture is
Gemma4UnifiedForConditionalGeneration
, a 48-layer dense
11.96B-parameter model with hybrid sliding-window + global
attention, raw-patch image and raw-waveform audio
projection, and 256K context.
Quantization tool
NVIDIA Model Optimizer
(formerly TensorRT Model Optimizer). The PTQ (post-training
quantization) library used to convert the BF16 weights and
activations to NVFP4. Version used:
0.44.0
.
The library is part of NVIDIA's inference optimization
stack and is integrated with vLLM, SGLang, TensorRT-LLM,
and the Megatron training frameworks.
Calibration data
abisee/cnn_dailymail
— Abigail See, Peter J. Liu, Christopher D. Manning.
Get To
The Point: Summarization with Pointer-Generator Networks
.
arXiv:1704.04368, 2017. ~300,000 unique English news
articles from CNN and the Daily Mail.
Licensed under
Apache 2.0.
This is the de-facto standard calibration set
for NVIDIA's NVFP4 checkpoints (used for
nvidia/Gemma-4-31B-IT-NVFP4
and most other NVIDIA-published NVFP4 models).
Prior art (the patterns we adapted)
bg-digitalservices/quantize_gemma4_moe.py
— the quantization script that this work adapts. The 6-step
pipeline (load → apply exclusion → calibrate → quantize →
export → copy auxiliary files) is borrowed directly. The
MoE plugin classes are removed because the 12B Unified is
dense (no MoE). The multimodal exclusion pattern is the
intellectual seed of the exclusion list below.
vLLM
— the
target inference engine. vLLM 0.22.0+ natively supports
modelopt_fp4
quantization via
--quantization modelopt_fp4
.
We are working on a custom model registration for
Gemma4UnifiedForConditionalGeneration
.
Model loading and multimodal processor
Hugging Face
transformers
(≥ 5.10.0.dev0) — the loader for
Gemma4UnifiedForConditionalGeneration
via
AutoModelForImageTextToText
and the multimodal processor
via
AutoProcessor
.
Quantization format
NVFP4
— NVIDIA's 4-bit floating-point format designed
for FP4 weights with FP8 E4M3 per-block scales and a
FP32 per-tensor global scale. Specified in
hf_quant_config.json
as
quant_algo: NVFP4
.
ModelOpt's default config also excludes norms, biases, and
the vocab embedding; the three lines above are the
modelopt-specific additions.
Calibration details
Calibration set:
abisee/cnn_dailymail
(3.0.0)
Number of samples:
512 (text-only forward pass)
Sequence length:
1,024 tokens
Batch size:
4
Forward loop:
model(input_ids=batch)
only
Why text-only calibration:
the multimodal pipeline
(vision embedder + projection, audio projection) is
excluded from quantization, so the calibration data does
not need to be multimodal. This is the same approach used
by all NVIDIA-published NVFP4 checkpoints.
We have
not
run a full PPL or benchmark comparison in
this v0 release. The expected behaviour based on NVIDIA's
publicly published NVFP4 model cards (e.g.
nvidia/Gemma-4-31B-IT-NVFP4
, which reports 0.2–0.4pp loss
across GPQA Diamond, AIME 2025, MMLU Pro, LiveCodeBench,
Scicode, and Terminal-Bench Hard) is that NVFP4 retains
99% of BF16 accuracy. The 12B Unified is a different
architecture than the 31B, so we do not claim parity; a
wikitext-2 PPL comparison and a small multimodal smoke test
are planned for v0.1.
How to use
With transformers (for direct use / research)
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "r0b0tlab/gemma-4-12B-it-nvfp4"
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)
# Text
msgs = [{"role": "user", "content": [{"type": "text",
"text": "What is the capital of France?"}]}]
inputs = processor.apply_chat_template(
msgs, tokenize=True, return_dict=True, return_tensors="pt",
add_generation_prompt=True).to(model.device)
output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(processor.decode(output[0][inputs.input_ids.shape[-1]:],
skip_special_tokens=True))
Caveat:
this loads the BF16 base architecture. Loading
the NVFP4 packed weights requires an engine with FP4
support. See "Engine support" above.
With vLLM (planned, not yet working)
# The command we expect to work once the engine is fixed:
vllm serve r0b0tlab/gemma-4-12B-it-nvfp4 \
--quantization modelopt_fp4 \
--tensor-parallel-size 1 \
--max-model-len 65536 \
--gpu-memory-utilization 0.85
Engine support is incomplete.
See the status table at
the top of this card. v0 ships the quantization artifact
only; v0.1 will ship with a working engine path and
benchmark numbers.
Multimodal sub-modules are preserved in BF16.
The
vision embedder (
35M), vision projection (
15M), and
audio projection (~2.5M) are not quantized. This is a
conservative choice; quantizing them would save < 100 MB
and we judged the numerical risk of degrading multimodal
understanding unacceptable.
Calibration is text-only.
Following the NVIDIA NVFP4
standard, the calibration forward loop is text-only.
No fine-tuning was performed.
This is a pure PTQ
(post-training quantization) checkpoint; no QAT
(quantization-aware training) or LoRA adapters are
included.
Hardware requirements.
NVFP4 requires an NVIDIA GPU
with native FP4 tensor-core execution. On GPUs without
native FP4, the engine will fall back to an emulation
backend which is significantly slower.
How to cite this model
@misc{r0b0tlab_gemma4_12b_nvfp4_2026,
title={Gemma 4 12B IT NVFP4 (r0b0tlab native optimization, v0)},
author={r0b0tlab},
year={2026},
howpublished={Hugging Face},
note={NVFP4 quantization of google/gemma-4-12B-it via NVIDIA Model Optimizer v0.44.0},
url={https://huggingface.co/r0b0tlab/gemma-4-12B-it-nvfp4}
}
@misc{google_gemma4_12b_2026,
title={Gemma 4 12B (Unified)},
author={Google DeepMind},
year={2026},
howpublished={Hugging Face},
url={https://huggingface.co/google/gemma-4-12B}
}
@software{nvidia_modelopt_2026,
title={TensorRT Model Optimizer},
author={NVIDIA},
year={2026},
url={https://github.com/NVIDIA/TensorRT-Model-Optimizer}
}
@misc{cnn_dailymail_2017,
title={Get To The Point: Summarization with Pointer-Generator Networks},
author={Abigail See and Peter J. Liu and Christopher D. Manning},
year={2017},
eprint={1704.04368},
archivePrefix={arXiv},
url={https://arxiv.org/abs/1704.04368}
}
gemma-4-12B-it-nvfp4 huggingface.co is an AI model on huggingface.co that provides gemma-4-12B-it-nvfp4's model effect (), which can be used instantly with this r0b0tlab gemma-4-12B-it-nvfp4 model. huggingface.co supports a free trial of the gemma-4-12B-it-nvfp4 model, and also provides paid use of the gemma-4-12B-it-nvfp4. Support call gemma-4-12B-it-nvfp4 model through api, including Node.js, Python, http.
gemma-4-12B-it-nvfp4 huggingface.co is an online trial and call api platform, which integrates gemma-4-12B-it-nvfp4's modeling effects, including api services, and provides a free online trial of gemma-4-12B-it-nvfp4, you can try gemma-4-12B-it-nvfp4 online for free by clicking the link below.
r0b0tlab gemma-4-12B-it-nvfp4 online free url in huggingface.co:
gemma-4-12B-it-nvfp4 is an open source model from GitHub that offers a free installation service, and any user can find gemma-4-12B-it-nvfp4 on GitHub to install. At the same time, huggingface.co provides the effect of gemma-4-12B-it-nvfp4 install, users can directly use gemma-4-12B-it-nvfp4 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
gemma-4-12B-it-nvfp4 install url in huggingface.co: