Gemma 3 · Q4_K_M · Dense · GGUF v3

Gemma 3 4B IT (Q4_K_M) — Exact VRAM, KV Cache & Tensor X-Ray

Google Gemma 3 4B architecture with a 262k multilingual vocabulary and 128k context window for 6+ GB GPUs.

⚡ Simulate on Your GPU in Browser (WASM) Benchmark & Sign Ed25519 in Local Cockpit 0.4.0 View File on HuggingFace
Min VRAM (8k · FP16 KV)4.13 GiB32k w/ Q8_0 KV: 5.52 GiB
Binary .GGUF Weights2.31 GiB5.12 effective bits/weight
Parameters (Active / Total)3.88 / 3.88 B444 parsed tensors
KV Cache Growth136.0 MiB/1kQ8_0 KV: 72.2 MiB / 1k tok

1. HuggingFace Binary Provenance

Repositorybartowski/google_gemma-3-4b-it-GGUF
Inspected Filegoogle_gemma-3-4b-it-Q4_K_M.gguf (2.32 GiB)
HF Commit SHA71506238f970
Harvested UTC2026-11-29 15:28:15 UTC
Parsed Header6 539 673 bytes (SHA-256 f2796389571a2f0f63f1…)

2. Transformer & GQA Architecture

GGUF Architecturegemma3 (Dense)
Transformer Layers34 layers (~54.2 MiB / layer)
Dimensions (d_model / FFN)2560 / 10240
Attention Heads (Q / KV)8 Q / 4 KV (GQA 2.0:1, dim 256)
Native Context & Vocab131 072 tokens · vocab 262 144

3. Exact GGML Quantization Mix Inside This Binary

Rather than quantizing every tensor identically, Q4_K_M keeps sensitive embedding, output and attention tensors at higher precision:

GGML TypeTensor CountVolumeWeight ShareDistribution
Q4_K2041.42 GiB61.6%
Q6_K350.89 GiB38.4%
F322050.00 GiB0.1%

4. KV-Cache Context Cliff from 2k to 128k Tokens (FP16 vs Q8_0 vs Q4_0)

Enabling Flash Attention with a Q8_0 KV cache cuts context memory nearly in half without altering model weights:

Context Length KV Only (FP16) KV Only (Q8_0) KV Only (Q4_0) Total VRAM (FP16) Total VRAM (Q8_0)
2k (2 048)0.27 GiB0.14 GiB0.07 GiB3.33 GiB3.20 GiB
4k (4 096)0.53 GiB0.28 GiB0.15 GiB3.59 GiB3.34 GiB
8k (8 192)1.06 GiB0.56 GiB0.30 GiB4.12 GiB3.62 GiB
16k (16 384)2.13 GiB1.13 GiB0.60 GiB5.19 GiB4.19 GiB
32k (32 768)4.25 GiB2.26 GiB1.20 GiB7.31 GiB5.32 GiB
64k (65 536)8.50 GiB4.52 GiB2.39 GiB11.56 GiB7.58 GiB
128k (131 072)17.00 GiB9.03 GiB4.78 GiB20.06 GiB12.09 GiB

5. Layer-by-Layer GPU Offload Matrix Across Hardware Tiers

Deterministic memory placement including OS display VRAM reserve and compute buffers:

Hardware Tier Context & KV Layers in VRAM VRAM Used RAM Spillover Memory Verdict
8 GB GPU + 16 GB RAM8k · KV FP1634 / 343.60 GiB—100% VRAM
8 GB GPU + 16 GB RAM32k · KV FP1634 / 346.92 GiB—100% VRAM
8 GB GPU + 16 GB RAM32k · KV Q8_034 / 344.93 GiB—100% VRAM
12 GB GPU + 32 GB RAM8k · KV FP1634 / 343.60 GiB—100% VRAM
12 GB GPU + 32 GB RAM32k · KV FP1634 / 346.92 GiB—100% VRAM
12 GB GPU + 32 GB RAM32k · KV Q8_034 / 344.93 GiB—100% VRAM
16 GB GPU + 32 GB RAM8k · KV FP1634 / 343.60 GiB—100% VRAM
16 GB GPU + 32 GB RAM32k · KV FP1634 / 346.92 GiB—100% VRAM
16 GB GPU + 32 GB RAM32k · KV Q8_034 / 344.93 GiB—100% VRAM
24 GB GPU + 64 GB RAM8k · KV FP1634 / 343.60 GiB—100% VRAM
24 GB GPU + 64 GB RAM32k · KV FP1634 / 346.92 GiB—100% VRAM
24 GB GPU + 64 GB RAM32k · KV Q8_034 / 344.93 GiB—100% VRAM
32 GB GPU + 64 GB RAM8k · KV FP1634 / 343.60 GiB—100% VRAM
32 GB GPU + 64 GB RAM32k · KV FP1634 / 346.92 GiB—100% VRAM
32 GB GPU + 64 GB RAM32k · KV Q8_034 / 344.93 GiB—100% VRAM
48 GB Dual-GPU + 128 GB RAM8k · KV FP1634 / 343.60 GiB—100% VRAM
48 GB Dual-GPU + 128 GB RAM32k · KV FP1634 / 346.92 GiB—100% VRAM
48 GB Dual-GPU + 128 GB RAM32k · KV Q8_034 / 344.93 GiB—100% VRAM
64 GB Unified Memory8k · KV FP1634 / 343.60 GiB—Unified Memory
64 GB Unified Memory32k · KV FP1634 / 346.92 GiB—Unified Memory
64 GB Unified Memory32k · KV Q8_034 / 344.93 GiB—Unified Memory

6. Ready-to-Run Local CLI Commands

With Ollama:
ollama run gemma3:4b
With llama-server (Flash Attention + Q8_0 KV Cache sized for 16 GB VRAM):
llama-server -m google_gemma-3-4b-it-Q4_K_M.gguf -ngl 34 -c 32768 -fa --cache-type-k q8_0 --cache-type-v q8_0

7. Ed25519 Certified Real Hardware Benchmarks

No certified Ed25519 passport recorded for this exact quantization yet (zero synthetic tok/s are ever invented). Run this model in Local Cockpit 0.4.0 to publish the first signed /b/lc-… passport!

8. Related Quantizations & Comparable Models