Downloads · 30 days
0
0% of all-time downloads
leok7v/gemma-4-12b-it-qat
gemma-4-12b-it-qat is a any-to-any model from leok7v. Use it for the any-to-any task on the model card, and read the license before you ship it in a product. It is set up for gguf. The card lists the license as apache-2.0.
A GGUF repack of Google's quantization-aware-trained gemma-4-12B-it build, packaged to run on device. The tokenizer, the merge table and the chat template are embedded, so nothing ships alongside the file and nothing…
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
1.1K
Public
Repo size
13.9 GB
Likes
1
Public
Click a slice to open those files.
.ggxf13.9 GB · 100%
From the Hugging Face model README
A GGUF repack of Google's quantization-aware-trained gemma-4-12B-it build, packaged to run on device. The tokenizer, the merge table and the chat template are embedded, so nothing ships alongside the file and nothing calls out to a server at inference time.
This repository holds the repacked weights only, not training data or the original checkpoint.
.ggxf is GGUF plus the tensors and metadata keys this project adds, so these
files load in Gadeon and are not expected to load in other GGUF readers.
gemma-4-12B is the "unified" member of the Gemma 4 family, and it is built differently from the E2B / E4B mobile models. There are no per-layer embeddings, no shared key/value layers, and — the part that surprises people — no vision tower and no audio tower. Multimodality is encoder-free: an image becomes 48x48 raw pixel patches through a LayerNorm/Dense pair plus a factorized 2-D position table, and audio is a 640-sample frame of raw 16 kHz waveform through a single projection. Both land directly in the language model's embedding space.
Attention alternates five sliding-window layers to one full-attention layer, and the two kinds differ in more than the window. A sliding layer is 16 query heads over 8 key/value heads at 256 wide with a RoPE base of 10 000. A full layer is 16 query heads over one key/value head at 512 wide, with proportional RoPE at base 1 000 000, and it carries no value projection at all: key and value share one projection, the value branch taking it before the key norm and the rotation.
The upstream checkpoint is quantization-aware TRAINED, not post-hoc quantized.
On-device assistants and chat in offline or privacy-sensitive settings where prompts must not leave the device.
Not for tasks requiring verified factual accuracy, and not a basis for legal, medical, financial, or safety decisions. Not intended for high-stakes automated decisions without human review.
A language model predicts plausible text; it does not verify facts and has no understanding of truth. Output can be confident and still be wrong, incomplete, or biased. The base model's biases and limitations carry over; see the base model card.
Treat every response critically and check important output against a trusted source.
The tokenizer (262 144 tokens, 514 906 merges, byte fallback and metaspace) and
the chat template are embedded in the file, so a runtime reads both from the
GGUF rather than from sibling files. The checkpoint's own config.json,
generation_config.json, processor_config.json and tokenizer_config.json
are carried verbatim as metadata, which is where the reasoning and tool-call
parsing contract lives.
Follow the base model card's guidance: sampling at temperature 1.0,
top_p 0.95, top_k 64 (these are recorded in the file), thinking enabled by
a <|think|> token at the start of the system prompt, image content placed
before the text and audio content after it.
| Property | Value |
|---|---|
| Objective | Autoregressive next-token prediction |
| Hidden size | 3840 |
| Layers | 48 (40 sliding-window + 8 full attention) |
| Feed-forward | 15360, gated GELU |
| Attention heads | 16 query; 8 key-value sliding, 1 key-value full |
| Head width | 256 sliding, 512 full |
| Key equals value | yes, on the full-attention layers |
| Sliding window | 1024 |
| RoPE base | 10 000 sliding, 1 000 000 full (proportional, 0.25) |
| Vocabulary | 262 144, embeddings tied to the output head |
| Logit softcap | 30 |
| Context | 262 144 |
| Vision | encoder-free: 48x48 pixel patches, factorized 2-D positions |
| Audio | encoder-free: 640 raw samples per token, one projection |
6.823 GB, 677 tensors, GGUF v3, 16384-byte tensor alignment.
| Type | Tensors | Covers |
|---|---|---|
| Q4_0 | 329 | every attention and MLP projection, the embedding table |
| BF16 | 348 | norms, layer scalars, both multimodal projections |
-q4_0-unquantized does not mean "not quantized". Training rounded every
weight of a 32-wide block onto a 16-level grid w = (q - 8) * d, and the
checkpoint then stored the product in bf16. The codes are still in there.
So this repack recovers (q, d) rather than quantizing again. That
distinction is measurable: ggml's quantizer picks d from the block's signed
extreme as max / -8, which is lossy for any block whose extreme is positive,
and would choose fresh codes for weights that were trained where they sit.
Every block is verified individually — a block is written only if q * d,
with d already cast to the fp16 a block header stores, reproduces all 32
values to within one bf16 ulp. All 11.8 billion weights passed. A single
mis-assigned code would land at least d/2 away, eight times that tolerance,
so the check cannot pass a corrupted tensor.
The consequence is that the reconstructed weights are closer to the trained
values than the bf16 checkpoint is: the checkpoint holds
round_bf16(d * (q - 8)) while this file holds (d, q) and reconstructs in
fp32.
Google also publishes
gemma-4-12B-it-qat-w4a16-ct,
a compressed-tensors int4 build (group 32, symmetric, memoryless_minmax
observer) intended for vLLM. It and this file derive from the same
q4_0-unquantized
checkpoint, so both can be scored against it directly.
Relative weight error against that bf16 checkpoint:
| tensor | this repack | w4a16-ct |
|---|---|---|
gate_proj layer 0 | 1.03e-03 | 6.66e-02 |
q_proj layer 0 | 1.07e-03 | 6.67e-02 |
down_proj layer 30 | 1.10e-03 | 6.66e-02 |
About 65x closer to the trained weights.
That is not a better search. The int4 codes agree 99.40% between the two
files, so both recover the same trained grid; w4a16-ct is an independent
witness that the recovery is right. The scales are what differ, its own
running a median 1.0645x larger: a min/max observer takes d from the block's
extreme, where this repack refits d by least squares over the settled codes.
Same codes, different d.
w4a16-ct is better on exactly one tensor. It leaves token_embd in bf16 and
therefore exact, at 1.88 GiB against 0.53 GiB here, which is most of the
difference between its 9.56 GiB and this file's 6.35 GiB.
Both files leave the same modules unquantized: the vision patch dense, both multimodal projections, and the position table.
Please cite the upstream Gemma model. See the base model card at google/gemma-4-12B-it-qat-q4_0-unquantized for the canonical reference and license.
leok7v on Hugging Face.