Codestral-7|22B
FreeOpen-weight AI code model fluent in 80+ programming languages
FreeFree tier
About Codestral-7|22B
Codestral is Mistral AI's first open-weight generative AI model specialized for code generation. Trained on over 80 programming languages, it excels at completing functions, writing tests, and filling in partial code using a fill-in-the-middle mechanism. With a 22B parameter size and a 32k context window, Codestral offers competitive performance against larger models. It is available under a non-production license for research and testing, with a free beta endpoint for 8 weeks via codestral.mistral.ai, and also accessible through Mistral's API platform with token-based billing. The model can be downloaded from HuggingFace.
Key Features
Open-weight generative AI model designed for code generation
Trained on 80+ programming languages (Python, Java, C++, JavaScript, Bash, Swift, Fortran, etc.)
Fill-in-the-middle mechanism for code completion
22B parameters with 32k context window
Outperforms competitors on RepoBench for long-range repository-level code completion
Supports both instruction and completion via shared API endpoint
Available as free endpoint during 8-week beta period (waitlist gated)
Also accessible via Mistral's API platform (la Plateforme) with per-token billing
Downloadable from HuggingFace under Mistral AI Non-Production License
Can generate tests and complete partial code
Pros & Cons
Pros
- Open-weight model freely available for research and testing
- Free beta endpoint for 8 weeks with personal API key
- Supports an extensive range of 80+ programming languages
- Large 32k context window handles long code contexts
- Competitive performance on code benchmarks (HumanEval, MBPP, Spider, RepoBench)
- Fill-in-the-middle capability for precise code insertion
Cons
- Non-Production License restricts commercial use without separate license
- Free beta endpoint is temporary (8 weeks) and waitlist-gated
- 22B model requires significant computational resources for local deployment
- Commercial license availability is on-demand, costs not disclosed
- No explicit mention of multi-turn conversational abilities beyond code
Best For
Code generation and completion in 80+ programming languagesWriting unit tests for codebasesFill-in-the-middle for partial code snippetsIDE plugin integration for developersBatch code generation and research projectsBuilding AI-powered coding assistantsAPI development where custom code generation is needed
FAQ
What is Codestral?
Codestral is Mistral AI's first open-weight generative AI model specifically designed for code generation tasks, trained on over 80 programming languages.
Under what license is Codestral available?
Codestral is released under the Mistral AI Non-Production License, which allows use for research and testing. Commercial licenses are available on demand.
How can I access Codestral?
You can use the dedicated endpoint codestral.mistral.ai (free during an 8-week beta, waitlist-gated) or the API platform at api.mistral.ai with per-token billing. The model is also downloadable from HuggingFace.
What programming languages does Codestral support?
Codestral is trained on a diverse dataset of 80+ programming languages, including popular ones like Python, Java, C, C++, JavaScript, Bash, as well as more specific ones like Swift and Fortran.
What is the context window size of Codestral?
Codestral has a 32k context window, which is larger than many competing models (typically 4k to 16k).
Can I use Codestral commercially?
The model itself is under a Non-Production License. Commercial licenses are available on demand by contacting the Mistral AI team.