Codestral-22B
Mistral's dedicated 22B open-weight code generation and fill-in-the-middle model with 32K context, fluent in over 80 programming languages.
The brutal truth
Superb code generation and fill-in-the-middle accuracy, but the MNPL license prevents production commercial SaaS deployment without contacting Mistral.
Files and Versions
Direct inspected tree artifacts from Hugging Face. Verified filenames, exact byte sizes, model weight shards, and configuration definitions.
mistralai/Codestral-22B-v0.1Files and versions are hosted on Hugging Face. You can view all branches, commits, model weights, and tokenizer artifacts directly.
Inspect mistralai/Codestral-22B-v0.1 /tree/main↗Decision matrix
✓ RUN / USE THIS IF…
- •You want local IDE completion for personal projects
- •You have a 16GB VRAM GPU
- •You value native FIM cursor prediction
- •Your 24GB GPU comfortably fits the model weights (~14GB VRAM) with dedicated headroom for inference.
✕ WALK AWAY IF…
- •You need unencumbered Apache 2.0 commercial rights
- •You need 128K+ repository context
- •Your GPU has less than 14GB VRAM and you cannot tolerate slow CPU/system RAM offload paging.
- •You prefer a plug-and-play web app interface and don't want to manage local model checkpoints, drivers, or runtimes.
True cost of ownership
About
Mistral's dedicated 22B open-weight code generation and fill-in-the-middle model with 32K context, fluent in over 80 programming languages.
What it does
Download the weights from Hugging Face, pick a quantisation that matches your GPU, and run it locally with Ollama, llama.cpp, vLLM, or a compatible runtime. Fill-in-the-middle & IDE autocompletion runs on your own hardware — no per-token bill, no third-party data handling.
Key features
Native Fill-in-the-Middle (FIM) support for IDE cursor insertion
Very strong Python, Java, and C++ generation
Fits inside 16GB VRAM at Q4_K_M
Use cases
Inline edits, refactors, and test generation inside the editor.
Flag null-safety, security, and style issues before merge.
Turn long procedural functions into typed, testable modules.
Generate integration tests from route definitions and schemas.
Quantization & Hardware Fit
VRAM Hardware Compatibility & Memory Allocation
| Quant | VRAM | Quality / Fit on 24GB | Install / Run Command (OLLAMA) | |
|---|---|---|---|---|
| Q4_K_M● ACTIVE | 14 GB | Standard · ✓ Fits (10GB spare) | ollama run codestral:22b | |
| Q5_K_M | 16 GB | Standard · ✓ Fits (8GB spare) | ollama run codestral:22b | |
| Q8_0 | 24 GB | Standard · ✓ Fits (0GB spare) | ollama run codestral:22b | |
| FP16 | 44 GB | Standard · ✕ Needs 44GB | ollama run codestral:22b |
Buyer doubts, cleared
Can I actually run Codestral-22B on my 24GB GPU?
What's the fine print on the license?
Does the 32K tokens actually hold up in practice?
User reviews
The Q4_K_M build is the sweet spot. Anything larger needs serious hardware for marginal quality gains.
Switched our internal workflow to Codestral-22B after the last pricing change. Nobody noticed a quality difference, and the bill dropped by half.
Solid for fill-in-the-middle & ide autocompletion. The learning curve is real but the payoff is there. Start with the smaller build first.
Clean interface, consistent results once you land on a prompt you like. Wish there were more export presets for client handoffs.