How to Run Tencent OmniEVIE-4B Locally (It Outputs a 2048-Dim Vector per Token)
Tencent's OmniEVIE-4B embedding model landed on Hugging Face on November 24 with an Apache-2.0 license and a #1 spot on the MMEB leaderboard (the audio-excluded board). The BF16 checkpoint is 9.09 GB, and community GGUF
Tencent's OmniEVIE-4B embedding model landed on Hugging Face on November 24 with an Apache-2.0 license and a #1 spot on the MMEB leaderboard (the audio-excluded board). The BF16 checkpoint is 9.09 GB, and community GGUF and MLX quants bring it down to 2.6β5.2 GB, small enough for a 24 GB GPU or a 16 GB Mac. Before you swap it into your local RAG stack in place of bge or Qwen3-Embedding, look at what comes out of it. You don't get one vector per document. You get one 2048-dim vector per token.
So your vector database, your storage bill and your retrieval code all have to change. I went through the specs and benchmarks in the model card, the GitHub repo and the paper, and below are working commands for the three ways to run it locally: sentence-transformers, Tencent's own package, and llama.cpp GGUF (plus MLX on Apple Silicon).
What Tencent OmniEVIE-4B actually is
The card calls it "a 4.5B-parameter unified multi-modal, multi-vector retrieval model", built by Tencent IMA Product Center and Tencent Youtu Lab. Quick spec sheet, from the card and config.json:
| Spec | Value |
|---|---|
| Parameters | 4,544,510,464 (BF16) |
| Base |
Qwen/Qwen3.5-4B, attention made bidirectional ("is_causal": false) |
| Modalities | text, natural images, visual documents, video, agent/tool/GUI/memory tasks. No audio |
| Output | multi-vector (late interaction, ColBERT-style), 2048 dims per token |
| Matryoshka dims | 64, 128, 256, 512, 1024, 2048 (2048 is the default; lower via truncate_dim) |
| Context |
max_position_embeddings 262144 in config; 4,096-token image budget |
| License | Apache-2.0 |
| Weights |
model.safetensors 9.09 GB + a 1.41 kB query_gate.safetensors
|
The backbone is a Qwen3.5 hybrid: 32 layers, where every fourth is full attention and the rest are linear attention. Keep that in mind, because it's the reason batching breaks further down.
The paper's pitch: single vectors lose local evidence, cross-encoders reread every recalled item online, and uncompressed late interaction is too large to serve. So Tencent compresses each record to at most 128 int8 vectors of 64 dims, which they put at 9,472 bytes per record, or 8.82 GiB per million records. With K=32 it drops to 2.15 GiB per million.
The benchmarks, and the comparison nobody asked for
It's tempting to frame this as "OmniEVIE vs Qwen3 Embedding." Tencent doesn't benchmark against text-only Qwen3-Embedding at all. The card's comparisons are Qwen3-VL-Embedding (2B, 8B), WeMM-Embedding (2B, 4B, 9B) and, on ViDoRe, Nemotron-ColEmbed-V2-8B.
| Benchmark | OmniEVIE-4B Full | OmniEVIE-4B compressed | Best competitor listed |
|---|---|---|---|
| MMEB-V3 (190 tasks) | 60.68 | 60.06 (32-frame) | WeMM-Embedding-9B 59.33 |
| MMEB-V3 Text track | 52.97 | 51.77 | WeMM-Embedding-9B 48.76 |
| MMEB-V2 (78 tasks) | 78.56 | 77.96 (32-frame) | WeMM-Embedding-9B 80.58 |
| MMEB-V2 VisDoc | 84.70 | 84.02 | WeMM-Embedding-9B 83.34 |
| ViDoRe V3 nDCG@10 | 64.34 | 62.96 (K128) | Nemotron-ColEmbed-V2-8B 63.76 |
I read that table two ways. First, WeMM-Embedding-9B beats it on MMEB-V2 overall and on the image (81.87 vs 78.70) and video (74.31 vs 70.08) splits; OmniEVIE wins on visual documents. Second, the ViDoRe "win" over Nemotron is the uncompressed Full mode, which the card itself labels the "Prefix-MRL upper bound." The compressed index you'd actually deploy scores 62.96, a bit under Nemotron's 63.76. Still very good for 4.5B parameters against an 8B model, but the headline number is the one you won't ship.
The CPU latency table is the part I find more interesting than the leaderboard. Single-thread search over 1M records: 54.2 ms with their three-stage index, versus 12,781 ms for full int8 MaxSim and 331.0 ms for exact single-vector search at d=2048.
How much memory you need
Neither the card nor the GitHub README gives a measured VRAM figure for the original checkpoint. Here's what there is:
- BF16 weights: 9.09 GB on disk (
model.safetensors). Activations come on top, and with a 4,096-token budget per image (more for video), that adds up fast. - The Xylolabs GGUF repo says "Every file here fits a 24 GB GPU with an 8K-token context."
- The Xylolabs MLX ports claim it fits "any Mac with 16 GB of unified memory at an 8K-token context."
Quantized file sizes from Xylolabs, with their own retrieval checks (ViDoRe V3 CS nDCG@10, full 2048-dim MaxSim):
| File | Size | ViDoRe CS |
|---|---|---|
| Tencent BF16 (sentence-transformers, reference) | 9.09 GB | 80.03 |
| GGUF Q8_0 | 4.49 GB | 80.01 |
| GGUF Q5_K_M | 3.10 GB | 79.91 |
| GGUF Q4_K_M | 2.74 GB | 79.55 |
| MLX 8-bit | 5.15 GB | 80.10 |
| MLX 4-bit | 3.36 GB | 79.89 |
GGUF needs a separate 676 MB mmproj-OmniEVIE-4B-BF16.gguf for the vision tower. One caveat: MLX 4-bit's page-token cosine to fp32 is 0.8860, lower than any GGUF quant (Q4_K_S is 0.9202). Retrieval held up on their test, but I'd pick 8-bit or Q8_0 if you can spare the memory.
The memory that will actually hurt is the index. In full mode each token is 2048 floats. At fp32 that's 8 KB per token, so a 128-token document costs 1 MB before any compression. Do the math against your corpus before you get excited.
Option 1: run OmniEVIE-4B with sentence-transformers (easiest, uncompressed)
Tom Aarsen's PR #1 added native support, no trust_remote_code:
pip install "sentence-transformers[image,video]>=6.3.0" "transformers>=5.13.1"
from sentence_transformers import MultiVectorEncoder
model = MultiVectorEncoder("tencent/OmniEVIE-4B")
query_embeddings = model.encode_query(queries, batch_size=1)
document_embeddings = model.encode_document(documents, batch_size=1)
scores = model.similarity(query_embeddings, document_embeddings).cpu()
Keep batch_size=1. The card is explicit: left-padding perturbs the Qwen3.5 linear-attention layers, so batched outputs drift from the reference. The GitHub README says the same about its own package ("Every input runs in its own forward pass"). You pay for that in throughput on large ingest jobs.
This path skips the ST-HAC compression, saliency gate, three-stage index and localization. You get raw per-token 2048-dim vectors. Pass truncate_dim=128 or 64 to shrink them.
Option 2: Tencent's omnievie package (CUDA only, in practice)
git clone https://github.com/Tencent/OmniEVIE.git
cd OmniEVIE
pip install -e ".[test]"
It needs flash-attn>=2.7.0 and is verified with torch 2.7.1, transformers 5.13β5.17, flash-attn 2.8.1. This is the only route that gives you the ST-HAC compressed index, the three-stage search and page/video localization. There's a CLI:
omnievie --weights tencent/OmniEVIE-4B index index.pt photos/ clips/ notes/
omnievie --weights tencent/OmniEVIE-4B search index.pt --text "a dog catching a frisbee" --target video --top 3
Option 3: OmniEVIE-4B GGUF on llama.cpp (fork required), or MLX on a Mac
Stock llama.cpp won't do it. The GGUF card says it "Needs our llama.cpp branch omnievie", pinned to commit 1f190c83:
git clone -b omnievie https://github.com/XylolabsInc/llama.cpp && cd llama.cpp && git checkout 1f190c83
cmake -B build -DCMAKE_BUILD_TYPE=Release # add -DGGML_CUDA=ON for NVIDIA GPUs
cmake --build build -j --target llama-mtmd-embedding
hf download Xylolabs/OmniEVIE-4B-GGUF OmniEVIE-4B-Q8_0.gguf mmproj-OmniEVIE-4B-BF16.gguf --local-dir .
S=$(printf '<|endoftext|>%.0s' 1 2 3 4 5 6 7 8 9 10)
./build/bin/llama-mtmd-embedding OmniEVIE-4B-Q8_0.gguf mmproj-OmniEVIE-4B-BF16.gguf - "Which model ranks first on MMEB?$S" query.f32 4608
./build/bin/llama-mtmd-embedding OmniEVIE-4B-Q8_0.gguf mmproj-OmniEVIE-4B-BF16.gguf page.png $'<|im_start|>user\n<__media__><|im_end|><|endoftext|>' page.f32 4608
You score it yourself with MaxSim:
import numpy as np
q, d = (np.fromfile(f, np.float32).reshape(-1, 2048) for f in ("query.f32", "page.f32"))
score = (q @ d.T).max(axis=1).sum()
Note the ten <|endoftext|> tokens appended to the query text. That comes from the model's chat template, which adds ten for text inputs and image queries but only one for image documents and video; get it wrong and your vectors won't match the reference. The GGUF build leaves video out, and so do the MLX weight cards, though the omnievie-mlx package itself accepts {"video": frames} if you install its [video] extra.
On Apple Silicon: pip install mlx-vlm "git+https://github.com/XylolabsInc/[email protected]", then OmniEVIEMLX.load("Xylolabs/OmniEVIE-4B-MLX-4bit").
What about vLLM or an HTTP server?
None of the sources mention vLLM, and with per-token outputs plus the no-padding constraint, I wouldn't expect a clean serving story soon. If you need an HTTP endpoint today, wrap sentence-transformers in FastAPI and accept the batch size of one.
Should you replace your current embedding model?
If your corpus is scanned PDFs, slides, screenshots or video, yes, try it this week. Visual documents are where it wins its numbers, and the Q8_0 GGUF at 4.49 GB is easy to fit.
If your RAG is plain text chunks in pgvector or a single-vector store, I'd hold off. You'd be replacing one vector per chunk with up to 128, rewriting retrieval around MaxSim, and losing batched inference, for a model Tencent never benchmarked against the text embedders you're likely using now. That's a migration, and the card doesn't give you the numbers to justify it.
What embedding model is your local RAG running today, and would a 4B multi-vector one be worth the extra VRAM and the index rewrite? If you've already pointed it at a real PDF pile, I want to hear how the compressed index held up.
Sources
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.