Views
No views yet

jina-embeddings-v4 is a universal embedding model for multimodal and multilingual retrieval.
The model is specially designed for complex document retrieval, including visually rich documents with charts, tables, and illustrations.jina-embeddings-v4 features:| Feature | Jina Embeddings V4 |
|---|---|
| Base Model | Qwen2.5-VL-3B-Instruct |
| Supported Tasks | retrieval, text-matching, code |
| Model DType | BFloat 16 |
| Max Sequence Length | 32768 |
| Single-Vector Dimension | 2048 |
| Multi-Vector Dimension | 128 |
| Matryoshka dimensions | 128, 256, 512, 1024, 2048 |
| Pooling Strategy | Mean pooling |
| Attention Mechanism | FlashAttention2 |
transformers>=4.52.0torch>=2.6.0peft>=0.15.2torchvisionpillowsentence-transformers interface, install this package as well.1curl https://api.jina.ai/v1/embeddings \
2 -H "Content-Type: application/json" \
3 -H "Authorization: Bearer $JINA_AI_API_TOKEN" \
4 -d @- <<EOFEOF
5 {
6 "model": "jina-embeddings-v4",
7 "task": "text-matching",
8 "input": [
9 {
10 "text": "غروب جميل على الشاطئ"
11 },
12 {
13 "text": "海滩上美丽的日落"
14 },
15 {
16 "text": "A beautiful sunset over the beach"
17 },
18 {
19 "text": "Un beau coucher de soleil sur la plage"
20 },
21 {
22 "text": "Ein wunderschöner Sonnenuntergang am Strand"
23 },
24 {
25 "text": "Ένα όμορφο ηλιοβασίλεμα πάνω από την παραλία"
26 },
27 {
28 "text": "समुद्र तट पर एक खूबसूरत सूर्यास्त"
29 },
30 {
31 "text": "Un bellissimo tramonto sulla spiaggia"
32 },
33 {
34 "text": "浜辺に沈む美しい夕日"
35 },
36 {
37 "text": "해변 위로 아름다운 일몰"
38 },
39 {
40 "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
41 },
42 {
43 "image": "https://i.ibb.co/r5w8hG8/beach2.jpg"
44 }
45 ]
46 }
47EOFEOF1# !pip install transformers>=4.52.0 torch>=2.6.0 peft>=0.15.2 torchvision pillow
2# !pip install
3from transformers import AutoModel
4import torch
5
6# Initialize the model
7model = AutoModel.from_pretrained("jinaai/jina-embeddings-v4", trust_remote_code=True, torch_dtype=torch.float16)
8
9model.to("cuda")
10
11# ========================
12# 1. Retrieval Task
13# ========================
14# Configure truncate_dim, max_length (for texts), max_pixels (for images), vector_type, batch_size in the encode function if needed
15
16# Encode query
17query_embeddings = model.encode_text(
18 texts=["Overview of climate change impacts on coastal cities"],
19 task="retrieval",
20 prompt_name="query",
21)
22
23# Encode passage (text)
24passage_embeddings = model.encode_text(
25 texts=[
26 "Climate change has led to rising sea levels, increased frequency of extreme weather events..."
27 ],
28 task="retrieval",
29 prompt_name="passage",
30)
31
32# Encode image/document
33image_embeddings = model.encode_image(
34 images=["https://i.ibb.co/nQNGqL0/beach1.jpg"],
35 task="retrieval",
36)
37
38# ========================
39# 2. Text Matching Task
40# ========================
41texts = [
42 "غروب جميل على الشاطئ", # Arabic
43 "海滩上美丽的日落", # Chinese
44 "Un beau coucher de soleil sur la plage", # French
45 "Ein wunderschöner Sonnenuntergang am Strand", # German
46 "Ένα όμορφο ηλιοβασίλεμα πάνω από την παραλία", # Greek
47 "समुद्र तट पर एक खूबसूरत सूर्यास्त", # Hindi
48 "Un bellissimo tramonto sulla spiaggia", # Italian
49 "浜辺に沈む美しい夕日", # Japanese
50 "해변 위로 아름다운 일몰", # Korean
51]
52
53text_embeddings = model.encode_text(texts=texts, task="text-matching")
54
55# ========================
56# 3. Code Understanding Task
57# ========================
58
59# Encode query
60query_embedding = model.encode_text(
61 texts=["Find a function that prints a greeting message to the console"],
62 task="code",
63 prompt_name="query",
64)
65
66# Encode code
67code_embeddings = model.encode_text(
68 texts=["def hello_world():\n print('Hello, World!')"],
69 task="code",
70 prompt_name="passage",
71)
72
73# ========================
74# 4. Use multivectors
75# ========================
76
77multivector_embeddings = model.encode_text(
78 texts=texts,
79 task="retrieval",
80 prompt_name="query",
81 return_multivector=True,
82)
83
84images = ["https://i.ibb.co/nQNGqL0/beach1.jpg", "https://i.ibb.co/r5w8hG8/beach2.jpg"]
85multivector_image_embeddings = model.encode_image(
86 images=images,
87 task="retrieval",
88 return_multivector=True,
89)1from sentence_transformers import SentenceTransformer
2
3# Initialize the model
4model = SentenceTransformer("jinaai/jina-embeddings-v4", trust_remote_code=True)
5# ========================
6# 1. Retrieval Task
7# ========================
8# Encode query
9query_embeddings = model.encode(
10 sentences=["Overview of climate change impacts on coastal cities"],
11 task="retrieval",
12 prompt_name="query",
13)
14
15print(f"query_embeddings.shape = {query_embeddings.shape}")
16
17# Encode passage (text)
18passage_embeddings = model.encode(
19 sentences=[
20 "Climate change has led to rising sea levels, increased frequency of extreme weather events..."
21 ],
22 task="retrieval",
23 prompt_name="passage",
24)
25
26print(f"passage_embeddings.shape = {passage_embeddings.shape}")
27
28# Encode image/document
29image_embeddings = model.encode(
30 sentences=["https://i.ibb.co/nQNGqL0/beach1.jpg"],
31 task="retrieval",
32)
33
34print(f"image_embeddings.shape = {image_embeddings.shape}")
35
36# ========================
37# 2. Text Matching Task
38# ========================
39texts = [
40 "غروب جميل على الشاطئ", # Arabic
41 "海滩上美丽的日落", # Chinese
42 "Un beau coucher de soleil sur la plage", # French
43 "Ein wunderschöner Sonnenuntergang am Strand", # German
44 "Ένα όμορφο ηλιοβασίλεμα πάνω από την παραλία", # Greek
45 "समुद्र तट पर एक खूबसूरत सूर्यास्त", # Hindi
46 "Un bellissimo tramonto sulla spiaggia", # Italian
47 "浜辺に沈む美しい夕日", # Japanese
48 "해변 위로 아름다운 일몰", # Korean
49]
50
51text_embeddings = model.encode(sentences=texts, task="text-matching")
52
53# ========================
54# 3. Code Understanding Task
55# ========================
56
57# Encode query
58query_embeddings = model.encode(
59 sentences=["Find a function that prints a greeting message to the console"],
60 task="code",
61 prompt_name="query",
62)
63
64# Encode code
65code_embeddings = model.encode(
66 sentences=["def hello_world():\n print('Hello, World!')"],
67 task="code",
68 prompt_name="passage",
69)
70
71# ========================
72# 4. Use multivectors
73# ========================
74# If you want to use multi-vector embeddings, please use the Hugging Face model directly.retrieval, text-matching, code) where specific adapter is merged into the base Qwen2.5-VL weights.
This modification enables native compatibility with vLLM.jina-embeddings-v4, we’re releasing Jina VDR, a multilingual, multi-domain benchmark for visual document retrieval. The task collection can be viewed here, and evaluation instructions can be found here.jina-embeddings-v4 useful in your research, please cite the following paper:@misc{günther2025jinaembeddingsv4universalembeddingsmultimodal,
title={jina-embeddings-v4: Universal Embeddings for Multimodal Multilingual Retrieval},
author={Michael Günther and Saba Sturua and Mohammad Kalim Akram and Isabelle Mohr and Andrei Ungureanu and Sedigheh Eslami and Scott Martens and Bo Wang and Nan Wang and Han Xiao},
year={2025},
eprint={2506.18902},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2506.18902},
}