Codestral Release
What this is
Codestral is Mistral AI's first code-focused generative model, released May 29, 2024. It is a 22B open-weight model designed explicitly for code generation, completion, and interaction via a shared instruct and fill-in-the-middle API. It supersedes general-purpose Mistral models previously used for coding tasks.
Capabilities
Codestral is trained on 80+ programming languages, including Python, Java, C, C++, JavaScript, Bash, Swift, and Fortran. It supports a 32k context window, which Mistral contrasts with competitor windows of 4k, 8k, or 16k, and attributes its RepoBench lead to this advantage. On Kotlin-HumanEval at T=0.2, a JetBrains researcher reports Codestral scored 73.75, above GPT-4-Turbo at 72.05 and GPT-3.5-Turbo at 54.66. The model supports fill-in-the-middle (FIM) completion and is benchmarked against DeepSeek Coder 33B on FIM tasks across Python, JavaScript, and Java.
Evaluation methodology
Python ability is evaluated on HumanEval pass@1, MBPP sanitised pass@1, CruxEval (output prediction), and RepoBench EM (long-range repository-level completion). SQL performance is assessed using the Spider benchmark. Multilingual performance uses HumanEval pass@1 averaged across C++, Bash, Java, PHP, TypeScript, and C# in addition to Python. The document does not describe contamination controls or details of evaluation infrastructure.
Safety testing
The card does not discuss safety testing, red-teaming, or catastrophic-risk evaluations.
Mitigations
The card does not discuss content classifiers, refusal training, or safety mitigations. Access to the free beta endpoint is gated behind a waitlist, which Mistral describes as ensuring "a good quality of service" rather than as a safety control.
Deployment and access
Codestral is available for download on HuggingFace under the Mistral AI Non-Production License, permitting research and testing; commercial use requires a separate license obtained by contacting Mistral. A dedicated endpoint at codestral.mistral.ai is offered free during an 8-week beta period with waitlist gating and personal-level API keys not subject to organization rate limits. Standard token-billed access is also available at api.mistral.ai. Integrations are available in LlamaIndex, LangChain, Continue.dev, Tabnine, and Sourcegraph Cody, with self-deployment available through Mistral's enterprise offering.
Limitations
The card does not flag any limitations, failure modes, or unsolved problems identified by Mistral.
What's new
Codestral is Mistral AI's first code-specific model release and introduces a new dedicated API endpoint (codestral.mistral.ai). The document contains no version changelog or comparison to a prior Codestral release.