mistral_common
Mistral-common is a library of common utilities for Mistral AI.
What it is and what it does
mistral-common is a utility library that exposes Mistral AI's internal tokenization, validation, and normalization code for public use. It handles tokenization of text, images, and tool calls, plus request/response validation built on Pydantic. The library is versioned to guarantee backward compatibility with released models.
The package is designed for two audiences: developers integrating Mistral models into applications, and those building custom models who want to use Mistral's tokenization and validation approach. It ships with eight runtime dependencies (pydantic, requests, numpy, pillow, tiktoken, jsonschema, typing-extensions, pydantic-extra-types) and supports optional extras for image, audio, Hugging Face Hub integration, and experimental server mode.
Use it for:
- Tokenize text and images before sending to Mistral models to verify token counts and optimize prompt engineering.
- Validate and normalize API requests and tool calls to match Mistral's expected format before calling the model.
- Build custom LLM applications that need consistent tokenization behavior across multiple model versions.
- Integrate Mistral model support into frameworks that require standardized token counting and validation.
- Develop local preprocessing pipelines that mirror Mistral's server-side validation without API calls.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides tokenizers, validation, and normalization utilities for working with Mistral AI models, supporting text, images, and tool calls with versioned tokenizers for backward compatibility.
Yes. mistral-common is actively maintained, has no known vulnerabilities, and low install friction. Install it if you are building applications with Mistral models and need local tokenization, validation, or want to ensure token counts match what the API will see. The permissive Apache 2.0 license poses no restrictions. Skip it only if you are not using Mistral models or do not need pre-flight validation.
Install
mistral-common on PyPI
pip
pip install mistral-commonuv
uv add mistral-commonpoetry
poetry add mistral-commonInstalling mistral_common
Before you install
Low install friction with a pure-wheel distribution and eight common dependencies (pydantic, requests, numpy, pillow, tiktoken, jsonschema, typing-extensions, pydantic-extra-types). Actively maintained with a release 22 days ago.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial use and modification with attribution. No notable restrictions for typical integration into applications.
Quickstart
pip install mistral-common
from mistral_common.tokens.tiktoken import get_encoding
encoding = get_encoding("v3")
tokens = encoding.encode("Hello, world!")
Requires Python 3.10 or later (supports up to 3.14); optional extras (image, audio, hf-hub, sentencepiece, server) available for extended functionality.
Verify before relying
- Whether the tokenizers are compatible with all current Mistral model versions or only specific releases.
- Performance characteristics (tokenization speed, memory overhead) compared to direct model APIs.
- Whether validation and normalization code is used by the official Mistral Python client or is independent.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — pydantic, jsonschema, typing-extensions, tiktoken, pillow, requests, numpy, pydantic-extra-types |
| Maintenance | actively maintained — 22 days since the last release |
| First released | |
| Downloads | 8,944,595/month — #1,573 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mistral_common-1.11.7-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
pytorch-tokenizersProvides C++ implementations of multiple…
permissive · top 15,000 on PyPI
langchain-mistralaiConnects Mistral AI language models to…
permissive · top 5,000 on PyPI
mistralaiPython client SDK for the Mistral AI API,…
unclear · top 1,000 on PyPI
mistralai-workflowsMistral Workflows is a Python SDK for building…
permissive · top 15,000 on PyPI
mistral-vibeMistral Vibe is a command-line coding assistant…
permissive · top 5,000 on PyPI
lm-evalUnified framework for evaluating generative…
permissive · top 5,000 on PyPI
openvino-tokenizersConverts HuggingFace tokenizers into OpenVINO…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-mistralaiAutomatically captures and traces calls to the…
permissive · top 5,000 on PyPI