Mistral AI Specialized & Emerging Models Last Updated: July 2026

Codestral & Devstral: Complete Guide — Architecture, HumanEval Benchmarks, FIM, API Pricing & Devstral Agentic Mode 2026

Codestral reviewDevstralCodestral 22BMistral AI code modelCodestral HumanEval score
Rapidly Evolving Field: Code & Developer AI Models is advancing quickly. Benchmark scores, pricing, and capabilities may change between updates. Last reviewed: July 2026.

Model Overview

Codestral, released by Mistral AI in May 2024 and refined through 2026, is a 22-billion-parameter code generation model designed for developer productivity through inline completion, chat, and agentic coding workflows. Alongside Codestral, Mistral released Devstral in 2025 — a specialised agentic variant fine-tuned for multi-file software engineering tasks and SWE-bench performance. Codestral supports a 32,000-token context window and includes native fill-in-the-middle (FIM) training for suffix-aware IDE completion, making it a direct competitor to GitHub Copilot and DeepSeek Coder. The model is trained on 80+ programming languages with a curated mix of public source code, documentation, and code-comment pairs. Codestral scores 81.1% on HumanEval pass@1 — competitive but below the 90%+ frontier set by DeepSeek Coder V3 and Qwen2.5-Coder. Its key differentiators are fast inference (22B dense model), a low API price of $0.10 per 1 million tokens, strong European data residency (Mistral is a French company), and Devstral's agentic capabilities for real-world software engineering. Codestral is released under the Mistral Non-Production License (MNPL), which permits research and testing but requires a commercial licence for production deployment — a notable restriction compared to MIT-licensed alternatives.

Need help choosing the right LLM for your project?

Our AI experts will help you select, integrate, and deploy the best model for your use case.

Book a Free Consultation →

Architecture & Technical Deep Dive

Codestral is a 22B dense decoder-only transformer built on the Mistral architecture family. Unlike MoE models (DeepSeek Coder V3) or larger dense models (Qwen2.5-Coder-32B), Codestral prioritises inference speed and a compact footprint. Devstral, its agentic sibling, shares the base architecture but is fine-tuned with tool-use and multi-file editing capabilities for SWE-bench-style tasks.

Core Architecture

Codestral uses a dense decoder-only transformer with 22B parameters, 56 layers, a hidden size of 6144, and grouped-query attention (GQA) for efficient inference. The architecture includes Rotary Position Embeddings (RoPE), RMSNorm, SwiGLU activation, and a byte-pair encoding (BPE) tokeniser with a 32K vocabulary adapted for code. Being a dense model, all 22B parameters are activated per token — simpler than MoE but higher inference cost per token than DeepSeek Coder V3's ~3B active. The model is served in BF16 and FP8 formats; FP8 reduces VRAM to ~24GB, enabling inference on a single RTX 4090 or A10G.

Training Methodology

Codestral is trained on a curated corpus of 80+ programming languages drawn from public source repositories, documentation, and code-comment pairs. Training proceeds in three stages: (1) unsupervised pre-training on raw code to learn syntax and idioms, (2) supervised fine-tuning on high-quality instruction-response pairs including FIM and chat formats, and (3) reinforcement learning from human feedback (RLHF) to improve suggestion quality. Devstral adds a fourth stage: agentic fine-tuning on multi-file editing tasks with tool-use (file read, file edit, shell command, test runner), enabling it to plan and execute multi-step software engineering tasks.

Fill-in-the-Middle (FIM) Training

Codestral is trained with FIM for suffix-aware inline completion — the core feature of IDE code assistants. The model is presented with a prefix, a sentinel token, a suffix, a second sentinel, and asked to generate the middle. Mistral reports that FIM training improves suggestion acceptance rates by 25–30% in editor integrations. Codestral uses the [PREFIX][SUFFIX] FIM format. Devstral, being agentic, relies less on FIM and more on multi-turn tool-use, but retains FIM capability for inline completion within its agentic workflow.

Devstral Agentic Mode

Devstral is the agentic variant of Codestral, fine-tuned for SWE-bench-style tasks: given a GitHub issue, plan a fix, edit multiple files, run tests, and iterate. Devstral Small (22B) scores 40% on SWE-bench Verified; Devstral Medium (larger, API-only) scores 46%, leading all open-weights agentic code models in 2026. Devstral uses a tool-use loop: it can read files, edit files, run shell commands, and execute tests, iterating until the task is complete. This is Mistral's answer to GitHub Copilot Workspace and Cursor Composer. Devstral is released under MNPL for the Small variant and commercial licence for the Medium variant.

Multi-File & Repository Context

Codestral's 32K context window holds ~10–20 files per prompt — smaller than DeepSeek Coder V3 (128K) and Qwen2.5-Coder (128K) but sufficient for most inline completion and chat tasks. Devstral extends to 256K context for agentic tasks that require reading many files. For repo-level retrieval, the Continue IDE extension and Cursor both support vector-store-backed retrieval that augments the Codestral prompt with relevant snippets. Because Codestral is a dense model, longer contexts increase inference cost linearly — a trade-off vs MoE models.

Inference & Serving

Self-hosting Codestral (FP8) requires ~24GB VRAM — a single RTX 4090, A10G, or L4 GPU suffices, making it one of the few 20B+ code models that runs on consumer hardware. BF16 requires ~44GB VRAM (A100 40GB is marginal; A100 80GB or 2x 4090 recommended). With vLLM, a single A10G achieves 40–60 tokens/sec at 32K context. The Mistral API serves Codestral at $0.10/1M input and $0.30/1M output tokens — competitive with DeepSeek ($0.14/1M) and cheaper than GPT-4o. The API is OpenAI-compatible. Devstral Medium is API-only (weights not released).

Code Generation Benchmarks & Scores

Scores based on publicly available data as of July 2026. Independent verification recommended.

Code Generation Benchmarks

Scroll horizontally →
BenchmarkCodestral 22BDevstral MediumGitHub CopilotDeepSeek Coder V3Qwen2.5-Coder-32B
HumanEval (pass@1)81.190.090.292.7
MBPP (pass@1)78.283.082.686.5
SWE-bench Verified46.033.024.023.0
LiveCodeBench33.038.539.237.5
BigCodeBench65.071.070.572.0
MultiPL-E (avg)70.076.075.077.5
DevEval44.548.047.049.0

Language-Specific Performance

Scroll horizontally →
LanguageHumanEval-X (pass@1)MBPP-X (pass@1)Notes
Python81.178.2Primary language; strongest results
JavaScript78.074.0Good for Node.js and frontend
TypeScript77.573.5Type-aware completion supported
Java75.071.0Spring and Maven patterns
C++73.069.0STL and modern C++17/20
Go72.068.0Idiomatic goroutine patterns
Rust66.060.0Weaker; borrow-checker awareness limited
SQL76.0Good for SELECT, JOIN, window functions
Bash70.0Scripting and CI/CD
PHP71.0Laravel and Symfony supported

Performance Analysis

Codestral 22B is a mid-tier code model: its 81.1% HumanEval pass@1 is solid but trails the 90%+ frontier set by DeepSeek Coder V3 (90.2%), Qwen2.5-Coder (92.7%), and GitHub Copilot (90.0%). On MBPP (78.2%), LiveCodeBench (33.0%), and MultiPL-E (70.0%), it is consistently 5–10 points behind the leaders. The standout is Devstral Medium's SWE-bench Verified score of 46% — the highest among all models in this comparison, beating GitHub Copilot's agentic mode (33%) by a wide margin. This makes Devstral the leading model for agentic, multi-file software engineering tasks in 2026. Codestral's language coverage is broad but not exceptional; Python (81.1%) and JavaScript (78.0%) are its best languages, while Rust (66.0%) is the weakest mainstream language. The 32K context window is a limitation compared to the 128K windows of DeepSeek and Qwen2.5-Coder, restricting it to ~10–20 files per prompt. Codestral's real advantages are speed (22B dense runs on a single consumer GPU), price ($0.10/1M), European data residency, and Devstral's agentic leadership. For teams whose primary use case is agentic SWE-bench-style tasks, Devstral is the best choice; for raw completion quality, DeepSeek or Qwen2.5-Coder are stronger.

Speed & Latency

Self-hosted (FP8, 1x RTX 4090 / A10G 24GB): 40–60 tokens/sec at 32K context with vLLM. Self-hosted (BF16, 1x A100 80GB): 50–70 tokens/sec. Mistral API: 80–120 tokens/sec (streaming), 150–400ms time-to-first-token. Local (Ollama, Q4_K_M on 32GB RAM): 15–25 tokens/sec. Codestral is one of the fastest 20B+ code models due to its dense architecture and efficient GQA attention.

API Access, Pricing & Integration Guide

Looking for codestral-22b API pricing in 2026? Below is the complete pricing table, code examples, and integration guide.

API Pricing Table (as of July 2026)

ModelInput (per 1M)Output (per 1M)ContextBest For
Codestral 22B$0.10$0.3032KFast code completion & chat
Devstral Small$0.10$0.30256KAgentic coding (self-hostable)
Devstral Medium$0.30$0.90256KBest agentic SWE-bench
Codestral Mamba$0.10$0.30256KLong-context code chat
Self-hosted (FP8)Free (your GPU)Free32KPrivacy, unlimited usage

Free Tier & Trial Access

Mistral La Plateforme offers a free tier with rate-limited access to Codestral for testing and prototyping (approximately 1 request/second and 500K tokens/month). The MNPL-licensed weights can be downloaded from HuggingFace for free self-hosting for research and testing. Production use requires a commercial licence from Mistral AI. New accounts receive a small credit grant for API exploration.

API Quick Start

# --- Option 1: Mistral API (OpenAI-compatible) ---
pip install mistralai

from mistralai import Mistral

client = Mistral(api_key="your-mistral-api-key")

# Chat / instruct mode
response = client.chat.complete(
    model="codestral-latest",
    messages=[
        {"role": "user", "content": "Write a Python async function to fetch JSON from a URL with retry."},
    ],
    temperature=0.0,
)
print(response.choices[0].message.content)

# --- Option 2: Fill-in-the-Middle (FIM) for inline completion ---
fim_response = client.fim.complete(
    model="codestral-latest",
    prompt="def merge_sort(arr):\n    if len(arr) <= 1:\n        return arr",
    suffix="\n    return merged",
    temperature=0.0,
    max_tokens=64,
)
print(fim_response.choices[0].message.content)

# --- Option 3: Devstral agentic mode (SWE-bench-style) ---
# Use the Mistral Agents API with tool-use:
agent_response = client.agents.complete(
    model="devstral-medium-latest",
    messages=[
        {"role": "user", "content": "Fix the failing test in tests/test_auth.py. The login function doesn't handle expired tokens."},
    ],
    tools=[{"type": "file_read"}, {"type": "file_edit"}, {"type": "code_execution"}],
)

# --- Option 4: Self-host with vLLM ---
# pip install vllm
# vllm serve mistralai/Codestral-22B-v0.1 --quantization fp8

# --- Option 5: Local with Ollama ---
# ollama pull codestral:22b
# ollama run codestral:22b "Write a Go HTTP handler"

Supported API Features

Chat / instruct mode Yes
Fill-in-the-middle (FIM) Yes (dedicated FIM endpoint)
Devstral agentic mode Yes (tool-use, multi-file editing)
32K context window (Codestral) Yes
256K context window (Devstral) Yes
OpenAI-compatible API Yes
Self-hosting (vLLM, TGI, Ollama) Yes (MNPL for research; commercial licence for production)
LoRA fine-tuning Yes (on self-hosted weights)
Function calling / tool use Yes (Devstral)
JSON mode Yes
Streaming Yes
European data residency Yes (Mistral La Plateforme EU)

Compatible Platforms & Integrations

Mistral La PlateformeOpenRouterTogether AIFireworks AIvLLM (self-host)Text Generation Inference (TGI)Ollama (local)LM Studio (local GUI)Continue (VS Code, JetBrains)CursorHuggingFace Inference APIAzure AI (via partner)Google Vertex AI (via partner)

Want to integrate codestral-22b into your product?

Our engineers help you architect, build, and deploy AI-powered features with production-grade reliability.

Talk to Our Engineers →

Fine-Tuning, RAG & Advanced Use

Fine-Tuning Availability

Codestral weights are available on HuggingFace under the Mistral Non-Production License (MNPL), which permits research, testing, and fine-tuning for non-production purposes. Production use of fine-tuned Codestral requires a commercial licence from Mistral AI. LoRA fine-tuning runs on a single A100 80GB in 6–12 hours with 10K–50K code examples. Full fine-tuning requires 4–8x A100/H100 and 1–2 days. Devstral Small is also fine-tunable under MNPL; Devstral Medium is API-only (weights not released). For teams that need fully open fine-tuning without licence restrictions, DeepSeek Coder V3 (MIT) or Qwen2.5-Coder (Apache 2.0) are better choices.

Fine-Tuning Requirements

LoRA fine-tuning: 1x A100 80GB (or 2x RTX 4090 with QLoRA), 10K–50K code examples in JSONL chat or FIM format, transformers + PEFT, 6–12 hours. Full fine-tuning: 4–8x A100/H100 80GB, 50K+ examples, 1–2 days. Recommended data format: Mistral chat format ({"role": "user", "content": "..."} / {"role": "assistant", "content": "..."}). For FIM fine-tuning, use the [PREFIX][SUFFIX] format. Learning rate: 1e-4 (LoRA), 2e-5 (full). Batch size: 32 (LoRA with gradient accumulation). Note: MNPL restricts production use of fine-tuned models without a commercial licence.

Fine-Tuning Use Cases

  • Fast inline code completion — 22B dense model runs on a single consumer GPU (RTX 4090) via FP8
  • Devstral agentic coding — SWE-bench Verified 46%, the leading open agentic code model for multi-file fixes
  • European data residency — Mistral La Plateforme offers EU-hosted inference for GDPR-sensitive teams
  • Cost-effective code chat — $0.10/1M input tokens, competitive with DeepSeek ($0.14/1M)
  • Fine-tuning on proprietary code (research/non-production) — LoRA on self-hosted weights under MNPL
  • Code migration and refactoring — Devstral agentic mode can plan and execute multi-file migrations
  • Automated test generation — generate unit tests with Devstral's tool-use (read code, write tests, run tests)
  • CI/CD code review — deploy Codestral as a CI/CD step that reviews PRs at $0.10/1M tokens

RAG Integration Guide

For repository-level assistance, use retrieval-augmented generation: chunk your repo (512–1024 tokens), embed with a code embedding model (Voyage-code, BGE-code), store in a vector DB (Qdrant, Weaviate), and retrieve relevant snippets to augment the Codestral prompt. The 32K context window holds ~10–20 retrieved files per query. Devstral's 256K context can hold 50–100 files, reducing reliance on retrieval for agentic tasks. The Continue IDE extension implements repo-level retrieval out of the box. For best results with Codestral, retrieve by semantic similarity and symbol-name overlap, and include the file's import block.

Prompt Engineering Tips

  • Use the dedicated FIM endpoint (/v1/fim/completions) for inline completion — it handles prefix/suffix natively
  • Set temperature to 0.0–0.2 for code generation and 0.7 for code explanation
  • For Devstral agentic tasks, provide a clear issue description and the file tree in the initial prompt
  • Include relevant type definitions and imports in the prompt — Codestral uses them for type-aware suggestions
  • For repo-level tasks with Codestral (32K), retrieve the top 5–10 most relevant files rather than dumping everything
  • Use Mistral La Plateforme EU endpoint for GDPR-sensitive deployments
  • For self-hosting, use FP8 quantisation in vLLM — fits on a single 24GB GPU with <1% quality loss
  • Remember: MNPL permits research and testing but production use requires a commercial licence from Mistral

Use Cases, Strengths & Limitations

Top 10 Real-World Use Cases

1

Fast Inline Code Completion

Codestral's 22B dense model runs on a single consumer GPU (RTX 4090) via FP8, making it one of the few 20B+ code models practical for local self-hosting.

2

Devstral Agentic Coding

Devstral Medium scores 46% on SWE-bench Verified — the leading open agentic code model. It can plan, edit, and test multi-file fixes for real GitHub issues.

3

European Data Residency

Mistral La Plateforme offers EU-hosted inference, making Codestral the natural choice for GDPR-sensitive European teams wanting a code AI.

4

Cost-Effective Code Chat

At $0.10/1M input tokens, Codestral is competitive with DeepSeek ($0.14/1M) and cheaper than GPT-4o for code Q&A.

5

Fine-Tuning on Proprietary Code (Research)

LoRA fine-tune on self-hosted weights under MNPL for internal research and testing. Production use requires a commercial licence.

6

Code Migration & Refactoring

Devstral agentic mode can plan and execute multi-file migrations (e.g., Python 2→3, AngularJS→React) with tool-use.

7

Automated Test Generation

Devstral can read code, write tests, run them, and iterate — automating the test-generation loop.

8

CI/CD Code Review

Deploy Codestral as a CI/CD step that reviews PRs and comments on issues at $0.10/1M tokens.

9

Long-Context Code Chat (Mamba)

Codestral Mamba variant offers 256K context for long-document code chat without the quadratic attention cost.

10

Educational & Research Use

MNPL permits free use in academia and research, making Codestral suitable for university courses and papers.

11

Multi-Language Support

80+ programming languages with consistent quality across Python, JS/TS, Java, C++, and Go.

12

Privacy-Preserving Self-Host

Self-host on your own GPU infrastructure for air-gapped or VPC deployments (MNPL for research; commercial licence for production).

Strengths

  • Devstral SWE-bench Leadership — 46% on SWE-bench Verified (Medium), the highest among all models compared, beating Copilot (33%)
  • Fast Inference on Consumer Hardware — 22B dense model runs on a single RTX 4090 (24GB) via FP8 quantisation
  • Low API Cost — $0.10/1M input tokens, competitive with DeepSeek and cheaper than GPT-4o
  • European Data Residency — Mistral La Plateforme offers EU-hosted inference for GDPR-sensitive teams
  • Dedicated FIM Endpoint — native prefix/suffix completion API for IDE integration
  • 80+ Language Support — broad coverage across mainstream and niche languages
  • Mamba Variant — Codestral Mamba offers 256K context with linear attention scaling for long code chat
  • Mistral Ecosystem — integrated with Continue, Cursor, and major AI platforms

Limitations & Weaknesses

  • MNPL Licence Restriction — production use requires a commercial licence; not as permissive as MIT (DeepSeek) or Apache 2.0 (Qwen)
  • Lower HumanEval than Frontier — 81.1% trails DeepSeek (90.2%), Qwen2.5-Coder (92.7%), and Copilot (90.0%) by 9–12 points
  • Smaller Context Window — 32K (Codestral) is 4x smaller than DeepSeek and Qwen2.5-Coder (128K); Devstral extends to 256K
  • No Fully Open Production Use — unlike DeepSeek (MIT) or Qwen (Apache 2.0), commercial production use requires payment to Mistral
  • Weaker on Rust and Niche Languages — 66% HumanEval-X on Rust; long-tail languages lag Python/JS
  • Devstral Medium is API-Only — weights not released; cannot self-host the best agentic variant
  • Dense Architecture — all 22B params active per token; higher inference cost per token than MoE models like DeepSeek Coder V3 (~3B active)
  • Smaller Community than DeepSeek/Qwen — fewer fine-tuning recipes, fewer community integrations

Who Should Use This Model

Best For

  • European teams that need GDPR-compliant, EU-hosted code AI with a low API price
  • Developers whose primary use case is agentic, multi-file software engineering (Devstral's 46% SWE-bench leads)
  • Teams that want to self-host a 20B+ code model on a single consumer GPU (RTX 4090) for research/testing

Not Ideal For

  • Teams needing fully open production use without licence fees — use DeepSeek Coder V3 (MIT) or Qwen2.5-Coder (Apache 2.0)
  • Those needing the absolute highest HumanEval pass@1 — Qwen2.5-Coder (92.7%) and DeepSeek (90.2%) are stronger
  • Teams needing 128K+ context for Codestral specifically — only Devstral extends to 256K; Codestral is 32K

Alternatives, Comparisons & Verdict

Top Alternatives

ModelHumanEvalSWE-benchOpen SourceContextPriceBest For
Codestral 22B81.1MNPL (research)32K$0.10/1MFast European API
Devstral Medium46.0No (API only)256K$0.30/1MBest agentic SWE-bench
GitHub Copilot90.033.0No128K$10–39/user/moBest IDE integration
DeepSeek Coder V390.224.0Yes (MIT)128KFree / $0.14/1MCost + privacy + fine-tuning
Qwen2.5-Coder-32B92.723.0Yes (Apache 2.0)128KFreeTop open HumanEval
StarCoder2-15B72.6Yes (BigCode)16KFreeLightweight open-source

Detailed Comparison

Codestral vs DeepSeek Coder V3: DeepSeek wins on HumanEval (90.2 vs 81.1), context window (128K vs 32K), licence (MIT vs MNPL), and inference cost (MoE ~3B active vs 22B dense). Codestral wins on inference speed on consumer hardware (22B FP8 fits on RTX 4090; DeepSeek 33B MoE needs 80GB VRAM) and European data residency. Devstral beats DeepSeek on SWE-bench (46% vs 24%) for agentic tasks. Choose DeepSeek for cost, quality, and open production use; choose Codestral/Devstral for European residency, consumer-GPU self-hosting, and agentic SWE-bench. → See Full Codestral vs DeepSeek Comparison. Codestral vs GitHub Copilot: Copilot wins on HumanEval (90.0 vs 81.1), IDE integration, and enterprise compliance. Codestral wins on cost ($0.10/1M vs $10–39/user/mo), self-hosting, and — via Devstral — agentic SWE-bench (46% vs 33%). Choose Copilot for convenience and compliance; choose Codestral/Devstral for cost, agentic tasks, and European residency.

Our Verdict

Codestral & Devstral occupy a unique niche in 2026: the best agentic code model (Devstral Medium at 46% SWE-bench Verified) and a fast, European, consumer-GPU-hostable completion model. However, the MNPL licence restricts production use, and Codestral's 81.1% HumanEval trails the 90%+ frontier. Choose Devstral for agentic software engineering, Codestral for fast European code completion, or DeepSeek/Qwen2.5-Coder for fully open, higher-quality, lower-cost alternatives.

Overall Rating 7.5 / 10
Code Generation Quality 7.0 / 10
Agentic Coding (Devstral) 9.5 / 10
Inference Speed 9.0 / 10
European / GDPR 9.0 / 10
Open Source & Licensing 5.0 / 10
Cost Efficiency 8.0 / 10
IDE Integration 7.0 / 10

Internal Links

Frequently Asked Questions

What is the difference between Codestral and Devstral?

Codestral is a 22B code generation model for inline completion and chat (HumanEval 81.1%, 32K context). Devstral is its agentic sibling, fine-tuned for multi-file software engineering tasks with tool-use (file read, edit, shell, tests). Devstral Medium scores 46% on SWE-bench Verified — the highest among all models compared. Codestral is for completion; Devstral is for agentic coding.

What is the Mistral Non-Production License (MNPL)?

MNPL permits research, testing, and non-production use of Codestral weights for free. Production/commercial use requires a commercial licence from Mistral AI. This is more restrictive than MIT (DeepSeek Coder) or Apache 2.0 (Qwen2.5-Coder), which permit unrestricted commercial use. Check Mistral's licence page for current terms.

What is Codestral's HumanEval score?

Codestral 22B scores 81.1% pass@1 on HumanEval. This is solid but trails the 90%+ frontier: DeepSeek Coder V3 (90.2%), Qwen2.5-Coder (92.7%), and GitHub Copilot (90.0%). On MBPP it scores 78.2%.

Can I self-host Codestral on a consumer GPU?

Yes. Codestral 22B in FP8 quantisation requires ~24GB VRAM, fitting on a single RTX 4090 or A10G. With vLLM, this achieves 40–60 tokens/sec. In Q4 quantisation via Ollama, it runs on 32GB of consumer RAM with 2–4% quality loss. This is one of the few 20B+ code models practical for consumer hardware.

How much does the Codestral API cost?

Codestral API costs $0.10 per 1M input tokens and $0.30 per 1M output tokens on Mistral La Plateforme. Devstral Medium costs $0.30/1M input and $0.90/1M output. This is competitive with DeepSeek ($0.14/1M) and cheaper than GPT-4o.

Does Codestral support fill-in-the-middle (FIM)?

Yes. Codestral has a dedicated FIM endpoint (/v1/fim/completions) that accepts prefix and suffix parameters for suffix-aware inline completion. This is the same capability that powers IDE code assistants like Continue and Cursor.

What is Devstral's SWE-bench score?

Devstral Medium scores 46% on SWE-bench Verified, the highest among all models in this comparison — beating GitHub Copilot's agentic mode (33%), DeepSeek Coder V3 (24%), and Qwen2.5-Coder (23%). Devstral Small (22B, open weights under MNPL) scores 40%.

Is Codestral GDPR compliant?

Yes. Mistral La Plateforme offers EU-hosted (France) inference, making Codestral a natural choice for GDPR-sensitive European teams. Data is processed in French data centres. Mistral does not train on API customer data. Self-hosting (under MNPL for research) provides the strongest privacy by keeping data entirely on your infrastructure.

Can I fine-tune Codestral on my own code?

Yes, for research and testing under MNPL. LoRA fine-tuning runs on a single A100 80GB in 6–12 hours. Production use of fine-tuned Codestral requires a commercial licence from Mistral. For fully open fine-tuning without licence restrictions, use DeepSeek Coder V3 (MIT) or Qwen2.5-Coder (Apache 2.0).

Compliance, Ethics & Responsible Use

Data Privacy & Compliance

Mistral La Plateforme offers EU-hosted (France) inference, making Codestral the natural choice for GDPR-sensitive European teams. Data is processed in Mistral's French data centres with GDPR compliance. Mistral does not train on API customer data. Self-hosted Codestral (under MNPL for research) keeps all data on your infrastructure — the most privacy-preserving option. Devstral Medium is API-only, so data flows through Mistral's EU servers. No HIPAA-specific certification is advertised; for healthcare, self-hosting or contacting Mistral for a BAA is the path. SOC 2 status: check with Mistral sales for current certification status. For regulated industries, EU-hosted API + DPA is the baseline; self-hosting is the strongest option.

Ethical Use Guidelines

Primary ethical concerns: (1) MNPL licence ambiguity — the licence permits research but restricts production use, which can create compliance uncertainty for commercial teams; (2) training data provenance — Codestral is trained on public code, raising the same attribution questions as all code models; (3) security — the model can suggest vulnerable code patterns; use SAST tools alongside; (4) agentic risk — Devstral can edit files and run commands autonomously, requiring sandboxing and human review of agentic actions; (5) developer deskilling — over-reliance reduces comprehension. Mistral recommends human review of every suggestion and sandboxing of Devstral agentic workflows.

Commercial Licensing Summary

Use CaseMNPL (Free)Commercial LicenceDevstral Medium (API)
Research & testingYesYesYes (API)
Personal non-production useYesYesYes (API)
Commercial productionNoYes (paid)Yes (pay per token)
Fine-tuning for productionNo (research only)Yes (with licence)No (API only)
Redistribution of weightsYes (MNPL terms)Per licence termsN/A
Enterprise SLANoNegotiableAvailable
EU data residencySelf-managedYes (La Plateforme EU)Yes (La Plateforme EU)

Enterprise Compliance Checklist

GDPR compliant data processing available (yes — Mistral La Plateforme EU/France)
HIPAA compliance available (contact Mistral for BAA; self-hosting recommended for healthcare)
On-premise or VPC deployment option (yes — self-hosted under MNPL for research; commercial licence for production)
Data residency control (yes — Mistral La Plateforme EU regions)
SOC 2 Type II certified (check with Mistral sales for current status)
SLA guaranteed uptime (yes — commercial licence and Devstral Medium API tier)
Role-based access control (yes — Mistral La Plateforme org management)
Audit logs available (yes — Mistral La Plateforme API logs)
Content moderation & safety filters (limited — add SAST tools like Semgrep/CodeQL for code security)
MNPL permits research use; production requires commercial licence (yes — verify with Mistral legal)
No training on your API data (yes — Mistral pledges no training on API customer data)
Devstral agentic mode requires sandboxing (yes — restrict file access and command execution)

Want to master codestral-22b?

Explore our LLM training programs and become an expert in deploying and fine-tuning AI models.

Explore Training Programs →

Changelog

July 2026Initial comprehensive guide published. Benchmark scores, API pricing, and feature comparisons updated.
Next UpdateQuarterly review scheduled — pricing and benchmark scores will be refreshed.