Codestral 25.08 Guide: Mistral's Fill-in-the-Middle Specialist
Codestral 25.08 is a completion model, not an agent. What fill-in-the-middle means, what Mistral claims for this release, the batch endpoint, and when Devstral fits better.
Most coding-model coverage is about agents: a model reads an issue, edits files, runs tests and loops until green. Codestral is aimed at something smaller and far more frequent. It fills in the code between your cursor and the rest of the file, hundreds of times a day, and it has to do it fast enough that you never notice the wait.
Judging it by SWE-bench misses the point. Codestral 25.08 is the August 2025 release of Mistral's completion model, and the right questions are about latency, acceptance rate and how often a suggestion runs away from you.
Completion and agents are different jobs
An agent call is rare and expensive. It can take minutes, spend millions of tokens and still be worth it if the result is a merged pull request. A completion call is the opposite: it fires on nearly every pause in typing, the prompt is a slice of the current file, and the useful answer is often a single line.
That changes what matters. For completion you want low time-to-first-token, a short and well-bounded answer, and a model that understands the code after the cursor as well as before it. That last property is what fill-in-the-middle, or FIM, provides: the model receives a prefix and a suffix and generates only what belongs between them.
Mistral's announcement describes Codestral as built specifically for high-precision FIM completion and optimised for latency-sensitive production use. Its documentation positions it for low-latency, high-frequency tasks such as FIM, code correction and test generation.
What 25.08 changed
Mistral released Codestral 25.08 on 30 July 2025 as part of a wider coding stack that also included Codestral Embed for code search, Devstral for agentic tasks and the Mistral Code IDE plugin. The claims for the completion model itself, all vendor-reported against the previous version:
- Accepted completions — up 30%
- Code retained after a suggestion — up 10%
- Runaway generations — down 50%
- Chat mode — about 5% better on instruction following and on multi-language code generation
These are product metrics rather than benchmark scores, and that is a point in their favour. Acceptance rate and retention are what a developer actually experiences. A runaway generation, where the model keeps writing past the point you wanted, is the single most irritating failure in an editor, and halving it is a meaningful change if it holds on your code.
Mistral offers deployment in its cloud, in a self-managed VPC or fully on-premises. The announcement and the model page do not describe downloadable open weights for 25.08, so self-hosting goes through Mistral's enterprise offering. For context, the original 22B Codestral from 2024 published its weights under the Mistral Non-Production Licence, which excluded commercial use.
Using the FIM endpoint
Codestral is served on a dedicated FIM endpoint, /v1/fim/completions, as well as the usual chat endpoint. The FIM request takes the code before the cursor as prompt and the code after it as suffix:
POST /v1/fim/completions
{
"model": "codestral-2508",
"prompt": "def median(values):\n ordered = sorted(values)\n",
"suffix": "\n return result",
"max_tokens": 64,
"temperature": 0
}
Two settings matter more than anything else. Keep max_tokens small, because a completion that needs more than a few lines is usually a sign you want a chat or agent call instead. And keep temperature at or near zero, because completion should be predictable.
Most editor integrations handle this for you. If you are wiring Codestral into your own editor setup, the Continue.dev setup guide shows how to give an autocomplete model its own entry separate from the chat model.
The batch endpoint and the context figure
Codestral also shows up as a batch variant, listed on OpenRouter at $0.15 input and $0.45 output per million tokens against $0.30 and $0.90 for the standard endpoint at the time of writing. It is the same model on an asynchronous queue: you submit a file of requests and collect results later. It is useless for typing in an editor and well suited to bulk jobs such as adding docstrings across a repository or generating test scaffolds overnight. Batch API savings covers when the discount is worth the wait.
On context, sources disagree. Some listings show 256K; Mistral's own model page lists 128K. Trust the vendor figure. For completion it rarely matters, since a good FIM prompt is a focused slice of the current file and its neighbours, not the whole repository.
Codestral or Devstral
Mistral sells both, and they are complements rather than rivals.
- Pick Codestral for inline completion, short fixes, test generation from a function signature and bulk mechanical edits, where latency and cost per call dominate.
- Pick Devstral when the task spans files, needs tool calls and runs as a loop. The Devstral 2 guide covers Mistral's agentic coding model and its licence terms.
A sensible setup uses both: Codestral behind the editor's autocomplete, an agent model behind the chat panel. To check whether Codestral earns its place, log a week of suggestions and measure acceptance and retention yourself. If those numbers beat whatever you use now, the vendor claims held for you.
Common questions
What is fill-in-the-middle in Codestral?
Fill-in-the-middle means the model gets the code before the cursor and the code after it, then generates only what belongs in between. Codestral exposes this on a dedicated /v1/fim/completions endpoint with prompt and suffix fields.
Is Codestral 25.08 open weights?
Mistral's announcement and model page do not describe downloadable weights for 25.08. It is available through the API and through Mistral's cloud, VPC and on-premises deployment options.
What is the codestral-2508:batch variant?
It is the same model on an asynchronous batch endpoint at a lower price. Results arrive later rather than in real time, so it suits bulk jobs like docstrings or test scaffolds, not editor autocomplete.