Back to Mistral
Mistral AI /

Codestral 22B
Codestral 22B

Open WeightsVendor API DeprecatedCodingtextUpdated May 29, 2024

Codestral 22B

Model Overview

Codestral 22B is an open-weights generative AI model developed by Mistral AI, released on May 29, 2024. It is specifically engineered for code generation and software development tasks. Featuring a highly efficient 22B parameter density and a 32K token context window, Codestral supports over 80 programming languages, making it a robust companion for developers navigating complex codebases.

Capabilities

Codestral 22B is packed with features designed to accelerate coding workflows:

  • Code Generation & Completion: Generates code, completes functions, writes tests, and fills in missing segments seamlessly.
  • Fill-in-the-Middle (FIM): A specialized mechanism to complete code based on the surrounding context, ideal for integrating with existing codebases.
  • Language Fluency: Trained on 80+ programming languages including Python, Java, C, C++, JavaScript, Bash, Swift, SQL, and Fortran.
  • Long Context Processing: The 32K context window allows parsing of large repositories and maintaining context over extended completions.

Example Use Cases

Codestral 22B is intended to be used as an AI coding assistant. Example use cases include:

  • IDE Integration: Acting as an alternative to GitHub Copilot in IDEs like VSCode or Neovim for autocomplete and refactoring.
  • Code Testing & Documentation: Automatically generating unit tests and writing docstrings for existing functions.
  • Repository-Level Code Completion: Understanding and completing code that spans multiple files in a repository.
  • Database Query Generation: Generating and optimizing SQL queries based on natural language prompts.

Performance & Benchmarks

Codestral 22B demonstrates strong performance-to-latency ratios:

  • Python Generation: Scored 81.1% on HumanEval (pass@1) and showed strong results on MBPP and CruxEval.
  • Repository-Level Tasks: Evaluated using RepoBench EM for its ability to perform long-range, repository-level code completion.
  • SQL Generation: Proven capabilities evaluated on the Spider benchmark. It competes favorably with other prominent models like CodeLlama and DeepSeek Coder in its weight class.

Intended Use & Limitations

Intended Use: Designed for software developers and researchers to streamline workflows, reduce bugs, and improve productivity. Released under the Mistral Non-Production License (MNPL-0.1), it is available for research and non-commercial testing. Limitations:

  • Lack of Moderation: Codestral does not have built-in moderation mechanisms, making it unsuitable for environments where filtered output is strictly required.
  • Reasoning Limits: While highly capable for its size, it may be outperformed by larger models (like Mistral Large 2) in extremely complex reasoning tasks.
  • Hardware Requirements: Requires sufficient hardware resources to run effectively locally, with a recommended minimum system memory of around 13GB.

About Mistral AI

Mistral AI is an AI research and development company based in Europe. Known for its commitment to open science and high-efficiency models, Mistral AI develops state-of-the-art open-weights and proprietary models (such as Mistral 7B, Mixtral 8x7B, and Mistral Large) that emphasize exceptional performance per parameter.

Key Features

Supports 80+ programming languages including Python, C++, Java, Bash, SQL

Feature 01

Optimized for code completion and fill-in-the-middle tasks

Feature 02

32K context window for large repository parsing

Feature 03

Highly efficient 22B parameter density

Feature 04

You might also want to compare

Verified Sources

Tags

codingopen-weights

Model Specs

open-weights

Parameters

22B

Context Window

32K

License

Other/Custom

Deployment

self-hostableapi-only

Resources & Links

Lineage

Model Family

Part of the Mistral family

Only release in this line currently tracked.

Curator Notes

Released under the Mistral Non-Production License (MNPL) for research and non-commercial testing.

Compare Specs

Compare parameters, context windows, modalities, and benchmark scores of this model side-by-side with others.

Compare Model