mistralai/mistral-common

Official inference library for pre-processing of Mistral models

What it solves

It provides a standardized way to interact with Mistral AI models, ensuring that text, images, and tool calls are processed exactly as the models expect. It eliminates the guesswork in tokenization and request validation, which is necessary for getting the optimal performance from these models.

How it works

The library provides open-source tokenizers and validation logic built on Pydantic. It supports multiple modalities (text, image, and audio) and offers versioned tokenizers to maintain backward compatibility across different model releases.

Who it’s for

Developers building applications using Mistral AI models or those creating their own models who want to use the same tokenization and validation standards as Mistral AI.

Highlights

  • Multi-modal tokenization: Supports text, images, and audio.
  • Pydantic-based validation: Ensures requests, messages, and tool calls are normalized and validated.
  • Versioned tokenizers: Guarantees backward compatibility for released models.
  • Flexible installation: Optional dependencies for specific needs like Hugging Face Hub integration or server mode.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project