Skip to main content
Browse Models

Mistral AI

Codestral 22B v0.1

Released

2024-05-29

Family

Codestral

Type

Foundation Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

Instruct model, 4-bit GGUF (Q4_K_M)

GGUF · Codestral-22B-v0.1-Q4_K_M.gguf

Instruct model, 5-bit GGUF (Q5_K_M)

GGUF · Codestral-22B-v0.1-Q5_K_M.gguf

Instruct model, 6-bit GGUF (Q6_K)

GGUF · Codestral-22B-v0.1-Q6_K.gguf

Instruct model, 8-bit GGUF (Q8_0)

GGUF · Codestral-22B-v0.1-Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Codestral 22B v0.1 is an open-weight generative AI model for code generation developed by Mistral AI. Released on May 29, 2024, Codestral is designed to assist with automated software development tasks, supporting more than 80 programming languages, and is aimed at both research and practical applications in coding and software engineering.

Model Architecture and Training

At its core, Codestral 22B v0.1 is a causal language model comprising 22.2 billion parameters and utilizing BF16 tensor precision for efficient computation. The architecture and technology are tailored for programming-related tasks, allowing it to predict and generate syntactically correct code across a wide array of programming environments. As detailed by Mistral AI, the model was trained on a comprehensive dataset curated from publicly available codebases, encompassing over 80 programming languages. Notable languages include Python, Java, C, C++, JavaScript, Bash, as well as more specialized environments such as Swift and Fortran.

Codestral employs two distinctive modes of operation: "Instruct", where the model is prompted with natural language queries about code, and "Fill-in-the-Middle" (FIM), which enables token prediction between user-provided code prefixes and suffixes. The FIM capability is particularly valuable for integrated development environment (IDE) plug-ins and code-editing scenarios.

Benchmark Performance and Evaluation

Codestral 22B demonstrates competitive performance across industry-standard code generation and completion tasks. Its 32k token context window enables the model to handle long-range dependencies in extended codebases, which is especially beneficial for repository-level editing or completion tasks.

Codestral benchmark performance table on RepoBench and other code tasks

Figure 1. Codestral 22B compared to other large language models across code generation benchmarks, highlighting performance in RepoBench, HumanEval, and other tasks. The large context window supports advanced repository-level completion.

On the RepoBench evaluation, Codestral 22B achieves high scores facilitated by its extended context window. It outperforms comparably sized and even larger models, such as DeepSeek Coder 33B and CodeLlama 70B, across evaluation suites including HumanEval, MBPP, and CruxEval-O, as well as long-range tasks.

Codestral performance on HumanEval for various programming languages

Figure 2. Codestral 22B's HumanEval performance across Python, C++, Bash, Java, PHP, TypeScript, and C#, showing competitive results compared to other leading code models.

In benchmark assessments specifically for code synthesis, Codestral achieves notable results on tests such as HumanEval for Python and other languages, as well as the MBPP (Mostly Basic Python Problems) and Spider (SQL) benchmarks. For example, on the Kotlin-HumanEval benchmark, the model achieved a pass@1 rate of 73.75 at temperature 0.2, marginally surpassing performance observed with GPT-4-Turbo and GPT-3.5-Turbo.

Codestral’s FIM capability also demonstrates strong outcomes, as highlighted by detailed HumanEval FIM scores in Python, JavaScript, and Java.

Codestral HumanEval FIM benchmark across multiple languages

Figure 3. Fill-in-the-Middle (FIM) HumanEval pass@1 scores for Codestral 22B, demonstrating strong code completion abilities in Python, JavaScript, and Java.

Functional Capabilities and Applications

Codestral 22B is engineered for a wide range of programming applications. It can generate both complete functions and partial code snippets based on user instructions, facilitate automated writing of unit and integration tests, and execute explanatory or refactoring tasks over code samples. Its proficiency with fill-in-the-middle queries makes it well-suited for integration with modern IDEs, supporting workflow features such as real-time code completion, inline code editing, and interactive conversational coding assistance.

The FIM interface enables developers to prompt the model with incomplete code blocks, efficiently filling gaps between known code segments—an approach that accelerates bug fixing, documentation, and collaborative programming efforts.

Codestral is incorporated into several third-party frameworks and applications, enhancing agentic application development within environments such as LlamaIndex and LangChain. The model’s fluency in natural language also allows it to answer code-related queries, explain program logic, and support developers in understanding unfamiliar codebases.

Limitations and Responsible Use

While offering broad support for code generation and understanding tasks, Codestral 22B v0.1 does not include integrated moderation mechanisms or safety filters. As such, Mistral AI encourages community involvement in developing downstream guardrails to ensure responsible use and to adapt the model for deployment in production contexts.

The model is openly distributed under the Mistral AI Non-Production License (MNPL-0.1), which restricts its use to research and non-commercial settings unless separate, explicit licensing is acquired. This open-weight approach supports scientific transparency and reproducibility but also places a responsibility on downstream users to manage and monitor outputs appropriately.

Release, Availability, and Comparative Position

Codestral 22B v0.1 was officially introduced on May 29, 2024, adding to the expanding ecosystem of AI-driven code generation tools. The model is the subject of direct comparison with a variety of both code-specialized and generalist large language models, such as CodeLlama 70B, DeepSeek Coder 33B, and GPT-4-Turbo, across a range of public benchmarks.

Its strong performance in long-context and language-diverse tasks positions it distinctively among open-weight code generation models, particularly with respect to FIM operations and repository-scale completions.

External Resources

Further information and resources for Codestral 22B v0.1 can be found at:

About Codestral: Codestral is a 22-billion-parameter generative AI model developed by Mistral AI, designed to assist developers with code generation across more than 80 programming languages, including Python, Java, C++, and JavaScript.

More from Mistral AI

Mistral AI /

Mistral 7B

Base 7.3-billion parameter model from Mistral AI, with superior performance to Llama 2 7b (and 13b, impressively) on nearly all benchmarks.
Mistral AI /

Mistral Large 2

123 billion parameter model from Paris-based Mistral AI, significantly more capable than its predecessor in code generation, mathematics, reasoning, multilingual support, and function calling.
Mistral AI /

Mistral Small (2409)

A 22B parameter enterprise-grade small model, a convenient mid-point between Mistral NeMo 12B and Mistral Large 2. This version delivers significant improvements in human alignment, reasoning capabilities, and code over the previous version.
Mistral AI /

Mistral Small 3.2 (2506)

A 24-billion parameter multimodal model featuring improved instruction following, function calling, and reduced repetition over its predecessor.
Mistral AI /

Mistral Small 3.1 (2503)

A 24-billion parameter multimodal transformer supporting text and vision tasks with 128K token context length under Apache 2.0 license.
Mistral AI /

Devstral Small 1.0

A 23.6B parameter coding assistant finetuned for agentic software engineering tasks with 128K context window and 46.8% SWE-Bench performance.
Mistral AI /

Mistral Small 3 (2501)

A 24-billion parameter instruction-tuned language model with multilingual capabilities, 32K context window, and optimized low-latency inference performance.
Mistral AI /

Mistral NeMo 12B

A 12B parameter multi-lingual model that supports function calling built in collaboration with NVIDIA and trained using the new Tekken tokenizer. By some metrics, it is state-of-the-art in its size category. NeMo was trained with quantisation awareness, enabling FP8 inference without any performance loss.
Mistral AI /

Mixtral 8x7B

Spare sparse mixture of experts (MoE) model consisting of 8 "experts" with 7b parameters each, outperforming all Llama 2 models (including 70b) on most benchmarks.
Mistral AI /

Mixtral 8x22B

A sparse mixture-of-experts architecture with 141 billion total parameters, activating 39 billion per token, supporting multilingual tasks and 64,000-token contexts.