Skip to main content
Lesson 1 of 14 · Codestral and Coding Agents: From Devstral to Vibe Code

Introduction to Codestral

Lesson 1 of 14 Updated November 2, 2026 Developer
On this page
  1. Codestral: Mistral AI’s Code-Specialized Model
  2. Why a Code-Specific Model?
  3. Codestral’s Two Endpoints
  4. Supported Languages
  5. Codestral in the Mistral Ecosystem
  6. Key Takeaways

Course updated November 2, 2026. The entire Devstral lineup has been removed from the API (Devstral 2 since July 31, 2026). The code agents section (lessons 5–8) now covers Mistral Small 4, Mistral Large 4, and Vibe Code. Lesson 13 covers local hosting of Devstral Small 2, whose weights remain published. Codestral (codestral-2508) remains generally available for code completion. Source: Models.

Codestral: Mistral AI’s Code-Specialized Model

Codestral is Mistral AI’s flagship model dedicated to code generation and completion. Its v25.08 version represents the culmination of several years of research in artificial intelligence applied to software development. The difference from a general-purpose model lies in the training: while a versatile model treats code as a special case of natural language, Codestral was trained specifically to understand, generate, and complete source code in more than 80 programming languages. It belongs to Mistral AI’s Premier tier, the lineup that delivers the best performance and the most comprehensive platform support.

80+
Supported Languages
v25.08
Current Version
Premier
Mistral AI Tier
FIM
Fill-In-The-Middle

Why a Code-Specific Model?

General-purpose models like Mistral Large 3 or GPT-5.6 write code quite well, but they aren’t optimized for this task, and you can see the difference in four specific areas. The first is syntactic understanding: Codestral has internalized the structures unique to each language, not just the textual patterns surrounding them. In a Rust file, it understands what borrowing implies; in a SQL file, it knows that a GROUP BY clause calls for an aggregation.

The second point is Fill-In-The-Middle, the ability to complete code in the middle of a file, not just at the end. A general-purpose model continues text; Codestral can also fill a gap between two existing blocks, which matches exactly what a developer does when placing their cursor in the middle of a class. The third point is latency: real-time autocompletion in an IDE is only usable if the suggestion arrives before the developer finishes typing the line themselves, and Codestral is sized for these very short, frequent calls. The fourth is output consistency: the generated code is formatted and idiomatic in the target language, without the mix of conventions you sometimes see elsewhere.

Codestral’s Two Endpoints

Mistral AI exposes Codestral through two entry points, and choosing the right one affects result quality as much as the prompt itself.

FIM Endpoint — /v1/fim/completions

This is the more innovative of the two. You provide a prompt (the start of the code) and a suffix (the end), and Codestral generates what goes between them. Concretely, if your editor sends the forty lines above the cursor and the ten lines below it, the model produces the missing portion while taking both sides into account. This is exactly what an IDE needs for truly contextual autocompletion.

Chat Endpoint — /v1/chat/completions

This is the classic instruction-following endpoint: you ask a question or give an instruction, and Codestral responds with code. It’s suitable for generating complete functions, writing documentation, or producing unit tests—in other words, for anything that starts from an intent expressed in natural language rather than a cursor placed in a file.

Supported Languages

Codestral covers the essentials of the modern development ecosystem: Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Dart, R, MATLAB, SQL, HTML, CSS, Shell/Bash, PowerShell, Lua, Perl, Scala, and many others. This coverage of more than 80 languages makes it one of the most versatile code models on the market, including for projects that mix three or four technologies in the same repository.

Codestral in the Mistral Ecosystem

You don’t just consume Codestral through raw API calls. In an editor, you install it via Continue.dev, the extension available for VS Code and JetBrains that handles inline autocompletion, or via Tabnine, which adds quick actions triggered from the IDE. Data scientists find it in JupyterLab thanks to Jupyter AI, directly in their notebooks. On the command line, Mistral Vibe acts as a code assistant in the terminal. Finally, LangChain and LlamaIndex let you chain it into application pipelines when the generated code is just one step in a larger process.

The next lessons dive into the details: the FIM mechanism, the Python API, and then concrete use cases for Codestral.

Key Takeaways

  • Codestral v25.08 is Mistral AI’s Premier tier model specialized in code
  • It supports more than 80 programming languages
  • Its FIM (Fill-In-The-Middle) capability distinguishes it from general-purpose models
  • It’s accessible via two endpoints: FIM and Chat
  • It integrates natively into the most popular IDEs