Skip to main content
Back

Mistral's Codestral-22B Beats 70B Rivals at Code on a Single GPU

Mistral's first code specialist packs 22B parameters, 32K context, and native fill-in-the-middle training that beat much larger rivals at launch.

Model, Full Access
  • Mistral's Codestral-22B-v0.1 is a 22.2B dense code model with 32K context and 80+ language support.
  • Hits 81.1% HumanEval and 78.2% MBPP, beating CodeLlama 70B and DeepSeek Coder 33B at a third the size.
  • Native fill-in-the-middle training makes it well-suited for IDE tab-completion, not just chat-style generation.
  • Runs on a single 16-24GB consumer GPU with Q4 quantization; 44GB in full FP16 precision.
  • Released under the restrictive MNPL-0.1 license: research and personal use only, no commercial deployment.
  • Ships with no built-in moderation, so downstream guardrails are the deployer's responsibility.

Mistral's dedicated code model, Codestral-22B-v0.1, remains one of the more interesting mid-sized open-weight coders on Hugging Face. It's a 22.2B parameter dense transformer built specifically for programming, with weights, tokenizer, and inference tooling all available for direct download.

The training corpus covers 80+ programming languages, from the mainstream (Python, Java, C, C++, JavaScript, Bash) to more niche environments like Swift and Fortran. Mistral positions it for both research and practical software engineering work, though the license adds a wrinkle we'll get to shortly.

Two modes, one model

Codestral was trained to be queried two ways, and both matter for real developer workflows:

  • Instruct mode, for answering questions about a snippet (write docs, explain, refactor) or generating code from a prompt.
  • Fill in the Middle (FIM), which predicts tokens between a given prefix and suffix. This is what IDE completions actually need.

FIM being baked into pretraining rather than bolted on afterward is the practical distinction. It's what makes the model behave sensibly for tab-completion inside an editor, where you almost always have code on both sides of the cursor instead of a clean left-to-right prompt.