SuperAPI AI Directory

mistral-inference

Official repository of Mistral AI's open-source large models (Mistral series).

Open website

About this tool

Purpose

Mistral Inference is the official inference library provided by Mistral AI for running Mistral series open-source large models locally. This repository contains the minimal code required to run Mistral models, suitable for developers and researchers who need to test, deploy, or study Mistral models in a local environment.

Main Capabilities

This library supports a variety of Mistral models, including Mistral 7B, Mixtral 8x7B, Mixtral 8x22B, Codestral 22B, Codestral Mamba 7B, Mathstral 7B, Mistral Nemo, Mistral Large 2, Pixtral 12B, and Mistral Small 3.1 24B Instruct, among others. All listed models support function calling. The models have capabilities such as instruction following, multimodal instruction following, function calling, and fill-in-the-middle (FIM). The Codestral series can be used for code generation and translation, Mathstral is suitable for solving math problems, and Pixtral and Mistral Small 3.1 support image understanding.

Usage

Installation requires a GPU, because xformers is currently required, and xformers itself requires a GPU to install. Users can download model weights from the Hugging Face Hub, for example by downloading Mistral Small 3.1 24B Instruct. After downloading, it can be used through command-line tools: run mistral-demo to test whether the model works properly; use mistral-chat for interactive conversation. For large models such as 8x7B and 8x22B, they need to be run in a multi-GPU environment, and torchrun can be used with the --nproc-per-node parameter. When chatting with Codestral, you can ask it to write code, for example "Write me a function that computes fibonacci in Rust", and then continue by asking "Translate it to Python". Codestral-Mamba requires additional dependency packages to be installed. Mathstral can be used to solve math word problems. Mistral Small 3.1 24B Instruct supports image input and can recognize, for example, a park in an image. The fill-in-the-middle feature requires installing mistral-common >= 1.2.0 and can simulate code completion. The deploy folder contains code for building a vLLM image, and the image uses the transformers library rather than the reference implementation.

Applicable Scenarios

Suitable for scenarios that require running Mistral models locally for inference, testing, research, or development, including code assistance, math problem solving, multimodal image understanding, function calling integration, and code completion, among others.

Limitations

This repository has been archived and is no longer actively maintained. New libraries or major updates may be released in the future. Installation requires a GPU and xformers. Large models require multi-GPU support. Some models have custom licenses: codestral-22B-v0.1.tar uses the Mistral AI Non-Production (MNPL) license, and mistral-large-instruct-2407.tar uses the Mistral AI Research (MRL) license. mixtral-8x22B-Instruct-v0.3.tar has the same content as Mixtral-8x22B-Instruct-v0.1, only stored in the .safetensors format; mixtral-8x22B-v0.3.tar is the same as Mixtral-8x22B-v0.1, but the vocabulary is expanded to 32768 tokens. This library or the models must not be used in a way that infringes the rights of third parties (including intellectual property rights). The library uses the Apache 2.0 license.