Gemma 3 40b needs about 31.0 GB of memory at Q4_K_M (a 24.3 GB file) with an 8K context window, so it fits on a 32 GB GPU. This repository has 27 quants, from 11.0 GB (IQ2_XXS) to 79.6 GB (BF16). Longer context needs more: at 32K tokens the KV cache alone adds about 25.0 GB.
Gemma 3 40b – a large language model with 39.8B parameters
Gemma 3 40b is a 39.8B parameter model trained on 131072 context tokens. It is available in multiple GGUF quantizations from IQ2_XXS to BF16. The model supports a wide range of languages and tasks.
Good at
- Large context handling
- High token throughput
- Versatile language support
Limits
- No vision support
- Requires large VRAM for higher quants
- License is gemma
Best for
- Long-form content generation
- Complex reasoning tasks
- Large context analysis
Who it’s for. Developers and researchers needing a large language model with extensive context. Suitable for applications that can accommodate the memory requirements of higher‑precision quants.
Quants & memory
| Quant | File | Est. memory | vs VRAM | Result | |
|---|---|---|---|---|---|
| IQ2_XXS | 11.0 GB | 17.8 GB | Too big | Get file → | |
| IQ2_XS | 12.2 GB | 18.9 GB | Too big | Get file → | |
| IQ2_S | 12.7 GB | 19.4 GB | Too big | Get file → | |
| IQ2_M | 13.8 GB | 20.5 GB | Too big | Get file → | |
| Q2_K | 15.2 GB | 21.9 GB | Too big | Get file → | |
| Q2_K_L | 15.5 GB | 22.3 GB | Too big | Get file → | |
| IQ3_XXS | 15.6 GB | 22.3 GB | Too big | Get file → | |
| IQ3_XS | 16.8 GB | 23.5 GB | Too big | Get file → | |
| Q3_K_S | 17.7 GB | 24.4 GB | Too big | Get file → | |
| IQ3_M | 18.2 GB | 25.0 GB | Too big | Get file → | |
| Q3_K_M | 19.6 GB | 26.3 GB | Too big | Get file → | |
| Q3_K_L | 21.2 GB | 28.0 GB | Too big | Get file → | |
| IQ4_XS | 21.6 GB | 28.3 GB | Too big | Get file → | |
| Q3_K_XL | 21.6 GB | 28.3 GB | Too big | Get file → | |
| IQ4_NL | 22.8 GB | 29.5 GB | Too big | Get file → | |
| Q4_0 | 22.8 GB | 29.6 GB | Too big | Get file → | |
| Q4_K_S | 22.9 GB | 29.7 GB | Too big | Get file → | |
| Q4_K_M | 24.3 GB | 31.0 GB | Too big | Get file → | |
| Q4_K_L | 24.6 GB | 31.4 GB | Too big | Get file → | |
| Q4_1 | 25.2 GB | 31.9 GB | Too big | Get file → | |
| Q5_K_S | 27.6 GB | 34.3 GB | Too big | Get file → | |
| Q5_K_M | 28.3 GB | 35.1 GB | Too big | Get file → | |
| Q5_K_L | 28.7 GB | 35.4 GB | Too big | Get file → | |
| Q6_K | 32.7 GB | 39.4 GB | Too big | Get file → | |
| Q6_K_L | 33.0 GB | 39.8 GB | Too big | Get file → | |
| Q8_0 | 42.3 GB | 49.1 GB | Too big | Get file → | |
| BF16 | 79.6 GB (2 parts) | 86.4 GB | Too big | Get file → |
For 8 GB VRAM, use IQ2_XXS (file size 11.04 GB, estimated 17.8 GB memory). For 16 GB VRAM, Q4_K_M (24.27 GB, 31 GB memory) is a good balance. For 32 GB VRAM, Q6_K (32.67 GB, 39.4 GB memory) provides higher precision.
What GPU do you need for Gemma 3 40b?
These figures add the file size, an fp16 KV cache at an 8K context window (worked out from this model’s own header) and about 0.5 GB for the runtime. They are estimates, so leave a little headroom, and expect to use less context or a smaller quant if you are right at the limit.
- 4 GB VRAM: no quant fits at an 8K context.
- 6 GB VRAM: no quant fits at an 8K context.
- 8 GB VRAM: no quant fits at an 8K context.
- 12 GB VRAM: no quant fits at an 8K context.
- 16 GB VRAM: no quant fits at an 8K context.
- 24 GB VRAM: the best quant that fits is IQ3_XS (16.8 GB file, about 23.5 GB in use).
- 32 GB VRAM: the best quant that fits is Q4_1 (25.2 GB file, about 31.9 GB in use).
- 48 GB VRAM: the best quant that fits is Q6_K_L (33.0 GB file, about 39.8 GB in use).
Which Gemma 3 40b quant should you choose?
Q4_K_M is the usual starting point for Gemma 3 40b: it balances file size and quality well. Here it is a 24.3 GB file.
The Q8_0 file is 42.3 GB, about 1.7 times the size of Q4_K_M. It keeps the weights closer to the original, which only matters if you have the memory to spare.
If memory is tight, the smallest file is IQ2_XXS at 11.0 GB, with the quality trade-offs that come with fewer bits. Use it only when memory is very tight. Expect a clear drop in quality, which is usually worse on small models and easier to live with on large ones.
New to quant names? Read GGUF quantization explained.
Specifications
Architecture from the GGUF header
Source
Frequently asked questions about Gemma 3 40b
How much VRAM does Gemma 3 40b need?
About 31.0 GB at Q4_K_M with an 8K context window. That is the 24.3 GB file, plus the KV cache and roughly 0.5 GB of runtime overhead. Smaller quants need less and longer context needs more.
Can I run Gemma 3 40b on an 8 GB GPU?
Not at an 8K context. The smallest file needs about 17.8 GB, so you would need a larger GPU or CPU offloading.
What is the file size of Gemma 3 40b GGUF?
It depends on the quant: IQ2_XXS is 11.0 GB, IQ2_XS is 12.2 GB, IQ2_S is 12.7 GB, IQ2_M is 13.8 GB, Q2_K is 15.2 GB, Q2_K_L is 15.5 GB and 21 more.
What context length does Gemma 3 40b support?
The GGUF header lists a trained context length of 131,072 tokens (128K). The KV cache grows with the context you use: about 6.2 GB at 8K and 25.0 GB at 32K.
Where can I download Gemma 3 40b GGUF?
The files are on Hugging Face in the bartowski/ddh0_gemma-3-40b-GGUF repository. The download buttons on this page open the file on Hugging Face. ggufmodels.com does not host any model files.
What license does Gemma 3 40b use?
Hugging Face lists the license as gemma. Licenses can differ between the quantized files and the original model, so check the repository and the base model before commercial use.
Can I run Gemma 3 40b on 8 GB VRAM?
Use the IQ2_XXS quant, which requires about 17.8 GB memory at 8k context.
Which quant gives the best performance for 16 GB VRAM?
Q4_K_M is recommended, needing about 31 GB memory at 8k context.
Is there a quant that fits 32 GB VRAM?
Q6_K fits, with an estimated 39.4 GB memory at 8k context.