Instructions to use nativ-community/Mistral-Multimodal-Embed-1B-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use nativ-community/Mistral-Multimodal-Embed-1B-4bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download nativ-community/Mistral-Multimodal-Embed-1B-4bit --local-dir Mistral-Multimodal-Embed-1B-4bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Mistral Multimodal Embed 1B — 4bit
Native MLX conversion of Mistral AI's Mistral-Multimodal-Embed-1B (Clipstral), an encoder for multilingual text, images, and videos in a shared 1,024-dimensional space. This model produces embeddings; it does not generate text.
Precision: 4-bit affine, group size 64. Weights: 1.361 GB (1,360,919,124 bytes).
Install the validated implementation
Support is on the MLX-VLM source branch and may not yet be included in a PyPI release. Install the exact validated commit:
pip install "git+https://github.com/Neywa-Labs/mlx-vlm.git@87d5492e4711c2db754aa70dc11b05500a3487fb"
Use Apple silicon with MLX. Tested with MLX 0.32.5 and Transformers 5.23.0. The default NumPy/OpenCV preprocessing and native MLX inference do not require PyTorch or remote model code.
Text and images
from PIL import Image
from mlx_vlm import load
model, processor = load("nativ-community/Mistral-Multimodal-Embed-1B-4bit", trust_remote_code=False)
inputs = processor(
text=["iconic windmill", "a gothic cathedral", "a statue in a sunny square"],
images=[Image.open("image.jpg")],
)
out = model(**inputs)
print(out.image_embeds @ out.text_embeds.T) # cosine similarities
For text only, call model(**processor(text=["your text"])) and read text_embeds. Keep the tokenizer's BOS/EOS tokens: text pooling uses the first EOS. All normalized embeddings are FP32, including quantized exports. Raw text projections are available with model.get_text_features(..., normalize=False).
The default image transform preserves aspect ratio, resizes the long side to 448 pixels, and rounds each dimension up to a multiple of 28. The processor uses the source OpenCV INTER_AREA float resize and normalization. Set processor.image_processor.size = 224 to use a smaller resolution. Variable-size images are processed without padding or cross-image attention.
Video
Decode a video into RGB PIL frames, sampling 16 evenly spaced frames as in the reference evaluation, then:
processor.image_processor.size = 224
# frames: list of RGB PIL images from one clip in temporal order
inputs = processor(videos=[frames])
video_embeds = model.get_video_features(inputs["video_pixel_values"])
text_embeds = model(**processor(text=["a statue in a sunny square"])).text_embeds
print(video_embeds @ text_embeds.T)
Frames within each clip must have the same processed shape. Video embeddings use the learned 4-layer temporal encoder with 3D RoPE. The Python API supports videos; /v1/embeddings supports text and image requests.
Conversion and validation
Source revision: 4d0e936674cff0439f1727058fcf98fc15066090. Conversion implementation: 26c376dd9691128e080f9cc77c6154ec2a069ab0. Every quant was converted directly from the source BF16 checkpoint using mlx_vlm convert; no quant was requantized from another quant.
Only the text embedding table and text transformer Linear layers are quantized. Both visual towers, normalization weights, and the final text/image projections remain BF16. logit_scale stays FP32. 319 unquantized tensors were checked for exact source values and dtypes after the convolution layout mapping. Weight shards, index coverage, quantization settings, strict reload, and all three modalities passed validation.
Original conversion checks used eight English/French/Polish/Chinese texts, two different-size example images, and one 16-frame example video at 224 pixels. Minimum text cosine agreement with the source FP32 reference: 0.975910. Image/video minimum cosine agreement: 0.996366 / 0.999348. All three English retrieval examples retained the expected top candidate. Small FP32 CPU models matched the reference on all modalities within 1.8e-7 absolute error; default OpenCV preprocessing matched exactly for keep-ratio, squash, and center-crop.
These are numerical and smoke checks, not retrieval benchmark scores or validation of long text, long video, or high-resolution workloads. Lower-bit text error can change rankings in larger candidate sets; compare quality on your own retrieval data. Full settings and measured errors are recorded in conversion.json.
Attribution and license
Original model and architecture by Mistral AI. Distributed under Apache License 2.0. See the original model card and reference implementation. MLX port and conversion published by nativ-community.
- Downloads last month
- 55
4-bit
Model tree for nativ-community/Mistral-Multimodal-Embed-1B-4bit
Base model
mistralai/Mistral-Multimodal-Embed-1B