You can install the library using pip:
pip install mistral-commonWe propose different dependencies to install depending on your needs:
image: to use the image tokenizers.audio: to use the audio tokenizers.hf-hub: to download the tokenizers from the Hugging Face Hub.sentencepiece: to allow the use of SentencePiece tokenizers. This is now optional as we only releaseTekkentokenizers for recent models.guidance: to use the grammar-based guided generation feature.- [Experimental]
server: to use our tokenizers in a server mode.
Each dependency is optional and can be installed separately or all together using the following commands:
pip install "mistral-common[image]"
pip install "mistral-common[audio]"
pip install "mistral-common[hf-hub]"
pip install "mistral-common[sentencepiece]"
pip install "mistral-common[guidance]"
pip install "mistral-common[server]"
pip install "mistral-common[image,audio,hf-hub,sentencepiece,guidance,server]"mistral-common is packaged for Debian as python3-mistral-common:
sudo apt install python3-mistral-commonThis package is maintained by the Debian Deep Learning Team, not by Mistral AI, so packaging problems should be reported to Debian. It ships the base library only: none of the optional dependencies above are installed with it, and it may lag behind the latest release on PyPI. The package page lists the version available in each Debian suite.
To build it for source, you can clone the repository and install it using uv or pip. We recommend using uv for faster and more reliable dependency resolution:
git clone https://github.com/mistralai/mistral-common.git
cd mistral-common
uv sync --frozen --extra image # or --all-extras to install all dependencies.For development, you can install the dev group and/or the docs groups:
uv sync --frozen --all-extras --group dev # and/or --group docs.