Views
No views yet
If you want the best 4-bit Gemma 4 12B, use Google's own gemma-4-12B-it-qat-w4a16-ct instead. It is quantization-aware trained, this one is post-training round-to-nearest. This repository exists as a small, fast-loading test artifact and as a worked example of a fully reproducible data-free recipe.
llmcompressor.model_free_ptq. No calibration data was
used and the model was never loaded — the quantizer operates directly on the safetensors.
Architecture, tokenizer, chat template and processor config are the vendor's, unmodified.quant_config=None:vision_tower, vision_embedder, embed_vision and the vision projectionsaudio_tower, embed_audio and the audio projectionembed_tokens (tied to the output head in this checkpoint) and lm_head| this repo | google/…-qat-w4a16-ct | |
|---|---|---|
| total size | 7.74 GB | 10.26 GB |
| method | data-free RTN (PTQ) | quantization-aware training |
| group size | 128 | 32 |
| quantized modules | 328 (72.6% of bytes) | 328 (59.7% of bytes) |
| output head | tied to embed_tokens | separate lm_head.weight (2.01 GB, bf16) |
lm_head (2.01 GB) and its group-32 scales cost ~0.5 GB more than group-128../llmq.py run --profile gemma-4-12b-it1# llmcompressor==0.13.1a20260814, compressed-tensors==0.18.1a20260818,
2# transformers==5.15.1, torch==2.13.0
3from llmcompressor import model_free_ptq
4
5model_free_ptq(
6 model_stub="google/gemma-4-12B-it", # re-sharded to 4 GB shards first
7 save_directory="gemma-4-12B-it-W4A16",
8 scheme="W4A16",
9 ignore=["re:.*vision.*", "re:.*audio.*", "lm_head", "re:.*embed_tokens.*"],
10 max_workers=2,
11 device="cuda:0",
12)model_free_ptq loads one shard at a time, so
re-sharding the single 23.92 GB source file into 4 GB pieces puts the peak at ~5 GB.vllm serve <this-repo> --max-model-len 65536--quantization; compressed-tensors is detected from config.json. The
int4 W4A16 scheme uses Marlin kernels and runs on compute capability 7.5 and above.transformers >= 5.10, but vLLM ≤ 0.27.1 cannot serve
Gemma 4 with transformers >= 5.15: head_dim became a per-layer attribute and older
vLLM reads it globally, raising AmbiguousGlobalPerLayerAttributeError at engine-config
time. Use either transformers < 5.15 with vLLM 0.25–0.27, or vLLM >= 0.28, which
handles both layouts.LICENSE and Google's
Gemma 4 license page. The base
repository ships no LICENSE file, so the Apache-2.0 text is included here for
redistribution. "Gemma" is Google's mark; this repository is not endorsed by or
affiliated with Google.