Gemma 3 4B IT VRAM & Memory Requirements
Specific checkpoints with sourced architecture and weight files. GGUF Q4_0 (Google QAT): 3.33 GiB–3.79 GiB at 8,192 tokens, 1 sequence, FP16 KV, llama.cpp.
This result is an estimate, not a measured trace.Not verifiedFile-backed weights
Publisher and provenance
- PublisherGoogle
- Hugging Face
google/gemma-3-4b-it - Revision
093f9f388b31de276ce2de164bdc2081324b9767 - Total parameters4,300,079,472
- Layers34
- Query heads8
- KV heads4 (sliding-window)
- Head dimension256
- Recorded context capability131,072
- Completenesscomplete · full
Memory layers in this estimate
Artifact bytes, raw KV, engine extras, and total demand are separate. This is not a runtime trace.
- Weight artifact
- 2.94 GiB (3,155,051,328 bytes)
- Raw KV cache
- 0.27 GiB (289,406,976 bytes)
- Engine extras / workspace
- 0.13 GiB–0.58 GiB
- Total estimated demand
- 3.33 GiB–3.79 GiB
Published artifacts
| Quantization | Selected files | Bytes | Engine | Evidence |
|---|---|---|---|---|
| Official BF16 safetensors (text + SigLIP vision tower) bf16 | model-00001-of-00002.safetensors, model-00002-of-00002.safetensors | 8,600,277,880 (8.01 GiB / 8.60 GB) | vllm, sglang, unspecified | file-metadata |
| GGUF Q4_0 (Google QAT) gguf-q4_0 | gemma-3-4b-it-q4_0.gguf | 3,155,051,328 (2.94 GiB / 3.16 GB) | llama.cpp, ollama, unspecified | file-metadata |
| INT4 theoretical | No published file | 2,150,039,736 (theoretical) | — | theoretical |
Memory by quantization and context
Concurrent sequences = 1. KV defaults to FP16. The range includes documented runtime extras for the listed engine. These figures use the same core as the interactive calculator.
| Quantization | 2,048 tokens | 8,192 tokens | 32,768 tokens |
|---|---|---|---|
| Official BF16 safetensors (text + SigLIP vision tower) | 8.79 GiB–10.67 GiB | 8.90 GiB–10.79 GiB | 9.37 GiB–11.27 GiB |
| GGUF Q4_0 (Google QAT) | 3.22 GiB–3.65 GiB | 3.33 GiB–3.79 GiB | 3.80 GiB–4.29 GiB |
| INT4 theoretical Theoretical rows are not downloadable artifacts. | 2.28 GiB–3.33 GiB | 2.40 GiB–3.49 GiB | 2.87 GiB–4.06 GiB |
Raw KV contribution
Related pages
Sources
- Gemma 3 model card (Google AI for Developers) — Input context 128K tokens for 4B, 12B, 27B and 32K for 1B; images encoded to 256 tokens each. License: Gemma Terms of Use.
- Google gemma_pytorch config.py (architecture) — get_config_for_4b: num_hidden_layers=34, num_attention_heads=8, num_key_value_heads=4, hidden_size=2560, head_dim=256, sliding_window_size=1024, attn_types = 5 LOCAL_SLIDING then 1 GLOBAL, cycled by layer index (gemma/model.py: attn_types[i % len(attn_types)]), so 5 global and 29 sliding layers. The Hugging Face config.json is gated (HTTP 401), so it was not read.
- Cross-check only: llama.cpp org GGUF header converted from Google's config (not an official Google source) — Header read with an HTTP range request on 2026-10-18: block_count 34, head_count 8, head_count_kv 4, embedding_length 2560, key_length 256, sliding_window 1024, context_length 131072. All agree with gemma_pytorch config.py.
- Gemma releases — March 10, 2025: release of Gemma 3 in 1B, 4B, 12B and 27B sizes.
- Hugging Face API (BF16) — sha 093f9f388b31de276ce2de164bdc2081324b9767; gated manual; safetensors.total=4300079472; 2 safetensors siblings.
- Hugging Face API (QAT Q4_0 GGUF) — sha 15f73f5eee9c28f53afefef5723e29680c2fc78a; gemma-3-4b-it-q4_0.gguf = 3,155,051,328 bytes.
Assumptions that affect this result
- Requested context is within the recorded native window of 131072 tokens.
- Full-resident weight estimates use total parameters, including inactive MoE experts.
- Weight bytes come from the selected weight files only, not from every file in the repository.
- Download file size is not peak GPU memory. Runtime layout, allocator padding, and KV are extra.
- Counted files: gemma-3-4b-it-q4_0.gguf.
- This checkpoint has a vision component. Text-only inference does not include vision encoder or projector bytes.
- Context budget is the number of cached tokens per sequence (prompt plus reserved generation).
- Concurrent sequences share one model replica; weights are not multiplied by sequence count.
Calculator
Loading catalog snapshot…
Search or pick a catalog checkpoint to see memory demand.
Search or pick a catalog checkpoint to see memory demand.