Mistral Multimodal Embed - Clipstral
π Paper |
π Blog post |
π» GitHub
Mistral Multimodal Embed (codename Clipstral) is a 1.24B-parameter
open-weight dual encoder that embeds images, videos and multilingual text
into one shared 1,024-dimensional space. Matching text and visuals lie close together, so the same
embeddings serve text-to-image and text-to-video search (and the reverse),
visual search with an image or video as the query,
zero-shot image and video classification,
and dataset curation such as deduplication and filtering of mismatched pairs.
- Native resolution and aspect ratio.
The vision transformer processes each image at its native size and aspect ratio, and
accuracy stays stable from 224 to 1036 px.
- Video.
A lightweight spatio-temporal encoder attends jointly to the patch tokens of all frames
(16 frames per clip in training and evaluation).
- Long, multilingual text.
The text tower has a 131k-entry multilingual tokenizer and no fixed context limit.
- Compact and fast.
1.24B parameters in total. Videos add only a 4-layer encoder on top of the per-frame vision transformer,
so large image and video collections can be indexed on a single NVIDIA H100.
This repository is a self-contained package: the weights, tokenizer, image processor and all custom
inference code are included.
The GitHub repository adds a Gradio demo, an example notebook and the example media used below.
Results
We compared Clipstral with 13 open-weight encoders up to 4B parameters, plus Qwen3-VL-Embedding-8B as a
larger reference, under one zero-shot protocol: 37 benchmarks (6 image retrieval, 18 image classification,
5 video retrieval, 8 video classification), each model evaluated at 224, 336, 672 and 1036 px with three
input transforms, keeping its best score per dataset (best over resolutions and transforms).
Retrieval is recall at rank 1 (R@1), averaged over both directions; classification is top-1 accuracy.
Among models up to 4B parameters, Clipstral is the best image and video
retriever and ranks second on image and video classification, behind models 1.7β2x its size.
Bold: best, underlined: second best among models up to 4B parameters. Qwen3-VL-Embedding and EmbeddingGemma 2 use task-tuned
instructions. Per-benchmark results, the evaluation protocol and the throughput measurements are in the
paper.
Focused evaluations:
- Long captions. On a long-caption retrieval suite (DOCCI, ActivityNet Captions, PVD and DiDeMo),
Clipstral has the highest mean R@1 among models up to 4B parameters (71.2, vs 69.8 for
Qwen3-VL-Embedding-2B and 69.7 for EmbeddingGemma 2).
- Multilingual retrieval. On XM3600 (36 languages), Clipstral reaches 59.7 R@1 over all languages, the
best among models up to 4B parameters, and 59.7 on the 35 non-English languages vs 57.8 in English.
- Resolution robustness. Clipstral's performance remains consistent across resolutions, from 224 to 1036 pixels.
For instance, on video retrieval, its mean R@1 varies by less than one point (62.9 to 63.8).
Other models lose accuracy significantly at high or low resolutions:
PE-Core-L drops by 17 points at 1036 px (from 55.2 to 38.2) and
VideoPrism-LvT-L by 11 (from 58.3 to 47.3), while
TIPSv2-g drops by 16 points at 224 px (from 47.4 to 31.8) and
EmbeddingGemma 2 by 8 (from 61.0 to 52.7).
Installation
The package is tested with python 3.13, transformers 4.57 / 5.8 / 5.18 / 5.23,
on CPU (float32) and on NVIDIA GPU (bfloat16).
To run the demos of the GitHub repository, use uv from the repository root:
The torch build is selected automatically via environment markers (see [tool.uv.sources] in
pyproject.toml): CUDA 13.0 on Linux, CPU-only on macOS and Windows, so plain uv sync and
uv run python app.py always install the right build for the current platform.
For other accelerators, follow the uv PyTorch guide.
Quick start
The model code ships with the weights and loads with trust_remote_code=True. The snippets below run in order
as one script, from any folder: the three example files (under 1 MB) are downloaded from the
GitHub repository. Replace them with your own files to embed your data.
The default keep_ratio transform preserves each image's aspect ratio, so images can have different shapes
and the processor returns a list of tensors (with squash or center_crop, it returns one stacked tensor).
All returned features are L2-normalized 1,024-dimensional float32 tensors, so a dot product is a cosine
similarity.
Videos
A video is embedded from 16 evenly spaced frames, here decoded with OpenCV and encoded at 224 px:
Frame order matters. get_video_features accepts either a (B, T, 3, H, W) tensor or a list of
(T, 3, H, W) clips; use a list when your videos have different frame counts or sizes. The processor also
accepts decoded uint8 frame tensors, for example from torchcodec.
Demos
The GitHub repository includes:
- Gradio app (
app.py): run uv run python app.py and open http://localhost:7860. One tab searches the
example images and videos with text; the other classifies example photos by city, zero-shot.
- Notebook (
example.ipynb): text-to-image/video and image-to-image retrieval and zero-shot
classification, to run locally or on Colab.
Model details
- Parameters: 1.24B in total: vision transformer 409M, spatio-temporal encoder 50M, text tower 783M.
- Embedding: 1,024 dimensions, shared by text, images, and videos.
- Vision tower: 24-layer ViT, hidden size 1,024, patch size 14, 2D RoPE,
and 2x2 patch merging. Images are pooled with a global max (
amax).
- Video path: each frame goes through the vision tower. A 4-layer temporal
encoder with 3D RoPE then attends across all frames' tokens jointly, and a
global max pool produces one embedding per clip.
- Text tower: 14 layers, hidden size 1,792, causal attention with RoPE. The
text embedding is taken at the end-of-sequence token.
The exact settings are in config.json.
Preprocessing details
- Default transform:
keep_ratio at 448 px. The longer side is resized to
448 and the aspect ratio is preserved. Each side is rounded to a multiple of
28 (patch size 14 x patch merge 2). Resizing uses OpenCV INTER_AREA.
- Other transforms:
squash resizes to a square and ignores the aspect
ratio. center_crop takes a square center crop. Both return
size x size tensors, and size must be a multiple of 28.
- Normalization: mean
(0.48145466, 0.4578275, 0.40821073) and
standard deviation (0.26862954, 0.26130258, 0.27577711).
- Without OpenCV: pass
use_cv2_resize=False to resize with torchvision
instead. The resulting pixels differ slightly from the default OpenCV resize.
- Text: the tokenizer adds the begin- and end-of-sequence tokens
automatically. The end-of-sequence token is required, because the text
embedding is read from it. Padding is on the right.
Scope
- Short videos. Video training uses clips of up to about one minute, represented by 16 frames. Longer
videos likely need more frames or segment-level aggregation.
- One input at a time. Each input is embedded on its own (an image, a video, or a text); mixed inputs such
as image plus text are not encoded jointly. Late fusion is possible: embed each input separately and combine
the embeddings, for example by averaging them.
- Content. The model targets natural images and videos. Documents, OCR-heavy content and code are out of
scope for this release.
Files
Citation
License
Apache License 2.0 - see LICENSE.