Instructions to use mistralai/Mistral-Multimodal-Embed-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mistralai/Mistral-Multimodal-Embed-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="mistralai/Mistral-Multimodal-Embed-1B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mistralai/Mistral-Multimodal-Embed-1B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
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.
| Model | Params | Image retrieval | Image classification | Video retrieval | Video classification |
|---|---|---|---|---|---|
| Clipstral | 1.24B | 80.2 | 79.2 | 64.0 | 57.0 |
| PE-Core-L | 0.67B | 67.9 | 78.8 | 55.4 | 52.5 |
| PE-Core-G | 2.42B | 71.0 | 81.6 | 60.9 | 55.1 |
| MetaCLIP 2-H | 1.86B | 74.0 | 76.2 | 46.0 | 48.1 |
| MetaCLIP 2-bigG | 3.63B | 75.5 | 79.1 | 46.6 | 49.7 |
| SigLIP2-So400m | 1.14B | 73.1 | 77.9 | 46.7 | 49.3 |
| SigLIP2-g | 1.87B | 73.4 | 78.4 | 47.4 | 50.0 |
| TIPSv2-L | 0.49B | 60.1 | 67.4 | 43.6 | 39.2 |
| TIPSv2-g | 1.53B | 62.3 | 69.7 | 47.4 | 41.2 |
| VideoPrism-LvT-L | 0.58B | โ | โ | 58.5 | 51.5 |
| EmbeddingGemma 2 | 0.44B | 75.8 | 69.0 | 61.0 | 49.9 |
| C-RADIOv4-So400m | 1.15B | 75.1 | 76.1 | 46.4 | 46.8 |
| C-RADIOv4-H | 1.37B | 75.6 | 77.3 | 47.5 | 47.6 |
| Qwen3-VL-Embedding-2B | 2.13B | 77.5 | 69.5 | 61.9 | 57.8 |
| Qwen3-VL-Embedding-8B (reference) | 8.14B | 82.7 | 72.9 | 66.2 | 61.7 |
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:
uv sync
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.
import urllib.request
import cv2
import numpy as np
import torch
from PIL import Image
from transformers import AutoImageProcessor, AutoModel, AutoTokenizer
repo_id = "mistralai/mistral-multimodal-embed-1B"
assets = "https://raw.githubusercontent.com/mistralai/mistral-multimodal-embed/main/assets"
device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.bfloat16 if device == "cuda" else torch.float32
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True, dtype=dtype).eval().to(device)
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
# --- text ---
texts = ["iconic windmill", "a gothic cathedral", "a statue in a sunny square"]
tok = tokenizer(texts, padding=True, return_tensors="pt")
with torch.inference_mode():
text_features = model.get_text_features(tok.input_ids.to(device), tok.attention_mask.to(device))
# --- images ---
image_paths = [urllib.request.urlretrieve(f"{assets}/images/image_0{i}.jpg", f"image_0{i}.jpg")[0] for i in (0, 1)]
images = [Image.open(path).convert("RGB") for path in image_paths]
pixel_values = [p.to(device=device, dtype=dtype) for p in processor(images)["pixel_values"]]
with torch.inference_mode():
image_features = model.get_image_features(pixel_values)
print(image_features @ text_features.T) # (num_images, num_texts) cosine similarities
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:
def read_frames(path: str, num_frames: int = 16) -> list[Image.Image]:
capture = cv2.VideoCapture(path)
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
assert frame_count > 0, f"could not read the frame count of {path}"
frames = []
for index in np.linspace(0, frame_count - 1, num_frames).round().astype(int):
capture.set(cv2.CAP_PROP_POS_FRAMES, int(index))
ok, bgr = capture.read()
assert ok, f"could not decode frame {index} of {path}"
frames.append(Image.fromarray(cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB)))
capture.release()
return frames
video_path = urllib.request.urlretrieve(f"{assets}/videos/video_02.mp4", "video_02.mp4")[0]
video_processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True, size=224)
frames = video_processor(read_frames(video_path))["pixel_values"]
video = torch.stack(frames).to(device=device, dtype=dtype) # (16, 3, H, W)
with torch.inference_mode():
video_features = model.get_video_features([video]) # (1, 1024)
print(video_features @ text_features.T) # (num_videos, num_texts)
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): runuv run python app.pyand 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_ratioat 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 OpenCVINTER_AREA. - Other transforms:
squashresizes to a square and ignores the aspect ratio.center_croptakes a square center crop. Both returnsize x sizetensors, andsizemust 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=Falseto 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
| File | Purpose |
|---|---|
model.safetensors, config.json |
Weights and model configuration |
modeling_mistral_contrastive.py, configuration_mistral_contrastive.py |
Model code, loaded by AutoModel |
image_processing_mistral_contrastive.py, image_transforms.py |
Image processor, loaded by AutoImageProcessor |
preprocessor_config.json |
Default transform and resolution |
tokenizer.json, tokenizer_config.json, special_tokens_map.json |
Tokenizer |
Citation
@misc{clipstral2026,
title = {Clipstral: Image, Video, and Multilingual Text Embedder},
author = {Mistral AI},
year = {2026},
url = {https://www.alphaxiv.org/abs/2611.clipstral-mistral-multimodal-embed-1b}
}
License
Apache License 2.0 - see LICENSE.
- Downloads last month
- 28