← All modelsMODEL CHECK

Can I run Codestral 22B?

Codestral 22B by Mistral AI needs around 24 GB of RAM at the recommended 4-bit quantization (13.5 GB download). Your hardware is checked below — instantly, nothing leaves your browser. Expect roughly ~26 tok/s on a Apple M-series Max.

Reading your hardware signals…

Real-world notes

Codestral 22B is Mistral AI's dedicated coding model, built for code completion and generation rather than open-ended chat. At 22.2 billion parameters it is a real step up in size from the 7B-12B models most people start with, and the footprint shows it: a 4-bit quant lands around 13.5 GB and the model wants at least 24 GB of RAM to run comfortably. That puts it out of reach of a 12 GB card like an RTX 3060, where it simply does not fit. A 24 GB GPU such as an RTX 4090, or an Apple Silicon Mac with plenty of unified memory, is the realistic entry point.

On an RTX 4090 you can expect around 64 tokens per second at 4-bit, fast enough that code suggestions feel close to instant. An Apple M-series Max sits lower at roughly 26 tok/s, still usable for interactive editing, while CPU-only on DDR5 drops to about 4 tok/s, which is really only for batch jobs you can walk away from. The context window is 32K, modest by today's standards but generous for most single-file and small-repo work. Fill it completely and you are looking at about 20.1 GB of total memory, so on a 24 GB card a full context leaves little headroom.

Against its stablemates, Codestral is the specialist: Mistral Nemo 12B is the lighter, general-purpose chat pick if you are short on memory, and GPT-OSS 20B generally has the edge for reasoning and conversation. Codestral's standout trait is that it was trained specifically for code across many languages, so for fill-in-the-middle completion and generation it tends to feel more on-target than a same-size generalist. The serious caveat is the license: Codestral ships under Mistral's MNPL, a non-production license, so you cannot use it commercially or in a production product. Treat it as a research and personal-use tool only.

Specifications

Parameters22.2B
Context window32K tokens
ProviderMistral AI
LicenseMNPL (non-production)
Released2024-05
Best forCoding

Size by quantization

QuantizationBits/weightDownloadMin RAMQuality
Q2_K3.359.3 GB16 GBNoticeable loss
Q4_K_MRecommended4.8513.5 GB24 GBRecommended
Q5_K_M5.6515.7 GB24 GBHigh
Q8_08.523.6 GB32 GBNear-original
F161644.4 GB64 GBOriginal

Sizes are estimates from parameter count × bits per weight; real GGUF builds vary slightly. · Data updated: 2026-06-11 · How we calculate these numbers →

Memory needed by context length

ContextKV cache (est.)Total memory (Q4)
4K tokens~0.8 GB~14.3 GB
8K tokens~1.7 GB~15.2 GB
32K tokens~6.6 GB~20.1 GB

The KV cache grows with context length — a model that fits at 4K can run out of memory at 32K. Estimates assume an FP16 cache with grouped-query attention; actual usage varies by runtime.

Estimated speed by hardware

HardwareBandwidth~Speed
NVIDIA RTX 3060 12GB360 GB/sWon't fit in VRAM
NVIDIA RTX 4090 24GB1008 GB/s~64 tok/s
Apple M-series (base)100 GB/s~6 tok/s
Apple M-series Pro270 GB/s~17 tok/s
Apple M-series Max410 GB/s~26 tok/s
CPU only (dual-channel DDR5)60 GB/s~4 tok/s

Token generation is memory-bandwidth bound: tok/s ≈ bandwidth × 0.85 ÷ model size at Q4. Real-world numbers vary by runtime and context length.

Run it locally

The easiest path is Ollama — one command and you're chatting:

ollama run codestral

Frequently asked questions