z-lab · text

gemma4-12B-it-DFlash

z-lab/gemma4-12B-it-DFlash

gemma4-12B-it-DFlash at Q4_K_M is exactly 442,398,496 bytes (0.41 GiB / 0.44 GB) — an effective 4.865 bits per weight, not the nominal 4. Its KV cache at 32K is 0.16 GiB, not the 0.63 GiB a flat formula predicts.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
727M
Architecture
dflash
5 layers
Context
262,144
native (config.json)
License
apache-2.0

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ4_XS0.38 GiB405,503,7764.459williamliao
Q4_K_M0.41 GiB442,398,4964.865williamliao
Q5_K_M0.49 GiB524,973,8565.773williamliao
Q6_K0.57 GiB612,710,1766.738williamliao
Q8_00.73 GiB788,889,3768.675williamliao
F161.37 GiB1,470,873,37616.175williamliao

KV cache by context

computed per layer — this model uses sliding-window attention
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.05 GiB0.08 GiB1.43×1 / 4 / 0
8,1920.07 GiB0.16 GiB2.22×1 / 4 / 0
16,3840.10 GiB0.31 GiB3.08×1 / 4 / 0
32,7680.16 GiB0.63 GiB3.81×1 / 4 / 0
65,5360.29 GiB1.25 GiB4.32×1 / 4 / 0
131,0720.54 GiB2.50 GiB4.64×1 / 4 / 0

4 of 5 layers cache only a 2,048-token window rather than the full context, on a period of . Figures assume the default configuration; --swa-full disables the saving entirely.

Compare with

same modality, comparable size

Will it run on your card?

full quant x context sweep

Why other calculators give a different number

A parameters × bits ÷ 8 estimate puts Q4_K_M at roughly 0.38 GiB. The real file is 0.41 GiB, because a quantization is a mixture and some tensors are always kept at higher precision. The larger discrepancy is the cache: a flat formula gives 0.63 GiB at 32K context where the real figure is 0.16 GiB, because most of this model's layers cache a fixed window rather than the whole context.

Architecture

from config.json
Layers
5
Attention heads
32
KV heads
8
Head dim
128
Hidden size
3840
Vocab
262,144
Sliding window
2048
SWA period
MLA
no
Experts
Experts per token
use_sliding_window
true

Questions people ask

How much VRAM does gemma4-12B-it-DFlash need?
Q4_K_M is exactly 442,398,496 bytes (0.41 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is gemma4-12B-it-DFlash's KV cache?
0.16 GiB at 32K context with an f16 cache, computed per layer. Quantizing the cache to q8_0 roughly halves it, which is often the difference between a context length fitting and not.
Which quantization of gemma4-12B-it-DFlash should I use?
Q4_K_M is the usual default. Pick the largest quantization that fits your card at the context you actually need — the table above gives exact sizes for every one published.