Instructions to use UCSC-VLAA/OpenEmbed-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UCSC-VLAA/OpenEmbed-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="UCSC-VLAA/OpenEmbed-9B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("UCSC-VLAA/OpenEmbed-9B", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("UCSC-VLAA/OpenEmbed-9B", trust_remote_code=True, device_map="auto") - sentence-transformers
How to use UCSC-VLAA/OpenEmbed-9B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("UCSC-VLAA/OpenEmbed-9B", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Download README.md from UCSC-VLAA/OpenEmbed-9B: direct link, hf CLI and curl.
- Browser
- Download file 12.5 kB
-
https://huggingface.co/UCSC-VLAA/OpenEmbed-9B/resolve/main/README.md
- Command line
-
hf download hf://UCSC-VLAA/OpenEmbed-9B/README.md
-
curl -L -o README.md https://huggingface.co/UCSC-VLAA/OpenEmbed-9B/resolve/main/README.md
license: cc-by-nc-4.0
library_name: transformers
pipeline_tag: feature-extraction
base_model:
- Qwen/Qwen3.5-9B-Base
datasets:
- UCSC-VLAA/OpenEmbed-Data
tags:
- multimodal-embedding
- image-text-retrieval
- visual-document-retrieval
- sentence-transformers
language:
- en
OpenEmbed-9B
🌐 Project page · 📄 Paper · 💻 Code · 🗂️ Data · ▶️ Colab demo
OpenEmbed is a family of multimodal embedding models at 0.8B, 2B, 4B, and 9B parameters, released with their post-training data, training code, and cached teacher embeddings. As of December 2026, OpenEmbed-9B scores higher on both the image and the visual-document tracks than any model on the MMEB-V2 leaderboard that releases its training data and training code. One model embeds text, images, visual documents, and image–text combinations into one space. Each input is formatted as a single user turn that ends with an <embedding> token, and the L2-normalized final hidden state at that token is the embedding (4,096 dimensions for OpenEmbed-9B).
OpenEmbed-9B is fine-tuned from Qwen/Qwen3.5-9B-Base in two stages. Stage 1 trains LoRA adapters on the language model and the vision tower with a contrastive loss over 109 curated datasets; the 9B model's stage 1 also samples a web pool of DataComp-1B images with generated captions and questions. Stage 2 widens the language-model adapters and adds decoupled distillation from cached embeddings of two open-weight teachers, Qwen3-VL-Embedding-8B and WeMM-Embedding-9B. The adapters are merged into the released weights.

(a) What leading embedding models release. (b) MMEB-V2 image score by model size; * reproduced by us. (c) DOCCI text-to-image R@1 and ViDoRe V3 nDCG@10 (8 public sets, English queries); r: reported results, p: recomputed from public per-query results, others measured by us.
- Paper: OpenEmbed: A Family of Frontier Multimodal Embedding Models with Open Data, Code, and Weights (arXiv:2612.02432)
- Training data and teacher embeddings: UCSC-VLAA/OpenEmbed-Data
- Training and evaluation code: UCSC-VLAA/OpenEmbed
- Models: OpenEmbed-0.8B · OpenEmbed-2B · OpenEmbed-4B · OpenEmbed-9B
Results
MMEB-V2: 36 image tasks (Hit@1; CLS: classification, VQA: visual question answering, RET: retrieval, GRD: grounding) and 24 visual-document retrieval tasks (VisDoc, nDCG@5). Evaluated with the official Qwen3-VL-Embedding MMEB-V2 evaluation code and the input format described below; the patch that applies this format is part of the code release.
| Model | CLS | VQA | RET | GRD | Image | VisDoc |
|---|---|---|---|---|---|---|
| OpenEmbed-0.8B | 67.9 | 74.2 | 74.2 | 96.5 | 74.9 | 78.5 |
| OpenEmbed-2B | 74.1 | 77.8 | 78.1 | 97.5 | 79.1 | 80.5 |
| OpenEmbed-4B | 74.5 | 80.5 | 79.8 | 97.3 | 80.5 | 81.6 |
| OpenEmbed-9B | 75.7 | 81.0 | 80.1 | 97.6 | 81.1 | 82.4 |
Usage
No remote code is needed. Tested with transformers 5.2.0 and 5.23.0, sentence-transformers 5.7.0 and 6.3.0 (torch 2.8.0), and vLLM 0.34.0.
pip install torch torchvision "transformers>=5.15.0" "sentence-transformers>=5.7.0"
Input format
OpenEmbed was trained and evaluated with WeMM-Embedding's input format, which the repository's chat template renders:
- Each input is one user turn with no system turn. Images come first, followed by one text item that holds the instruction and the text, joined by a space.
- The tokenizer appends the
<embedding>token. The embedding is the L2-normalized last hidden state at that token, the last non-padding position (keep the default right padding). - Images are resized to between 65,536 and 8,388,608 pixels, the bounds of training and evaluation and the processor's defaults. Scores move with the image budget, so keep them.
Instructions used in training and in MMEB-V2:
| Task | Query | Candidate |
|---|---|---|
| Caption → image | Find me an everyday image that matches the given caption: <caption> |
image + Represent the given image. |
| Image → caption | image + Find an image caption describing the given everyday image. |
caption text |
| Classification | image + Represent the given image for classification |
class name |
| Visual question answering | image + Represent the given image with the following question: <question> |
answer text |
| Composed image retrieval | image + Given an image, find a similar everyday image with the described changes: <modification> |
image + Represent the given image. |
| Document page retrieval | Find a document image that matches the given query. <query> |
page image, no text |
Transformers
import torch
import torch.nn.functional as F
from PIL import Image
from transformers import AutoModel, AutoProcessor
model_id = "UCSC-VLAA/OpenEmbed-9B"
processor = AutoProcessor.from_pretrained(model_id, use_fast=False)
model = AutoModel.from_pretrained(model_id, dtype=torch.bfloat16).cuda().eval()
def embed(inputs):
"""inputs: dicts with an optional "image" (a PIL.Image) and an optional "text"."""
texts, images = [], []
for x in inputs:
content = [{"type": "image"}] if x.get("image") is not None else []
if x.get("text") or not content:
content.append({"type": "text", "text": x.get("text", "")})
texts.append(processor.apply_chat_template([{"role": "user", "content": content}], tokenize=False))
if x.get("image") is not None:
images.append(x["image"])
batch = processor(text=texts, images=images or None, padding=True, return_tensors="pt").to(model.device)
model.rope_deltas = None # transformers < 5.15 would reuse the last image batch's value
with torch.inference_mode():
hidden = model(**batch).last_hidden_state
last = batch["attention_mask"].sum(dim=1) - 1 # the <embedding> token
rows = torch.arange(hidden.size(0), device=hidden.device)
return F.normalize(hidden[rows, last].float(), dim=-1) # shape (len(inputs), 4096)
queries = embed([
{"text": "Find me an everyday image that matches the given caption: A brown dog running on a beach."},
{"text": "Find a document image that matches the given query. What was the revenue in 2023?"},
])
candidates = embed([
{"image": Image.open("dog.jpg"), "text": "Represent the given image."},
{"image": Image.open("annual_report_page.png")},
])
print(queries @ candidates.T)
use_fast=False resizes images with PIL, as our evaluation did. The default (torchvision) processor works too and gives embeddings within a cosine of 0.999 of these.
Sentence Transformers
import torch
from PIL import Image
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("UCSC-VLAA/OpenEmbed-9B", model_kwargs={"dtype": torch.bfloat16})
queries = model.encode([
"Find me an everyday image that matches the given caption: A brown dog running on a beach.",
"Find a document image that matches the given query. What was the revenue in 2023?",
])
candidates = model.encode([
{"image": Image.open("dog.jpg"), "text": "Represent the given image."},
{"image": Image.open("annual_report_page.png")},
])
print(model.similarity(queries, candidates))
Add processor_kwargs={"use_fast": False} to resize images exactly as our evaluation did. Use transformers 5.15 or later with Sentence Transformers: older versions keep the position offsets of the last batch with images and can fail on a later batch without images.
vLLM
hf download UCSC-VLAA/OpenEmbed-9B --local-dir OpenEmbed-9B
vllm serve OpenEmbed-9B --runner pooling --chat-template OpenEmbed-9B/embedding_chat_template.jinja \
--limit-mm-per-prompt.video=0
import base64
import requests
def image_url(path):
return "data:image/jpeg;base64," + base64.b64encode(open(path, "rb").read()).decode()
response = requests.post("http://localhost:8000/v1/embeddings", json={
"model": "OpenEmbed-9B",
"messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": image_url("dog.jpg")}},
{"type": "text", "text": "Represent the given image."},
]}],
"encoding_format": "float",
})
embedding = response.json()["data"][0]["embedding"]
We ran it on two 24 GB cards with --tensor-parallel-size 2 --max-model-len 16384 added. --limit-mm-per-prompt.video=0 leaves out video inputs, which OpenEmbed was not trained on, and the memory vLLM would set aside for them.
How close each path is to our evaluation
We compared each path with the embeddings of our evaluation (the official evaluation code, transformers 5.2.0) on nine inputs: three texts, three images with text, a document page, and an image above and one below the pixel bounds. The Transformers code above produced the evaluation's token ids and image grids for every input. Lowest cosine similarity per path:
| Path | Lowest cosine |
|---|---|
| Transformers code above, transformers 5.2.0 | 0.999998 |
| Transformers code above, transformers 5.23.0 | 0.9992 |
| Sentence Transformers 5.7.0 (transformers 5.2.0) | 0.9992 |
| Sentence Transformers 6.3.0 (transformers 5.23.0) | 0.9991 |
| vLLM 0.34.0 | 0.9990 |
The rest comes from the numerics of later library versions and from the default image processor's resizing.
trust_remote_code=True still loads WeMM-Embedding's class (modeling_wemm_embedding.py, which the evaluation code reads); its embedding method computes the same embedding.
Training
| Base model | Qwen/Qwen3.5-9B-Base (revision 68c46c4b) |
| Parameters | 8.39B (bfloat16) |
| Embedding dimension | 4,096 |
| Stage 1 | contrastive learning, LoRA (rank 64) on the language model and the vision tower, 109 curated datasets; the 9B model's stage 1 also samples a web pool of DataComp-1B images with generated captions and questions |
| Stage 2 | language-model LoRA widened to rank 256, decoupled distillation from cached teacher embeddings (Qwen3-VL-Embedding-8B for 51 datasets, WeMM-Embedding-9B for 24) |
| Hardware | TPU v5p, JAX |
Training images were capped at 1,024 visual tokens (1,280 for document pages); evaluation allows up to 8,192. The recipe files of all four sizes are in the code release.
Limitations
- Encodes text, images, and document pages; not video or audio.
- Trails other models on MIEB's compositionality tasks; the training mixture includes no synthetic text-perturbed negatives.
- Stage 2 distills from open-weight teachers whose own post-training data are not public.
- Much of the training data comes from datasets licensed for non-commercial or research use only, or with no stated license (49% of the 2B model's stage-1 pairs); the weights are released for non-commercial use.
License
The weights are licensed under CC BY-NC 4.0. The model code, tokenizer, and processor files come from WeMM-Embedding (Apache-2.0), and the weights are derived from Qwen/Qwen3.5-9B-Base (Apache-2.0); see NOTICE and third_party/.
Citation
@article{liu2026openembed,
title = {{OpenEmbed}: A Family of Frontier Multimodal Embedding Models with Open Data, Code, and Weights},
author = {Liu, Yanqing and Zhang, Letian and Yao, Huaxiu and Zheng, Zeyu and Zhou, Yuyin and Xie, Cihang},
journal = {arXiv preprint arXiv:2612.02432},
year = {2026}
}