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 23 quants, from 8.9 GB (IQ1_S) to 32.7 GB (Q6_K). Longer context needs more: at 32K tokens the KV cache alone adds about 25.0 GB.
Gemma 3 40b is a 39.8B-parameter Gemma model in GGUF format, quantized by mradermacher. Its trained context length is 128K tokens. The repository has 23 quant files, from 8.9 GB (IQ1_S) to 32.7 GB (Q6_K).
Quants & memory
| Quant | File | Est. memory | vs VRAM | Result | |
|---|---|---|---|---|---|
| IQ1_S | 8.9 GB | 15.7 GB | Too big | Get file → | |
| IQ1_M | 9.7 GB | 16.5 GB | Too big | Get file → | |
| 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_S | 14.1 GB | 20.8 GB | Too big | Get file → | |
| Q2_K | 15.2 GB | 21.9 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 → | |
| IQ3_S | 17.7 GB | 24.4 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 → | |
| 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_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 → | |
| Q6_K | 32.7 GB | 39.4 GB | Too big | Get file → |
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: the best quant that fits is IQ1_S (8.9 GB file, about 15.7 GB in use).
- 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 (32.7 GB file, about 39.4 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.
If memory is tight, the smallest file is IQ1_S at 8.9 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 15.7 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: IQ1_S is 8.9 GB, IQ1_M is 9.7 GB, IQ2_XXS is 11.0 GB, IQ2_XS is 12.2 GB, IQ2_S is 12.7 GB, IQ2_M is 13.8 GB and 17 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 mradermacher/gemma-3-40b-i1-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.