Gemma 4 E4B VRAM requirements
Gemma 4 E4B needs about 5.64 GB of VRAM at Q4_K_M with 8K context, so it fits an 8 GB card such as the RTX 4060 8GB. Gemma 4 E4B has 8.0B parameters. With the same 8K context and one request it needs 8.87 GB at FP8 and 17.1 GB at FP16/BF16. The published weights take 14.9 GB (BF16). The smallest setup here that holds it at Q4_K_M with an 8K context is the RTX 4060 8GB; on one 24 GB RTX 3090 / 4090 it runs with its full 128K-token context.
5.64 GB at Q4_K_M, 8K context, one request
- FP8
- 8.87 GB
- FP16 / BF16
- 17.1 GB
- Published weights
- 14.9 GB
- Smallest setup, Q4_K_M
- RTX 4060 8GB
Worked example: Gemma 4 E4B with 32K tokens
Inputs: Gemma 4 E4B · Q4_K_M weights · 32,768 tokens of context · one request · FP16 KV cache
- Weights (8.0B at Q4_K_M)
- 4.51 GB
- KV cache (16 KB per token)
- 552 MB
- Buffers and runtime (0.5 GB + 10%)
- 1.00 GB
- Total
- 6.05 GB
The smallest setup here that holds it is the RTX 4060 8GB, with about 1.95 GB to spare. Change the inputs in the calculator
What makes Gemma 4 E4B's memory use different
Its 20 sliding-window layers keep only the last 512 tokens (llama.cpp gives them 1,024 cells: the window plus a 512-token batch, rounded up to 256): at its 128K limit they hold 40 MB of cache instead of the 5.00 GB they would need with full attention.
18 of its 42 layers reuse an earlier layer's cache, so the cache grows by 16 KB per token where caching every layer would take 168 KB.
Per token of context it adds 16 KB of FP16 cache; Llama 3.1 8B (8.0B), the nearest-sized model here with plain full attention, adds 128 KB, so Gemma 4 E4B needs 13% as much.
How much VRAM does Gemma 4 E4B need?
Gemma 4 E4B needs 5.64 GB at Q4_K_M, 9.38 GB at Q8_0 and 17.1 GB at FP16 with 8,192 tokens of context and one request. Each total below is the weights plus the FP16 KV cache and the runtime overhead (0.5 GB plus 10%), and each row opens the calculator with that setting. What the GGUF names mean.
| Precision | Weights | Total | Smallest setup |
|---|---|---|---|
| As published (BF16) | 14.9 GB | 17.1 GB | RTX 3090 (24 GB) |
| FP16 / BF16 | 14.9 GB | 17.1 GB | RTX 3090 (24 GB) |
| FP8 / INT8 | 7.45 GB | 8.87 GB | RTX 3060 12GB |
| INT4 (AWQ / GPTQ) | 3.96 GB | 5.03 GB | RTX 4060 8GB |
| GGUF Q8_0 | 7.91 GB | 9.38 GB | RTX 3060 12GB |
| GGUF Q6_K | 6.11 GB | 7.40 GB | RTX 4060 8GB |
| GGUF Q5_K_M | 5.28 GB | 6.49 GB | RTX 4060 8GB |
| GGUF Q4_K_M | 4.51 GB | 5.64 GB | RTX 4060 8GB |
| GGUF IQ4_XS | 4.05 GB | 5.13 GB | RTX 4060 8GB |
| GGUF Q3_K_M | 3.64 GB | 4.68 GB | RTX 4060 8GB |
| GGUF IQ3_XXS | 3.07 GB | 4.06 GB | RTX 4060 8GB |
| GGUF Q2_K | 3.12 GB | 4.11 GB | RTX 4060 8GB |
Fine-tuning Gemma 4 E4B? Gemma 4 E4B VRAM for LoRA, QLoRA and full training.
Gemma 4 E4B GGUF files on Hugging Face
The 8 GGUF files llama.cpp picks for Gemma 4 E4B with -hf <repo>:<QUANT>, with the bytes the Hugging Face file list reported on 2026-09-29. Each total is that file plus the FP16 KV cache and 0.5 GB + 10%, one request. "vs estimate" compares the file with the bits-per-weight size the table above uses.
| Quant | File | Size | vs estimate | 8K | 32K | 128K |
|---|---|---|---|---|---|---|
| Q3_K_M | unsloth/ | 3.78 GB4,058,137,728 bytes | +4% | 4.84 GB | 5.25 GB | 6.90 GB |
| Q2_K | bartowski/ | 4.15 GB4,458,093,024 bytes | +33% | 5.25 GB | 5.66 GB | 7.31 GB |
| IQ4_XS | unsloth/ | 4.39 GB4,715,416,704 bytes | +8% | 5.51 GB | 5.92 GB | 7.57 GB |
| Q4_K_M | unsloth/ | 4.64 GB4,977,171,584 bytes | +3% | 5.78 GB | 6.19 GB | 7.84 GB |
| Q5_K_M | unsloth/ | 5.11 GB5,481,798,784 bytes | −3% | 6.30 GB | 6.71 GB | 8.36 GB |
| Q6_K | unsloth/ | 6.59 GB7,074,929,792 bytes | +8% | 7.93 GB | 8.34 GB | 9.99 GB |
| Q8_0 | ggml-org/ | 7.48 GB8,031,242,688 bytes | −5% | 8.91 GB | 9.32 GB | 11.0 GB |
| BF16 | ggml-org/ | 14.0 GB15,053,097,408 bytes | −6% | 16.1 GB | 16.5 GB | 18.2 GB |
GB here is GiB (1024³ bytes), as everywhere on this site; Hugging Face shows the Q4_K_M file as 5.0 GB, in 10⁹ bytes.
Which Gemma 4 E4B GGUF fits a 16, 24, 32, 48 or 80 GB GPU or a Mac
From the file sizes above: the largest file that fits each machine with an 8K context and 0.5 GB left free, the longest context it then has room for, and the longest context for Q4_K_M (4.64 GB). One request, FP16 KV cache, -np 1.
| Hardware | Largest GGUF, 8K | Its longest context | Q4_K_M, longest context |
|---|---|---|---|
| RTX 5060 Ti 16GB | Q8_0, 7.48 GB | 128K (full) | 128K (full) |
| RTX 4090 (24 GB) | BF16, 14.0 GB | 128K (full) | 128K (full) |
| RTX 5090 (32 GB) | BF16, 14.0 GB | 128K (full) | 128K (full) |
| L40S (48 GB) | BF16, 14.0 GB | 128K (full) | 128K (full) |
| H100 SXM (80 GB) | BF16, 14.0 GB | 128K (full) | 128K (full) |
| M4 Pro Mac (64 GB, 48 GB usable) | BF16, 14.0 GB | 128K (full) | 128K (full) |
| M4 Max Mac (128 GB, 96 GB usable) | BF16, 14.0 GB | 128K (full) | 128K (full) |
Run Gemma 4 E4B with llama.cpp or Ollama
llama-server -hf unsloth/gemma-4-E4B-it-GGUF:Q4_K_M -c 131072 -np 1 gemma-4-E4B-it-Q4_K_M.gguf, 5.0 GB, from unsloth/
ollama run gemma4:e4b
Ollama library tag gemma4:e4b; its quant is Ollama's choice. Same context: /set parameter num_ctx 131072.
Gemma 4 E4B at 8K, 32K and 128K (full) tokens of context
4 of its 42 layers use full attention, 20 keep a sliding window of 512 tokens and 18 reuse the cache of earlier layers. Each extra token of context adds 16 KB of FP16 cache per request once the sliding windows are full. The last column is the smallest setup here, one card or a group, that holds it at Q4_K_M. How the KV cache works.
| Context | KV cache, FP16 | Total at Q4_K_M | Total at Q8_0 | Smallest setup, Q4_K_M |
|---|---|---|---|---|
| 8K tokens | 168 MB | 5.64 GB | 9.38 GB | RTX 4060 8GB |
| 32K tokens | 552 MB | 6.05 GB | 9.80 GB | RTX 4060 8GB |
| 128K tokens | 2.04 GB | 7.70 GB | 11.4 GB | RTX 4060 8GB |
How fast Gemma 4 E4B writes
Tokens per second for one request with 8,192 tokens of context, estimated from memory bandwidth. A dash means it does not fit on one card. Try other settings in the speed calculator.
| Hardware | Bandwidth | Q4_K_M | FP8 |
|---|---|---|---|
| RTX 3060 12GB | 360 GB/s | 37–52 | 23–33 |
| RTX 4090 | 1,008 GB/s | 95–140 | 62–88 |
| RTX 5090 | 1,792 GB/s | 152–236 | 102–152 |
| M4 Max Mac (128 GB) | 546 GB/s | 55–78 | 35–49 |
| M3 Ultra Mac Studio (512 GB) | 819 GB/s | 79–115 | 51–72 |
| H100 SXM | 3,350 GB/s | 237–401 | 168–266 |
| H200 | 4,800 GB/s | 294–528 | 218–361 |
Longest context on one GPU
How many tokens of context Gemma 4 E4B fits on a single card with one request, an FP16 KV cache and 0.5 GB left free. "Full" means the model's whole context window fits.
| GPU | Memory | Q4_K_M | Q8_0 | FP8 |
|---|---|---|---|---|
| RTX 3060 | 12 GB | 128K (full) | 128K (full) | 128K (full) |
| RTX 4060 Ti 16GB | 16 GB | 128K (full) | 128K (full) | 128K (full) |
| RTX 3090 / 4090 | 24 GB | 128K (full) | 128K (full) | 128K (full) |
| RTX 5090 | 32 GB | 128K (full) | 128K (full) | 128K (full) |
| A100 40GB | 40 GB | 128K (full) | 128K (full) | 128K (full) |
| Mac, 64 GB unified memory | 48 GB | 128K (full) | 128K (full) | 128K (full) |
| L40S / RTX 6000 Ada | 48 GB | 128K (full) | 128K (full) | 128K (full) |
| A100 / H100 80GB | 80 GB | 128K (full) | 128K (full) | 128K (full) |
| Mac, 128 GB unified memory | 96 GB | 128K (full) | 128K (full) | 128K (full) |
| H200 | 141 GB | 128K (full) | 128K (full) | 128K (full) |
| B200 | 180 GB | 128K (full) | 128K (full) | 128K (full) |
Model details
- Parameters
- 8.0B (7,996,156,490)
- Layers
- 4 of its 42 layers use full attention, 20 keep a sliding window of 512 tokens and 18 reuse the cache of earlier layers
- Attention cache
- 2 KV heads × 512
- Sliding-window layers
- 2 KV heads × 256
- Context length
- 131,072 tokens
- Published weights
- 14.9 GB (BF16)
- On Hugging Face
- google/
gemma-4-E4B-it
Why this estimate looks this way
At Q4_K_M and an 8K-token context, Gemma 4 E4B uses 4.51 GB for weights, 168 MB for its FP16 KV cache and 990 MB for estimated runtime overhead, totaling 5.64 GB. The overhead is a 0.5 GB base plus 10% of weights and cache.
Its attention layout matters for long context: 4 of its 42 layers use full attention, 20 keep a sliding window of 512 tokens and 18 reuse the cache of earlier layers. The FP16 cache grows by about 16 KB per additional token per request once the sliding windows are full.
The architecture and published checkpoint size come from the model's config.json and weight files. These are estimates rather than measured peak memory; inference engines can reserve extra buffers or preallocate the full configured cache.
Gemma 4 E4B next to similar-sized models
The three models here closest to it in parameter count, at Q4_K_M with 8,192 tokens of context.
| Model | Parameters | Total | KV per token | Smallest setup |
|---|---|---|---|---|
| Gemma 4 E4B | 8.0B | 5.64 GB | 16 KB | RTX 4060 8GB |
| Llama 3.1 8B | 8.0B | 6.58 GB | 128 KB | RTX 4060 8GB |
| Ling 3.0 Tiny 7.9B-A1.3B | 7.9B, 1.3B active | 5.45 GB | 7 KB | RTX 4060 8GB |
| Qwen3 8B | 8.2B | 6.81 GB | 144 KB | RTX 4060 8GB |
Gemma 4 E4B VRAM questions
How much VRAM do I need to run Gemma 4 E4B locally?
About 5.64 GB at Q4_K_M with an 8K context and one request, by the bits-per-weight estimate, and 17.1 GB at BF16. The Q4_K_M GGUF gemma-4-E4B-it-Q4_K_M.gguf in unsloth/
Can I run Gemma 4 E4B on a 24 GB GPU?
Yes. On the RTX 4090 (24 GB), the largest listed GGUF that fits with an 8K context and 0.5 GB free is BF16 (14.0 GB), with its full 128K-token context.
Which quantization of Gemma 4 E4B fits in 16 GB of VRAM?
On the RTX 5060 Ti 16GB, the largest listed GGUF that fits with an 8K context and 0.5 GB free is Q8_0 (7.48 GB), with its full 128K-token context.
Can I run Gemma 4 E4B on a Mac?
On the M4 Pro Mac (64 GB, 48 GB usable), the largest listed GGUF that fits with an 8K context and 0.5 GB free is BF16 (14.0 GB), with its full 128K-token context. On the M4 Max Mac (128 GB, 96 GB usable), the largest listed GGUF that fits with an 8K context and 0.5 GB free is BF16 (14.0 GB), with its full 128K-token context. By default macOS lets the GPU use about 75% of unified memory.
How much more VRAM does Gemma 4 E4B need for 32K or 128K tokens of context?
Its FP16 KV cache is 168 MB at 8K, 552 MB at 32K, 2.04 GB at 128K for one request, so 128K adds 1.88 GB over 8K, plus 10% overhead. A q8_0 cache
Why does Gemma 4 E4B use more VRAM than its GGUF file size?
The file holds only the weights. At Q4_K_M with an 8K context: 4.64 GB of weights (the file's 4,977,171,584 bytes) + 168 MB of FP16 KV cache + 1,003 MB of compute buffers and runtime (0.5 GB + 10%) = 5.78 GB.
Badge for your model card
Paste it into a Hugging Face or GitHub README; it shows the Q4_K_M total above and links to this page. Q8_0 and FP16 badges.
Numbers read from the model files on Hugging Face on . Compare it with other models in the reproducible model and GPU report.