Setting up Codestral 22B on your hardware, agent stack live, production-grade in 14 days

Codestral 22B is the model Cursor and Continue users keep coming back to for tab-complete. 22 billion parameters, 80+ programming languages, 32K context, and native fill-in-the-middle training that hits 95.3 percent average FIM pass@1 across Python, Java, and JavaScript, the highest fill-in-the-middle score of any open or closed model.

  • 14-day production cutover
  • Coding + research agent stack included
  • 22.2B dense Parameters
  • 32K tokens Context window
  • 14 d Production cutover

Codestral 22B at a glance

Specs that matter when picking the model and the hardware.

Parameters

22.2B (dense)

Context window

32K tokens

Architecture

Dense decoder-only Transformer with native FIM

Languages supported

80+ (Python, Java, C, C++, JavaScript, TypeScript, Rust, Go, etc.)

FIM pass@1

95.3% (top open/closed benchmark)

License

Mistral Non-Production License (MNPL-0.1) — commercial requires separate agreement

BF16 VRAM

~44GB

Q4_K_M VRAM

~13GB

Release date

2024-05-29

Newer variant

Codestral 25.01 (January 2025) with 256K context

Hardware that runs Codestral 22B in production

Three tiers, real SKUs, real throughput numbers.

  1. Entry tier: RTX 4090 24GB or RTX 3090 24GB at Q4_K_M

    Throughput: 60 to 100 tok/s, sub-200ms first token tokens/sec. Best for: Solo dev IDE autocomplete (research/personal use only under MNPL).

  2. Mid tier: 1x A6000 48GB at BF16 or 1x H100 80GB

    Throughput: 120 to 250 tok/s single stream, 800+ tok/s batched tokens/sec. Best for: Internal team Copilot (requires Mistral commercial license) or research lab self-hosting.

  3. Enterprise tier: Mistral commercial license + 2x H100 with vLLM, or Mistral managed API

    Throughput: 1500+ tok/s batched tokens/sec. Best for: Production IDE products, multi-tenant developer tools (requires negotiated commercial license).

Quantization picks for this model

GGUF, AWQ, FP8, INT4.

Recommended quantization

Q4_K_M for single-GPU IDE deployment. BF16 if you have 48GB+ and care about FIM quality at full fidelity.

Tradeoffs

FIM is more quantization-sensitive than chat. Q4_K_M loses 2 to 4 points on FIM pass@1 versus BF16. For autocomplete UX, the speed gain usually outweighs the quality drop. Q5_K_M is the safe middle.

BF16

File size: undefined.

Q8_0

File size: undefined.

Q5_K_M

File size: undefined.

Q4_K_M

File size: undefined.

Coding agents we wire to Codestral 22B

Codestral 22B is Mistral's coding model and the single-GPU sweet spot for FIM-driven IDE work, less compelling for hard agentic refactors.

Aider

Works for fast iterative loops on small to medium codebases. Aider Polyglot around 38 to 45 percent on Codestral 22B (verify on leaderboard). Weaker than Qwen2.5 Coder 32B and DeepSeek Coder V2 on hard refactors. Best fit: pin a single file and iterate.

Continue.dev

First-class native support. Continue documents Codestral as a recommended autocomplete model via the Mistral API. FIM mode plus instruction mode in one model means a simpler config than competing two-model setups. Continue plus Codestral was the canonical local autocomplete pair before Qwen2.5 Coder caught up on chat. Point tabAutocompleteModel at the FIM endpoint and you are running fully offline.

Tabby

Native Codestral integration via ~/.tabby/config.toml. Self-hosted or cloud API. Single-model FIM-plus-instruction support means simpler ops than running two models. Strong fit for self-hosted enterprise IDE assistants where Tabby's audit log meets compliance requirements.

Cody (Sourcegraph)

Cody supports Codestral as a custom model via the Mistral API. The repo-context plus Codestral combo works well for Sourcegraph-indexed codebases. License footnote: enterprise Cody plus self-hosted Codestral requires Mistral commercial license.

Cursor (BYOK)

Cursor does not have native Codestral support. Workable through the Continue plugin inside Cursor or a custom OpenAI-compatible proxy. Cursor's first-party model is faster, Codestral wins only on FIM-heavy completion patterns.

Cline

Functional via Mistral API. 32K context handles Cline's verbose system prompt with margin. Weaker than DeepSeek Coder V2 on multi-step autonomous coding tasks, Codestral is built for iteration not autonomy.

Coding agent use cases

Where this model + agent stack ships real work.

Research agents we deploy on Codestral 22B

Not the right pick.

Continue.dev plus repo-search

Use Codestral for code-search subtasks within a Continue chat that pulls repo context. Pure prose synthesis fails. Acceptable for technical research within a codebase.

Tabby plus internal-docs RAG

Tabby's enterprise RAG over internal API docs and code can use Codestral for the synthesis step. Niche fit, requires the docs corpus to be heavily code-flavored.

LangGraph code-research nodes

Use Codestral only for the code-analysis subgraph in a mixed agent. Route synthesis and writing nodes to Mistral Large 3 or Llama 3.3 70B.

Pydantic AI typed code extraction

Strong fit for narrow code-extraction agents. Reading source files, emitting typed Pydantic schemas. Codestral handles structured output reliably at 32K context.

LlamaIndex code-search

GitHub-repo retrieval and code-question-answering. Codestral plus LlamaIndex is workable for technical-only research, weaker than DeepSeek Coder V2 on the same task.

Research agent use cases

Where this model + research agent stack delivers reports your team actually uses.

Frameworks we ship for production agent workflows

Pick the framework by workflow shape.

Who picks Codestral 22B

Three buyer profiles where this model is the right answer.

  1. Researcher or personal IDE user

    Task: Local FIM autocomplete in VS Code via Continue.dev or Tabby. Outcome: Best-in-class inline suggestions on a 24GB GPU, fully offline, under research-permitted MNPL terms

  2. Enterprise with Mistral commercial license

    Task: Self-hosted Copilot replacement for an engineering org with negotiated weight license. Outcome: Combine Codestral for FIM with Mistral Large 2 or Mixtral for chat, all under one Mistral agreement

  3. Mistral API customer

    Task: Build a coding product on Mistral's hosted Codestral endpoint with commercial usage rights. Outcome: Skip the weight licensing entirely, get Codestral 25.01 with 256K context and managed scaling

What clients said after launch

Feedback from the people who were in the room when decisions were made.

I used to spend every Sunday reconciling contractor invoices. Now they match automatically. I got my weekends back.
Karen, Property ManagerDenver
We didn't rush. We just stopped wasting time on things that didn't matter. The risk was managed, not ignored.
Kwame, Digital DirectorSingapore
Three drivers called out on the same morning. The system reassigned every route before I finished my coffee. That used to take two hours of phone calls.
James, Fleet ManagerDallas

Codestral 22B vs the closest rivals

Where this model wins, where it loses.

vs Qwen2.5-Coder 32B

Qwen is Apache 2.0 (no licensing problem), bigger (32B), and wins on HumanEval (92.7 vs 81.1) and MBPP (90.2 vs 78.2) plus chat reasoning. Codestral wins on average FIM pass@1 (95.3 across Python, Java, JavaScript), inference speed at 22B dense, and the 32K-to-256K context jump on the 25.01 variant. For commercial production, pick Qwen unless you have a Mistral agreement. Both fit a single 24GB card, so the common move is Codestral for tab-complete and Qwen for chat.

vs DeepSeek Coder V2 Lite (16B / 2.4B)

DeepSeek Coder V2 Lite has a commercial-permissive license, is faster per token (MoE), and supports 338 languages and 128K context. Codestral wins narrowly on FIM and on dense-model latency predictability. License clarity favors DeepSeek for production.

vs CodeGemma 7B

CodeGemma 7B is much smaller and runs on 8GB cards, with Apache 2.0 license. Codestral 22B beats it by 10 to 20 points across HumanEval, MBPP, and FIM. Pick CodeGemma only when VRAM is below 16GB or licensing must be permissive.

How Pineido sets up agents on Codestral 22B

Two-week sprint with a hard license-review gate up front.

Day 1

License review. MNPL-0.1 commercial restrictions confirmed with buyer's counsel. If commercial production, Mistral commercial license signed or the codestral.mistral.ai hosted API confirmed as the deployment path.

Day 3

Hardware decision. RTX 4090 or 5090 (24GB) at Q4 for self-host research, or Mistral hosted API for commercial production. Tabby self-hosted plus Codestral pulled, ~/.tabby/config.toml configured.

Day 6

Continue.dev wired as the IDE assistant. tabAutocompleteModel pointed at Codestral with FIM mode, chat model points at the same endpoint with instruction mode. Latency baseline, autocomplete-acceptance rate measured.

Day 9

Aider iteration loops tested on a real client codebase. Diff-apply success rate logged. Pydantic AI typed-tool agents wired for structured-extraction tasks.

Day 11

Agent framework chosen. LangGraph plus Codestral for graph workflows, Pydantic AI for typed code extraction. Native tool calling tested.

Day 14

Production cutover. License attribution shipped (Mistral NOTICE plus commercial license reference if applicable). SSO, audit log, prompt log, rate limits live. Tabby admin dashboard handed off.

How we deploy Codestral 22B in 14 days

Fixed fee.

  1. Day 1

    Confirm your use case is non-commercial under MNPL, or that you have a Mistral commercial license, or commit to using the Mistral API. This decision blocks everything downstream

  2. Day 2

    Pull Codestral-22B-v0.1 GGUF and serve via llama.cpp or Ollama. Configure FIM endpoint (path /api/fim or OpenAI-compatible /v1/completions with FIM tokens)

  3. Day 3

    Wire to Continue.dev or Tabby in VS Code. Set tab-complete to Codestral, chat to a separate model (Qwen2.5-Coder 32B or Llama 3.3 70B). Test latency at sub-200ms target

  4. Week 2

    If commercial deployment, evaluate Codestral 25.01 with 256K context via Mistral API. Compare per-token cost vs hosted Qwen2.5-Coder. Pick by license compatibility first, then by quality

22.2B dense Parameters

Book the 30-minute scoping call. We tell you if Codestral 22B plus our agent stack is the right pick before you sign.

Fixed fee.

Day 1 you see the exact model, the exact hardware, the exact agent stack, the exact cost math, and the exact compliance posture.

You leave with

  1. Day 0 (this week): 30-minute scoping call. Hardware shortlist, model pick, agent stack proposal, cost projection in your inbox by Friday
  2. Day 1: Confirm your use case is non-commercial under MNPL, or that you have a Mistral commercial license, or commit to using the Mistral API. This decision blocks everything downstream

Answers, without the sales call

Is the license really non-commercial?

Yes, strictly. The MNPL-0.1 forbids any commercial activity, including use by employees in the course of their job, hosted services, and revenue-generating products. Even fine-tunes of Codestral inherit the restriction. Commercial deployment requires a separate license from [email protected] or use of the Mistral API.

Why is Codestral the best at FIM?

Mistral trained native FIM tokens into the base model, not as a finetune addon. This gives it a 95.3 percent FIM pass@1 rate that no other open model has matched. Codestral 25.01 extends this with a larger 256K context for repository-level fill-in-the-middle.

What about Codestral 25.01?

Codestral 25.01 is the January 2025 update with a 256K context window (8x the original 32K), a better tokenizer, roughly 2x faster decode, and 86.6 percent on HumanEval Python. It topped the Copilot Arena autocomplete leaderboard at launch and is API-only via Mistral. Mistral has since shipped Codestral 25.08 (July 2025), which reports 30 percent more accepted completions and 50 percent fewer runaway generations, bundled with Codestral Embed, the Devstral agent, and the Mistral Code IDE plugin for enterprise self-host. The original Codestral 22B v0.1 remains the open-weights option, just at the original 32K context.

What is the closest commercial-friendly alternative?

Qwen2.5-Coder 32B under Apache 2.0 for chat and complex tasks. DeepSeek Coder V2 Lite for fast FIM. CodeGemma 7B for low-VRAM setups. None match Codestral on FIM pass@1, but all are commercially clean.

Can a commercial product ship with self-hosted Codestral 22B v0.1?

Not without a separate Mistral commercial license. Codestral 22B v0.1 ships under the Mistral AI Non-Production License (MNPL-0.1), explicitly research-and-testing only. Three legal paths for production: one, sign a commercial license with Mistral (custom pricing); two, use the hosted Mistral API (codestral.mistral.ai or api.mistral.ai) with their commercial terms; three, switch to Qwen2.5 Coder 32B (Apache 2.0) or DeepSeek Coder V2 (MIT plus DeepSeek License Agreement, free commercial). For a small consultancy shipping product, paths two or three are the practical default.

Should we pick Codestral 22B or Qwen2.5 Coder 32B for Aider workflows?

Qwen2.5 Coder 32B for hard refactors, Codestral for FIM-heavy iteration. Qwen2.5 Coder 32B leads on Aider Polyglot by 6 to 12 points and ships under Apache 2.0 (no license footnote). Codestral wins on FIM benchmarks (HumanEvalFIM 91.6 percent) and pairs cleanest with Continue.dev autocomplete due to single-model FIM-plus-instruction support. Practical pick in 2026: Qwen2.5 Coder for the agentic coding loop, Codestral only when FIM autocomplete latency is the binding constraint.

ByFounder and Imaginator

Pineido, based in Strumica, North Macedonia, is a software company that builds websites, online shops, web and mobile apps, business automation and AI for companies at home and abroad. Work ships in 30-day sprints at a fixed price, and the client owns the code.

Published Updated