--- id: mistral-common version: "1.11.7" license: Apache-2.0 license_treatment: permissive maintenance: active --- # mistral_common — Mistral-common is a library of common utilities for Mistral AI. License: permissive · Maintenance: active · Downloads: 8.9M/mo ## 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 above — 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 pip install mistral-common uv add mistral-common poetry add mistral-common ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 8.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags mistral ai tokenizer, llm tokenization library, mistral model utilities, text and image tokenization, pydantic validation for llms, mistral-ai, tokenization, llm-utilities [View on SkillFed](https://skillfed.io/packages/mistral-common) · [View on PyPI](https://pypi.org/project/mistral-common/)