Skip to main content
Mistral AI

Mistral-common

PyPI version Tests Documentation Python version License

What is it?

mistral-common is a set of tools to help you work with Mistral AI models.

We open-source the tokenizers, validation and normalization code that can be used with our models.

This ensures that you can take full advantage of our models for the following features:

  • tokenization of text, images and tools calls.
  • validation and normalization of requests, messages, tool calls, and responses. This is built on top of the Pydantic library.

We also version our tokenizers to guarantee backward compatibility for the models that we release.

For who ?

This library is for you if you want to:

  • use our models in your own application.
  • build your own models and want to use the same tokenization and validation code as we do.

How to use it ?

You can install the library using pip:

pip install mistral-common

We 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 release Tekken tokenizers for recent models.
  • [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[server]"
pip install "mistral-common[image,audio,hf-hub,sentencepiece,server]"

For more information, please refer to the documentation.

How to contribute?

We welcome contributions to this library. Please read our contribution guide first. If you encounter a bug, have difficulties using mistral-common, or want to propose a feature, search the existing issues and open an issue on our GitHub repository before starting work.

If you want to contribute code after the issue discussion, you may fork the repository and open a pull request. We will review changes that are relevant to the library and meet the contribution guidelines.

# Clone the repository
git clone https://github.com/<your_fork_username>/mistral-common.git
cd mistral-common

# Create a virtual environment and install the dependencies
uv venv
source .venv/bin/activate
uv sync --frozen --all-extras --group dev # --group docs if you want to build the documentation

# Install the pre-commit hooks
uv run pre-commit install

License

This library is licensed under the Apache 2.0 License. See the LICENSE file for more information.

You must not use this library or our models in a manner that infringes, misappropriates, or otherwise violates any third party’s rights, including intellectual property rights.

Metadata

Release files for mistral_common 1.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mistral_common 1.13.0
File Size Uploaded Provenance Actions
mistral_common-1.13.0.tar.gz 6.4 MB Without provenance Details for mistral_common-1.13.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mistral_common 1.13.0
File Interpreter ABI Platform Actions
mistral_common-1.13.0-py3-none-any.whl Python 3 none any Details for mistral_common-1.13.0-py3-none-any.whl

Total release size: 13.0 MB

Release files / mistral_common-1.13.0.tar.gz

Download URL mistral_common-1.13.0.tar.gz
Size 6.4 MB
Tags Source
SHA-256 checksum
How to use checksums
8559b6e22e9b15d4d7445ae34db6d27578f3a6c0e3d74c5fd57b4bf2db543333
BLAKE2b-256 checksum
How to use checksums
6fddcf7cbdbf7caae0cd410457ad6742e7b9fd85d8ea6ee8a264bc9d7b965d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mistral_common-1.13.0-py3-none-any.whl

Download URL mistral_common-1.13.0-py3-none-any.whl
Size 6.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6304455b69ae9ca02cddb9bb3bb888ab8dcbe3945a3cafe3368897795611993d
BLAKE2b-256 checksum
How to use checksums
f56a41a967279c5ba1d17af0010479825b77e11f11d629c92c345a7d8eb77b7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mistral_common 1.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.13.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page