← Back to Discover

Codestral

Mistral AI's first code model: a 22B-parameter model with downloadable weights, trained on 80+ programming languages and offered through Mistral's instruct, completion and fill-in-the-middle API endpoints.

Open modelsModel APIs

What it does

Codestral is a 22-billion-parameter code model announced by Mistral AI on May 29, 2024 as its first model built for code. It was trained on more than 80 programming languages, including Python, Java, C, C++, JavaScript and Bash, and also handles languages such as Swift and Fortran. It can complete functions, write tests and fill in missing code in the middle of a file. The announcement reports a 32k context window and benchmark results on HumanEval, MBPP, CruxEval, RepoBench and Spider for SQL, along with fill-in-the-middle tests against DeepSeek Coder 33B. These are the vendor's own comparisons. Weights can be downloaded from Hugging Face under the Mistral AI Non-Production License, which allows research and testing, and commercial licences are available on request. Codestral can also be called through a dedicated endpoint for IDE plugins, through the standard Mistral API, which charges per token, or self-deployed by contacting sales. Launch integrations included LlamaIndex, LangChain, Continue.dev and Tabnine.

Capabilities

  • 22B parameters trained on 80+ programming languages
  • Fill-in-the-middle completion and an instruct endpoint
  • 32k context window
  • Weights on Hugging Face for research and testing
  • Dedicated IDE endpoint and a standard per-token API
  • Integrations with LlamaIndex, LangChain, Continue.dev and Tabnine

When to use it

  • You want a code-focused model behind an IDE plugin for completion, test writing or code chat.
  • You want to download the weights and test them for research.
  • You are building agentic applications with LlamaIndex or LangChain and need a code model.