Overview
Codestral is Mistral AI's dedicated code-generation model — trained specifically for coding tasks from the ground up, rather than adapted from a general-purpose model. Released in May 2024, it achieves a HumanEval score of 91.1, placing it among the best code-generation models available. What distinguishes Codestral from general models that also do code is depth: it was trained on over 80 programming languages and optimised specifically for the patterns, idioms, and workflows that developers encounter in practice.
Trained on 80+ Programming Languages
Most LLMs learn to code incidentally — code was in the training data, so they learned some patterns. Codestral was built with code as the primary objective. Its training corpus covers over 80 languages with particular depth in the most widely used ones:
- Systems languages: C, C++, Rust, Go
- Web development: JavaScript, TypeScript, HTML, CSS
- Data and ML: Python, R, Julia, SQL
- JVM languages: Java, Kotlin, Scala
- Mobile: Swift, Dart (Flutter), Objective-C
- Scripting: Bash, PowerShell, Ruby, Perl
- Infrastructure: Terraform, Dockerfile, Kubernetes YAML
This breadth means it handles language-switching tasks (e.g., "translate this Python to TypeScript") with higher reliability than models that only saw code in passing.
Fill-in-the-Middle (FIM)
One of Codestral's most important capabilities is fill-in-the-middle (FIM) — the ability to complete code given both the prefix (what comes before the cursor) and the suffix (what comes after). This is the technique that powers IDE code completion, where the model must predict what belongs in the middle of existing code rather than just appending to the end.
FIM is what makes Codestral actually useful in a real coding environment:
- Complete a function body given its signature and the calling code below.
- Insert missing logic between two existing blocks.
- Fill in parameters, return statements, or error handling in context.
General chat models that don't specifically support FIM produce noticeably worse IDE completion results.
IDE Integrations
Codestral is integrated into several popular coding tools:
- continue.dev: Open-source IDE extension for VS Code and JetBrains. Set Codestral as your autocomplete and chat model.
- Cursor: AI-first code editor supports Codestral via the Mistral API as an autocomplete backend.
- Tabnine: Integrates Mistral models including Codestral for enterprise code completion.
- VS Code via REST: Direct integration via the Mistral API with the official VS Code Mistral extension.
Free for Non-Commercial Use
Codestral is available free of charge for non-commercial use through Mistral's La Plateforme under a separate non-commercial license. This makes it accessible for:
- Open-source projects and personal development.
- Academic research and education.
- Prototyping and evaluation.
For commercial use, the paid API is priced at $0.20 per million input tokens and $0.60 per million output tokens — competitive with other code-specialist models.
Best Use Cases
- IDE code completion: FIM-powered autocomplete that understands the surrounding context, not just what came before the cursor.
- Code generation from natural language: Write a description, get working code across any of 80+ languages.
- Code translation: Convert code between languages (e.g., Python to JavaScript, SQL dialect migration).
- Code review and explanation: Identify bugs, explain what code does, suggest improvements.
- Test generation: Write unit tests for existing functions, including edge cases.
- Documentation generation: Turn code into docstrings, README sections, and API documentation.
Access
Available via the Mistral API (La Plateforme) for both free (non-commercial) and paid (commercial) tiers. Integrates natively with continue.dev, Cursor, and other coding tools through the Mistral API endpoint.