Back to Mistral Rs

Multimodal model support in mistral.rs

docs/MULTIMODAL_MODELS.md

0.8.01.8 KB
Original Source

Multimodal model support in mistral.rs

Mistral.rs supports various modalities of models, including multimodal models. Multimodal models take images, audio, and text as input and have the capability to reason over all of them.

Please see docs for the following model types:

CLI one-shot mode

You can query multimodal models directly from the command line using -i with --image, --video, or --audio:

bash
# Image
mistralrs run -m google/gemma-4-E4B-it --image photo.jpg -i "Describe this image"

# Video (requires FFmpeg for non-GIF formats, see VIDEO.md)
mistralrs run -m google/gemma-4-E4B-it --video clip.mp4 -i "What happens in this video?"

# Audio
mistralrs run -m google/gemma-4-E4B-it --audio recording.wav -i "Transcribe this audio"

# Multiple inputs
mistralrs run -m google/gemma-4-E4B-it --image a.jpg --image b.jpg -i "Compare these images"

See the full CLI reference for all options.

Note for the Python and HTTP APIs: We follow the OpenAI specification for structuring the image messages and allow both base64 encoded images as well as a URL/path to the image. There are many examples of this, see this Python example.