Skip to main content
Lesson 4 of 12 · Mistral in 2026: From Medium 3.5 to Large 4, and Le Chat Becomes Vibe

Devstral 2 and Codestral: Coding at Mistral in 2026

Lesson 4 of 12 Updated November 2, 2026 Intermediate
On this page
  1. Two Models, Two Roles
  2. The Third Tier: Medium 3.5
  3. What Changes Compared to Our Existing Courses
  4. The Two Calls, Side by Side
  5. Key Points to Remember

Updated November 2, 2026 — Devstral. Devstral 2 (devstral-2512) reached its retirement date on July 31, 2026, and Devstral Small 2 on March 31, 2026: calls to these models are no longer guaranteed. The official table redirects them to Mistral Medium 3.5, which is itself deprecated in favor of Mistral Large 4. Codestral (codestral-2508) remains generally available for code completion. Check the model table to see where the -latest aliases point before reusing these examples.

Mistral’s code lineup now centers on two complementary models, and it’s easy to confuse them: both “do code,” both carry the -stral name, and both rank among the suite’s specialists. The distinction is clear, however, and it directly determines the architecture of your development tools. This lesson clarifies that distinction once and for all, then shows how these two models fit together with Medium 3.5.

Two Models, Two Roles

ModelVersionOfficial Description
Devstral 2v25.12Frontier model for code agents, designed to solve software engineering tasks
Codestralv25.08State-of-the-art model for code completion

Codestral remains the completion specialist. Its job is autocompletion in the editor, fill-in-the-middle—filling a gap between a prefix and suffix of existing code—and rapid function generation. This is the model you plug into an IDE, where latency matters as much as accuracy: the developer expects a suggestion while typing, not three seconds later.

Devstral 2 plays in a different category: agents. Its job isn’t to complete a line but to solve a software engineering task end-to-end—understanding a ticket, navigating a repository, modifying multiple files, running tests, and retrying if necessary. This is the model you put behind an autonomous development agent. The documentation labels it “frontier” for this category, and this positioning is intentional: where Devstral 1.x explored the terrain, Devstral 2 claims it.

In practice, this means the question “Codestral or Devstral?” resolves in one sentence: if a human drives and the model suggests, it’s Codestral; if the model drives and the human supervises, it’s Devstral 2.

The Third Tier: Medium 3.5

You may recall from Lesson 2 that the announcement of Medium 3.5 on May 22, 2026, highlighted remote code agents. This might seem to encroach on Devstral 2’s territory—in reality, it’s an additional layer. Mistral’s code ecosystem reads as three levels: Codestral for completion, Devstral 2 for acting on a repository, and Medium 3.5 for the broadest agent scenarios, those that go beyond code alone—an agent that reads a specification, queries documentation, writes code, and drafts the report mobilizes generalist capabilities that Medium 3.5 provides in addition.

What Changes Compared to Our Existing Courses

Our course “Codestral & Devstral” covers the previous generation, Devstral 1.x. The principles you learned there—when to prefer an agent over completion, how to structure code prompts—remain valid; that part of the course ages well. What has changed comes down to three facts: Devstral moves to version 2 (v25.12) with an asserted “frontier” positioning; earlier versions of Devstral now appear in the documentation’s deprecated models; and Codestral remains on its own branch (v25.08). If your scripts call a dated version of Devstral 1.x, verification is required before deprecation becomes an outage.

The Two Calls, Side by Side

The code itself illustrates the difference in roles: Codestral is called via the FIM endpoint with a prefix and suffix, the agent via chat completions with a high-level instruction. Since Devstral’s retirement (July 31, 2026), this second role falls to generalists: the example calls Mistral Small 4, and the course Codestral and Code Agents details tool calling and Vibe Code.

# Completion in the editor: Codestral
response = client.fim.complete(
    model="codestral-latest",
    prompt="def weighted_average(values, weights):",
    suffix="return result",
)

# Code agent: Devstral 2 in summer 2026, Mistral Small 4 today (Devstral is retired from the API)
response = client.chat.complete(
    model="mistral-small-2603",
    messages=[{"role": "user", "content": "Fix the bug described in this ticket and propose a patch."}],
)

Look at what you give each model. Codestral receives the skeleton of a function and the return line: it must fill in the interior, nothing more—this is pure completion work, bounded by the immediate context. Devstral 2 receives a mission: “fix the bug described in this ticket.” To respond, it must reason over the entire repository, not ten lines. Same reminder as elsewhere in this course: -latest aliases work for exploration, but in production, pin a dated version.

Official source: docs.mistral.ai — Models Overview

Key Points to Remember

  • Codestral (v25.08): code completion in the editor, FIM endpoint
  • Devstral 2 (v25.12): code agents, end-to-end software engineering
  • Medium 3.5 oversees broad agent scenarios, including remote code
  • Older versions of Devstral are deprecated
  • Simple rule: human drives → Codestral; model drives → Devstral 2