Codestral-21B-Pruned needs about 15.2 GB of memory at Q4_K_M (a 12.8 GB file) with an 8K context window, so it fits on a 16 GB GPU. This repository has 21 quants, from 4.7 GB (IQ1_S) to 17.6 GB (Q6_K). Longer context needs more: at 32K tokens the KV cache alone adds about 7.2 GB.
21.5B parameter coding model in GGUF format
Codestral-21B-Pruned is a 21.5B parameter model optimized for coding tasks. It is a pruned version of a 22.2B model, retaining quality while reducing size. The model is available in multiple quantizations for different memory budgets.
Good at
- Coding assistance
- Code generation
- Debugging help
Limits
- No vision support
- Large context required
- License is apache-2.0
Best for
- Developers needing code generation
- Automated code review
- Learning new programming languages
Who it’s for. Engineers and developers who need a large language model focused on code. The model is suitable for local deployment on machines with sufficient VRAM and RAM.
Quants & memory
| Quant | File | Est. memory | vs VRAM | Result | |
|---|---|---|---|---|---|
| IQ1_S | 4.7 GB | 7.0 GB | Fits | Get file → | |
| IQ1_M | 5.1 GB | 7.4 GB | Tight | Get file → | |
| IQ2_XXS | 5.8 GB | 8.1 GB | Too big | Get file → | |
| IQ2_XS | 6.4 GB | 8.7 GB | Too big | Get file → | |
| IQ2_S | 6.8 GB | 9.1 GB | Too big | Get file → | |
| IQ2_M | 7.3 GB | 9.7 GB | Too big | Get file → | |
| Q2_K | 8.0 GB | 10.3 GB | Too big | Get file → | |
| IQ3_XXS | 8.3 GB | 10.6 GB | Too big | Get file → | |
| IQ3_XS | 8.9 GB | 11.2 GB | Too big | Get file → | |
| Q3_K_S | 9.3 GB | 11.6 GB | Too big | Get file → | |
| IQ3_S | 9.4 GB | 11.7 GB | Too big | Get file → | |
| IQ3_M | 9.7 GB | 12.0 GB | Too big | Get file → | |
| Q3_K_M | 10.4 GB | 12.7 GB | Too big | Get file → | |
| Q3_K_L | 11.3 GB | 13.6 GB | Too big | Get file → | |
| IQ4_XS | 11.5 GB | 13.8 GB | Too big | Get file → | |
| Q4_0 | 12.2 GB | 14.5 GB | Too big | Get file → | |
| Q4_K_S | 12.2 GB | 14.5 GB | Too big | Get file → | |
| Q4_K_M | 12.8 GB | 15.2 GB | Too big | Get file → | |
| Q5_K_S | 14.8 GB | 17.1 GB | Too big | Get file → | |
| Q5_K_M | 15.2 GB | 17.5 GB | Too big | Get file → | |
| Q6_K | 17.6 GB | 19.9 GB | Too big | Get file → |
For 8‑10 GB VRAM, use IQ1_S or IQ1_M. For 12‑15 GB VRAM, Q4_0 or Q4_K_S are good choices. If you have 20 GB VRAM, consider Q5_K_M or Q6_K for higher quality.
What GPU do you need for Codestral-21B-Pruned?
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: the best quant that fits is IQ1_M (5.1 GB file, about 7.4 GB in use).
- 12 GB VRAM: the best quant that fits is IQ3_M (9.7 GB file, about 12.0 GB in use).
- 16 GB VRAM: the best quant that fits is Q4_K_M (12.8 GB file, about 15.2 GB in use).
- 24 GB VRAM: the best quant that fits is Q6_K (17.6 GB file, about 19.9 GB in use).
Which Codestral-21B-Pruned quant should you choose?
Q4_K_M is the usual starting point for Codestral-21B-Pruned: it balances file size and quality well. Here it is a 12.8 GB file.
If memory is tight, the smallest file is IQ1_S at 4.7 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 Codestral-21B-Pruned
How much VRAM does Codestral-21B-Pruned need?
About 15.2 GB at Q4_K_M with an 8K context window. That is the 12.8 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 Codestral-21B-Pruned on an 8 GB GPU?
Yes, with IQ1_M: the 5.1 GB file needs about 7.4 GB at 8K context. Larger quants in this repository do not fit in 8 GB.
What is the file size of Codestral-21B-Pruned GGUF?
It depends on the quant: IQ1_S is 4.7 GB, IQ1_M is 5.1 GB, IQ2_XXS is 5.8 GB, IQ2_XS is 6.4 GB, IQ2_S is 6.8 GB, IQ2_M is 7.3 GB and 15 more.
What context length does Codestral-21B-Pruned support?
The GGUF header lists a trained context length of 32,768 tokens (32K). The KV cache grows with the context you use: about 1.8 GB at 8K and 7.2 GB at 32K.
Where can I download Codestral-21B-Pruned GGUF?
The files are on Hugging Face in the mradermacher/Codestral-21B-Pruned-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 Codestral-21B-Pruned use?
Hugging Face lists the license as apache-2.0. 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 Codestral-21B-Pruned on 8 GB VRAM?
Yes, use the IQ1_S or IQ1_M quant, which estimate 7–7.4 GB memory at 8k context.
Does this model support image inputs?
No, the model is purely text and does not have vision capabilities.
What license applies to this model?
The model is released under the apache-2.0 license.