Codestral 22B

Mistral's 22B code model trained on more than 80 programming languages, with fill in the middle support.

Mistral·22.2B params·56 layers / 8 KV heads·Max 32K ctx·Mistral Non-Production License
Local Run Command
Q4_K_M minimum memory: 17.2 GB at 16K context.
Artificial Analysis Benchmarkartificialanalysis.ai ↗
Intelligence Index
—

Independent benchmark scores sourced from Artificial Analysis.

OpenRouter API & Cloud GPU
No live OpenRouter route synced.

VRAM by Quantization (16K context)

Q4_K_M (4-bit)12.4 GB
estimate
3.5 GB17.2 GB15.5 GBBest speed-to-quality balance for local inference (~98% quality)
Q6_K (6-bit)17.0 GB
estimate
3.5 GB22.0 GB20.3 GBNear-lossless quality with ~35% larger footprint than Q4
Q8_0 (8-bit)22.0 GB
estimate
3.5 GB27.3 GB25.5 GBVirtually indistinguishable from FP16 for coding & reasoning
FP16 / BF16 (16-bit)41.5 GB
estimate
3.5 GB47.6 GB45.8 GBFull native precision; standard for production GPU serving

Layer and head counts are read from the published config.json. KV cache is exact for this architecture.

Run Codestral 22B with Ollama, LM Studio, llama.cpp, MLX or vLLM

Command
Ollama
Q4_K_M
12.4 GB
estimate
LM Studio
Q4_K_M
lmstudio-community/Codestral-22B-v0.1-GGUF
12.4 GB
real file size
llama.cpp
Q4_K_M
lmstudio-community/Codestral-22B-v0.1-GGUF
12.4 GB
real file size
MLX
4-bit
mlx-community/Codestral-22B-v0.1-4bit
11.7 GB
real file size
vLLM
INT4
13.5 GB
estimate
No INT4 build of this model found for vLLM.

Each runtime loads its own build of the model, so download sizes differ. Sizes marked as real are file sizes read from the Ollama registry or Hugging Face.

Hardware Compatibility Matrix (Q4_K_M · 16K context)

Details
11.5 GBToo large——Codestral 22B on M1 16GB →
48.0 GBFits comfortably17.0–23 tok/s—Codestral 22B on M1 Max 64GB →
98.0 GBFits comfortably30–41 tok/s—Codestral 22B on M1 Ultra 128GB →
18.0 GBTight fit5.4–7.4 tok/s—Codestral 22B on M2 24GB →
48.0 GBFits comfortably20–28 tok/s—Codestral 22B on M2 Max 64GB →
152 GBFits comfortably34–46 tok/s—Codestral 22B on M2 Ultra 192GB →
27.0 GBFits comfortably8.4–11.3 tok/s—Codestral 22B on M3 Pro 36GB →
48.0 GBFits comfortably21–28 tok/s—Codestral 22B on M3 Max 64GB →
98.0 GBFits comfortably21–28 tok/s—Codestral 22B on M3 Max 128GB →
11.5 GBToo large——Codestral 22B on M4 16GB →
24.0 GBFits comfortably6.4–8.7 tok/s—Codestral 22B on M4 32GB →
36.0 GBFits comfortably14.8–20 tok/s—Codestral 22B on M4 Pro 48GB →
48.0 GBFits comfortably14.8–20 tok/s—Codestral 22B on M4 Pro 64GB →
48.0 GBFits comfortably28–37 tok/s—Codestral 22B on M4 Max 64GB →
98.0 GBFits comfortably28–37 tok/s—Codestral 22B on M4 Max 128GB →
98.0 GBFits comfortably28–37 tok/s—Codestral 22B on Studio M4 Max 128GB →
204 GBFits comfortably34–46 tok/s—Codestral 22B on M3 Ultra 256GB →
430 GBFits comfortably34–46 tok/s—Codestral 22B on M3 Ultra 512GB →
24.0 GBFits comfortably10.6–14.3 tok/s—Codestral 22B on M1 Pro 32GB →
24.0 GBFits comfortably10.9–14.8 tok/s—Codestral 22B on M2 Pro 32GB →
27.0 GBFits comfortably16.8–23 tok/s—Codestral 22B on M3 Max 36GB →
11.5 GBToo large——Codestral 22B on Air M4 16GB →
24.0 GBFits comfortably6.4–8.7 tok/s—Codestral 22B on Air M4 32GB →
18.0 GBTight fit14.1–19.0 tok/s—Codestral 22B on M4 Pro 24GB →
11.5 GBToo large——Codestral 22B on Air M5 16GB →
24.0 GBFits comfortably8.7–11.8 tok/s—Codestral 22B on Air M5 32GB →
48.0 GBFits comfortably19.2–26 tok/s—Codestral 22B on M5 Pro 64GB →
98.0 GBFits comfortably37–50 tok/s—Codestral 22B on M5 Max 128GB →
24.0 GBFits comfortably9.9–13.5 tok/s—Codestral 22B on mini M6 32GB →
48.0 GBFits comfortably19.2–26 tok/s—Codestral 22B on mini M5 Pro 64GB →
98.0 GBFits comfortably37–50 tok/s—Codestral 22B on Studio M5 Max 128GB →
430 GBFits comfortably68–92 tok/s—Codestral 22B on Studio M5 Ultra 512GB →
11.2 GBToo large—2×Codestral 22B on RTX 3060 12GB →
9.2 GBToo large—2×Codestral 22B on RTX 3080 10GB →
22.8 GBFits comfortably43–59 tok/s1×Codestral 22B on RTX 3090 24GB →
15.0 GBPartial offload3.1–7.3 tok/s2×Codestral 22B on RTX 4060 Ti 16GB →
15.0 GBPartial offload6.1–12.0 tok/s2×Codestral 22B on RTX 4070 Ti S 16GB →
15.0 GBPartial offload6.5–12.0 tok/s2×Codestral 22B on RTX 4080 S 16GB →
22.8 GBFits comfortably50–68 tok/s1×Codestral 22B on RTX 4090 24GB →
15.0 GBPartial offload7.4–12.0 tok/s2×Codestral 22B on RTX 5070 Ti 16GB →
15.0 GBPartial offload7.7–12.0 tok/s2×Codestral 22B on RTX 5080 16GB →
30.5 GBFits comfortably86–117 tok/s1×Codestral 22B on RTX 5090 32GB →
22.8 GBFits comfortably55–74 tok/s1×Codestral 22B on RX 7900 XTX 24GB →
15.0 GBPartial offload5.8–12.0 tok/s2×Codestral 22B on RX 9070 XT 16GB →
10.2 GBToo large—2×Codestral 22B on RTX 2080 Ti 11GB →
7.3 GBToo large—3×Codestral 22B on RTX 3060 Ti 8GB →
7.3 GBToo large—3×Codestral 22B on RTX 3070 8GB →
11.2 GBToo large—2×Codestral 22B on RTX 3080 Ti 12GB →
22.8 GBFits comfortably50–67 tok/s1×Codestral 22B on RTX 3090 Ti 24GB →
7.3 GBToo large—3×Codestral 22B on RTX 4060 8GB →
7.3 GBToo large—3×Codestral 22B on RTX 4060 Ti 8GB →
11.2 GBToo large—2×Codestral 22B on RTX 4070 12GB →
11.2 GBToo large—2×Codestral 22B on RTX 4070 S 12GB →
11.2 GBToo large—2×Codestral 22B on RTX 4070 Ti 12GB →
15.0 GBPartial offload6.4–12.0 tok/s2×Codestral 22B on RTX 4080 16GB →
15.0 GBPartial offload4.5–10.5 tok/s2×Codestral 22B on RTX 5060 Ti 16GB →
11.2 GBToo large—2×Codestral 22B on RTX 5070 12GB →
15.0 GBPartial offload5.7–12.0 tok/s2×Codestral 22B on RX 7800 XT 16GB →
18.9 GBTight fit34–46 tok/s1×Codestral 22B on RX 7900 XT 20GB →
15.0 GBPartial offload5.8–12.0 tok/s2×Codestral 22B on RX 9070 16GB →
15.0 GBPartial offload3.0–7.1 tok/s2×Codestral 22B on RX 9060 XT 16GB →
46.2 GBFits comfortably38–52 tok/s1×Codestral 22B on RTX A6000 48GB →
46.2 GBFits comfortably49–66 tok/s1×Codestral 22B on RTX 6000 Ada 48GB →
93.0 GBFits comfortably84–113 tok/s1×Codestral 22B on PRO 6000 96GB →
15.0 GBPartial offload4.5–10.5 tok/s2×Codestral 22B on RTX A4000 16GB →
22.8 GBFits comfortably37–50 tok/s1×Codestral 22B on RTX A5000 24GB →
18.9 GBTight fit19.3–26 tok/s1×Codestral 22B on RTX 4000 Ada 20GB →
30.5 GBFits comfortably32–43 tok/s1×Codestral 22B on RTX 5000 Ada 32GB →
46.2 GBFits comfortably47–78 tok/s1×Codestral 22B on PRO 5000 48GB →
46.2 GBFits comfortably37–50 tok/s1×Codestral 22B on PRO W7900 48GB →
30.5 GBFits comfortably34–46 tok/s1×Codestral 22B on AI PRO R9700 32GB →
22.8 GBFits comfortably16.2–27 tok/s1×Codestral 22B on L4 24GB →
46.2 GBFits comfortably41–56 tok/s1×Codestral 22B on L40S 48GB →
38.5 GBFits comfortably51–85 tok/s1×Codestral 22B on A100 40GB →
77.5 GBFits comfortably56–76 tok/s1×Codestral 22B on A100 80GB →
77.5 GBFits comfortably69–94 tok/s1×Codestral 22B on H100 80GB →
137 GBFits comfortably77–129 tok/s1×Codestral 22B on H200 141GB →
175 GBFits comfortably86–143 tok/s1×Codestral 22B on B200 180GB →
15.0 GBPartial offload3.4–8.0 tok/s2×Codestral 22B on T4 16GB →
46.2 GBFits comfortably33–44 tok/s1×Codestral 22B on A40 48GB →
46.2 GBFits comfortably43–59 tok/s1×Codestral 22B on L40 48GB →
115 GBFits comfortably15.1–20 tok/s—Codestral 22B on DGX Spark 128GB →
96.0 GBFits comfortably13.4–18.2 tok/s—Codestral 22B on Ryzen AI Max+ 395 128GB →
48.0 GBFits comfortably13.4–18.2 tok/s—Codestral 22B on Ryzen AI Max+ 395 64GB →

Frequently asked questions

How much VRAM does Codestral 22B require?

At Q4_K_M quantization with a 16K context window, Codestral 22B needs 17.2 GB total VRAM (12.4 GB weights + 3.5 GB KV cache + runtime overhead). In full FP16 precision, it requires 47.6 GB.

Can an RTX 4090 (24 GB) run Codestral 22B?

Yes. At Q4_K_M with 16K context Codestral 22B needs 17.2 GB, which fits a single 24 GB RTX 4090 at an estimated 50–68 tok/s.

How do I run Codestral 22B locally with Ollama?

Install Ollama and run `ollama run codestral:22b` in your terminal. Make sure your GPU or Apple Silicon unified memory meets the 17.2 GB Q4_K_M requirement.