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.1

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.1
File Size Uploaded Provenance Actions
mistral_common-1.13.1.tar.gz 6.4 MB Without provenance Details for mistral_common-1.13.1.tar.gz

Built distribution (wheel)

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

Total release size: 13.0 MB

Release files / mistral_common-1.13.1.tar.gz

Download URL mistral_common-1.13.1.tar.gz
Size 6.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ad8d5b7e866e907925e31274c314fdaa7f7c45a0a43e7d2f543fd7fe65ddcea9
BLAKE2b-256 checksum
How to use checksums
be1ba0b95fe6ec635e8f3579cc680f7e2b414c49152852aed4b22e54e92ca748
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.1-py3-none-any.whl

Download URL mistral_common-1.13.1-py3-none-any.whl
Size 6.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
98b4d0755b8d90bf4691fa8f1b70cb3b4a8cd4dc1653c4ed08ef3d1c7d2c29af
BLAKE2b-256 checksum
How to use checksums
e59c58411e76b2bdd31a012a756dd0d13a624669cdd728e8966d709113d0d437
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.1

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.1 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