You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

embeddingmagibu2

Turkish-first multimodal embeddings: text, images, speech, sound and video in one space.

embeddingmagibu2 (release v1) is a multilingual, multimodal embedding model developed by Magibu AI Research, with Turkish at the center of its tokenizer and adaptation process. It maps text and media into a shared, normalized 768-dimensional embedding space for semantic search and retrieval.

Built on Google's EmbeddingGemma 2, it extends the Turkish adaptation pipeline we introduced in our research paper to a multimodal model. It supports applications such as searching images with Turkish descriptions, matching Turkish speech to transcripts, and retrieving documents by meaning.

  • Higher retrieval means than the teacher in our evaluation: 0.5815 vs 0.5706 on the 10-task Turkish mini-suite; 0.6456 vs 0.6338 on English NanoBEIR.
  • More compact Turkish tokenization: 1.80 tokens per word on our native Turkish sample, compared with 2.41 for the original Gemma tokenizer.
  • 8,192-token text context and 768-dimensional normalized embeddings. Long-document retrieval quality has not been separately benchmarked.
  • Stronger Turkish text→image retrieval in both image tests: Flickr8k-TR Recall@1 rises from 73.8% to 77.4%; XM3600-TR from 79.8% to 81.8%. Results vary by direction and modality; see the full table below.

These are development-set results with known data-overlap limitations, detailed in Evaluation scope and data overlap.

Choose a variant

There is one model in this repository. Its text model is always loaded; the vision encoder (images, video) and the audio encoder (speech, sound) are optional, and you choose them when you load the model. Every variant produces exactly the same text vectors, so an index built with one variant can be queried with any other.

Variant Inputs Sentence Transformers (config_kwargs) Ollama tag Parameters loaded
Text Text {"vision_config": None, "audio_config": None} alibayram/embeddingmagibu2:270m 271M
Text + vision Text, image, video {"audio_config": None} alibayram/embeddingmagibu2:440m 439M
Text + audio Text, speech, sound {"vision_config": None} alibayram/embeddingmagibu2:570m 577M
Full All of the above {} (default) alibayram/embeddingmagibu2 (:740m) 744M
  • Hugging Face: config_kwargs decides which encoders are built in memory. The weight file (~1.49 GB) is downloaded once in full whichever variant you pick; the skipped encoders are simply not loaded.
  • Ollama: each tag is a separate, smaller download that contains only its encoders (see Ollama).
  • Versions: the repository will receive future releases. To pin this one, add revision="v1" when loading.

Quick start

This repository uses gated access. If prompted, accept its access conditions on Hugging Face and authenticate your environment with an account that has access.

pip install -U "sentence-transformers>=6.1" "transformers>=5.19" pillow torchcodec

Text: search and similarity

For text-only work, load the text variant; it uses the least memory and gives the same vectors as the full model.

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("magibu/embeddingmagibu2", config_kwargs={"vision_config": None, "audio_config": None})

queries = ["Türkiye'nin başkenti neresidir?"]
documents = [
    "Ankara, Türkiye'nin başkentidir ve İç Anadolu Bölgesi'nde yer alır.",
    "İstanbul, Türkiye'nin en kalabalık şehridir.",
]

query_vectors = model.encode(queries, prompt_name="query")
document_vectors = model.encode(documents, prompt_name="document")
print(model.similarity(query_vectors, document_vectors))  # shape: (1, 2)

pair = model.encode(["Bugün hava çok güzel.", "Hava bugün harika."], prompt_name="STS")
print(model.similarity(pair[:1], pair[1:]))

Images and video: search with Turkish text

Load at least the vision encoder (config_kwargs={"audio_config": None}) or the full model.

from PIL import Image
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("magibu/embeddingmagibu2", config_kwargs={"audio_config": None})

with Image.open("photo.jpg") as image:
    image_vectors = model.encode([image.convert("RGB")], prompt="")

video_vectors = model.encode(["clip.mp4"], prompt="")  # a local video file
text_vectors = model.encode(["Karda koşan bir köpek"], prompt_name="query")
print(model.similarity(text_vectors, image_vectors), model.similarity(text_vectors, video_vectors))

Speech and sound

Load at least the audio encoder (config_kwargs={"vision_config": None}) or the full model. Audio is a mono waveform at 16 kHz.

import soundfile as sf
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("magibu/embeddingmagibu2", config_kwargs={"vision_config": None})

waveform, rate = sf.read("speech_16k.wav")  # mono, 16,000 Hz
audio_vectors = model.encode([{"array": waveform, "sampling_rate": rate}], prompt="")
text_vectors = model.encode(["Yarın İstanbul'da yağmur bekleniyor."], prompt_name="query")
print(model.similarity(text_vectors, audio_vectors))

Encode media without a text prompt (prompt="") and use the query prompt for the text matched to it. Media decoding may require compatible PyTorch, TorchCodec and FFmpeg installations. Sound and video were trained and evaluated with English captions; Turkish sound/video retrieval has not been quantitatively validated. The speech benchmark uses Turkish transcripts. Video is processed through sampled visual frames; its audio track is not represented automatically.

Ollama

Each tag holds two builds and Ollama picks one for your machine: MLX (BF16) on Apple Silicon and GGUF (llama.cpp) elsewhere.

Tag Inputs Download (GGUF / MLX)
270m Text 0.30 GB / 0.56 GB
440m Text, image 0.67 GB / 0.89 GB
570m Text, audio 0.92 GB / 1.17 GB
740m, latest Text, image, audio 1.29 GB / 1.50 GB
ollama pull alibayram/embeddingmagibu2:270m
import ollama

q = ollama.embed(model="alibayram/embeddingmagibu2:270m", input="task: search result | query: Türkiye'nin başkenti neresidir?")
d = ollama.embed(model="alibayram/embeddingmagibu2:270m", input="title: none | text: Ankara, Türkiye'nin başkentidir.")

Ollama does not add prompts: prepend them to the text yourself (task: search result | query: for queries, title: none | text: for documents; the other prompts are in config_sentence_transformers.json). Media go without a prompt, as base64 entries: input=[{"image": base64_jpeg}] or input=[{"audio": base64_wav}]. Ollama's API does not accept video.

GGUF files for llama.cpp

The gguf/ folder holds llama.cpp conversions of this release. Sentence Transformers does not download them.

File Contents Size
embeddingmagibu2-v1-Q8_0.gguf Text model (tokenizer, mean pooling, 512→768 projection) 304 MB
embeddingmagibu2-v1-BF16.gguf Text model, BF16 558 MB
mmproj-embeddingmagibu2-v1-BF16.gguf Vision + audio encoders 982 MB
mmproj-embeddingmagibu2-v1-Q8_0.gguf Vision + audio encoders, Q8_0 555 MB
mmproj-embeddingmagibu2-v1-vision-BF16.gguf Vision encoder only 368 MB
mmproj-embeddingmagibu2-v1-audio-BF16.gguf Audio encoder only 614 MB
Modelfile.270m … Modelfile.740m Ollama Modelfiles for the four variants
hf download magibu/embeddingmagibu2 --include "gguf/embeddingmagibu2-v1-Q8_0.gguf" --include "gguf/mmproj-embeddingmagibu2-v1-BF16.gguf" --local-dir .
llama-server -m gguf/embeddingmagibu2-v1-Q8_0.gguf --mmproj gguf/mmproj-embeddingmagibu2-v1-BF16.gguf --embeddings

Checked against this model in PyTorch (FP32) on 30 items each (Turkish MS MARCO, Flickr8k-TR images, FLEURS Turkish speech):

Text cosine (min) Image cosine (mean / min) Audio cosine (mean) Caption → image Recall@1
PyTorch 1.00
Ollama MLX 0.9997 0.999 / 0.998 1.000 1.00
GGUF (llama.cpp) 0.9996 0.94 / 0.89 0.998 0.93

Image vectors through llama.cpp are less precise; Google's own embeddinggemma-2 GGUF shows the same gap on these images (0.94), so it comes from llama.cpp's image path. For image search outside Apple Silicon, prefer Sentence Transformers.

Prompts and embedding compatibility

Use query for search queries, document for untitled documents, and STS for both sides of a sentence-similarity comparison. Other saved prompts include QuestionAnswering, FactChecking, Classification, Clustering and CodeRetrieval; inspect model.prompts for the full list.

For a document with a title, supply the formatting yourself and disable an additional prompt:

titled_documents = ["title: Ankara | text: Ankara, Türkiye'nin başkentidir."]
vectors = model.encode(titled_documents, prompt="")

All variants share one text embedding space: loading with or without the media encoders gives identical text vectors (cosine 1.000000 on our checks). Different hardware or precision can still introduce small numerical differences. Keep model version, prompts, dimensions and preprocessing consistent across indexing and querying; to pin this release, load it with revision="v1".

Do not reuse an index built with the original teacher or embeddingmagibu-200m: adaptation changes the embedding space. Re-embed that corpus with the new model.

Use BF16 on supported hardware or FP32 elsewhere; avoid FP16, as described in the base model's numerical-precision guidance. All reported results use 768-dimensional embeddings. Although training included 512/256/128 dimensions, their quality has not been evaluated for this release; truncated vectors must be re-normalized.

Research and training

Developed by Magibu AI Research, this release builds on our Turkish adaptation pipeline introduced in Adapting Multilingual Embedding Models to Turkish via Cross-Lingual Tokenizer Surgery and Offline Distillation, first submitted on 28 May 2026.

That paper describes the earlier embeddingmagibu-200m model. embeddingmagibu2 extends this line of work to EmbeddingGemma 2, with a new tokenizer, retrieval training and multimodal alignment. The base architecture and pretrained weights come from Google; our contribution is the Turkish adaptation pipeline, tokenizer adaptation, training and released checkpoints.

  1. Turkish tokenizer surgery. Altus replaces 42,484 rarely used entries in the Gemma-4-compatible vocabulary with Turkish subwords, retaining 219,660 entries and the original vocabulary size of 262,144. New embedding rows start from the mean of the teacher's subtoken embeddings. Other weights are copied from the teacher at initialization, then trained in the stages below.
  2. Offline distillation. Precomputed teacher vectors from 40-language Wikipedia provide multilingual supervision. A 23-source Turkish task mix then adds retrieval, QA, similarity, NLI, classification, clustering and bitext tasks, using cosine alignment and an in-batch ranking KL loss.
  3. Contrastive retrieval training. Two rounds use Turkish and English labelled pairs, newly mined student hard negatives, and teacher text/image anchors. Training includes Matryoshka dimensions of 768, 512, 256 and 128. Turkish pairs come from the remaining TR-MTEB data after evaluation filtering and additional QA/FAQ sources. English pairs come from NQ, HotpotQA, FiQA and FEVER in lightonai/embeddings-fine-tuning-filtered-en.
  4. Weight merging. The second retrieval checkpoint and the task-mix checkpoint are averaged with equal weights to balance retrieval, sentence similarity and cross-modal alignment.
  5. Multimodal alignment. One epoch (1,203 steps, batch size 128) combines retrieval, image–caption, Turkish speech–transcript, English sound–caption and English video–caption pairs, with teacher anchors. Sources include Flickr8k, FLEURS, Common Voice 17, Clotho and MSR-VTT. Only the text backbone is updated in this stage; the vision and audio encoders remain frozen.
  6. Release packaging. The full checkpoint is saved in BF16. The text, text + vision and text + audio variants are loaded from it (Sentence Transformers config_kwargs, Ollama tags); llama.cpp conversions are in gguf/.

Evaluation scope and data overlap

All scores below are our own development evaluations at 768 dimensions, not an official MTEB leaderboard submission or an independent final holdout. The same evaluation setup is used for the teacher and student. These suites were consulted during development.

  • Turkish retrieval: trmteb-retrieval-mini, with 200 selected test queries per task. Each corpus contains all relevant documents, BM25 top-20 distractors and random documents, capped at 10,000; smaller corpora are retained in full. Texts are clipped to 2,000 characters. Relevance is treated as binary. Queries use FactChecking for SciFact, QuestionAnswering for SQuAD/TQuAD, and query otherwise; documents use the title/text format shown above. These scores are not comparable to full-corpus TR-MTEB scores. Many Turkish tasks are translated from English.
  • Training overlap: selected evaluation queries and positives were filtered from later retrieval-training data by text matching. That filtering did not cover every earlier distillation source. The earlier task mix combined source splits, including STSb-TR test data, and TQuAD/TQuAD-2 have overlapping source contexts. Thus, this is not an all-stage contamination-free evaluation. STSb-TR is reported only as a seen-source reference; TQuAD also needs this qualification. No comprehensive cross-stage overlap audit has been completed for every benchmark.
  • English retrieval: mean nDCG@10 across 13 NanoBEIR datasets.
  • Sentence similarity: Spearman correlation between cosine similarity and labels, using the STS prompt. STS22-tr uses train+test; SICK-R-TR and STSb-TR use test.
  • Uncertainty: no confidence intervals or significance tests are reported. Small score gaps should not be treated as established differences in general quality.

Results

Teacher = google/embeddinggemma-2. Text results apply to every variant (their text vectors are identical).

Turkish retrieval (nDCG@10)

Task Teacher v1
MS MARCO-TR 0.7115 0.7592
FiQA-TR 0.3093 0.3582
NFCorpus-TR 0.3086 0.2940
SciFact-TR 0.6928 0.6871
ArguAna-TR 0.5305 0.5665
SCIDOCS-TR 0.2031 0.2032
Quora-TR 0.8525 0.8587
CQADupStack-Gaming-TR 0.5538 0.5477
SQuAD-TR 0.6710 0.6568
TQuAD 0.8730 0.8830
Mean 0.5706 0.5815

English retrieval and Turkish sentence similarity

Benchmark Metric Teacher v1
NanoBEIR, 13-set mean nDCG@10 0.6338 0.6456
STS22-tr Spearman 0.7420 0.7293
SICK-R-TR Spearman 0.7443 0.7440
STSb-TR — seen-source reference Spearman 0.7888 0.7898

STSb-TR is excluded from claims about generalization because its source test split was included in the earlier distillation mix.

Cross-modal retrieval (Recall@1, %)

Each test uses 500 media–text pairs, except MSR-VTT (300), with one selected caption/transcript per media item. Captions use query; media use no text prompt. Splits are Flickr8k test, XM3600 test, FLEURS tr test, Clotho test and MSR-VTT test_1k. Multimodal training uses separate splits, but some test examples were monitored during development, so these are not fresh final holdouts.

Set Direction Teacher v1
Flickr8k TR (image) text → image 73.8 77.4
image → text 67.8 69.6
Flickr8k EN (image) text → image 87.0 86.8
image → text 86.0 83.8
XM3600 TR (image, human captions) text → image 79.8 81.8
image → text 79.4 66.4
FLEURS TR (speech ↔ transcript) text → speech 56.8 56.4
speech → text 56.6 55.4
Clotho EN (sound ↔ caption) text → sound 10.0 11.6
sound → text 7.4 11.8
MSR-VTT EN (video ↔ caption) text → video 61.3 61.7
video → text 60.3 58.3

Known weakness: XM3600-TR image→text. The raw score falls from 79.4% to 66.4%. A diagnostic found caption hubs: one caption was the top match for 20 of 500 images. On this fixed evaluation collection, centering and normalizing both the image and caption vectors yielded 80.0%; CSLS rescoring yielded 80.4%. These are separate, collection-dependent postprocessing results, not the model's raw score. Centering also reduced text→image Recall@1 from 81.8% to 79.4%.

Do not subtract the mean of a single incoming query or a tiny query batch: it can destroy the vector. Any such postprocessing needs an appropriate reference collection and validation for the intended retrieval direction.

Comparison on the same Turkish retrieval suite

Model Parameters Mean nDCG@10 Docs/s Raw vectors, KiB/doc Tokens / Turkish word
Vor-LateEmbed-TR-0.6B-v1 (late interaction) 594M 0.6104 58 35.2 2.49
embeddinggemma-300m 308M 0.5899 444 1.5 2.41
multilingual-e5-large-instruct 560M 0.5872 896 2.0 1.96
embeddingmagibu2 (text variant) 271M 0.5815 442 1.5 1.80
bge-m3 568M 0.5729 909 2.0 1.96
embeddinggemma-2 (teacher) 744M total; 271M text 0.5706 391 1.5 2.41
turkish-e5-large 560M 0.5662 890 2.0 1.96
multilingual-e5-base 278M 0.5476 1475 1.5 1.96
Mursit-Large-TR-Retrieval 404M 0.5214 613 2.0 1.69
embeddingmagibu-200m 207M 0.5083 459 1.5 1.83
Qwen3-Embedding-0.6B 596M 0.4957 295 2.0 2.73

In this comparison, the text variant ranks third among single-vector models and is the smallest of those three. Its mean is 0.0084 below EmbeddingGemma-300m and 0.0057 below multilingual-e5-large-instruct. Vor has the highest score and uses multi-vector late interaction rather than a single vector per document.

Measurement details:

  • Models use their recommended prompts and document formatting. The evaluation and overlap qualifications above apply to this entire table.
  • Throughput uses A100 40 GB GPUs, BF16, batch size 32, and 2,000 Turkish documents clipped to 2,000 characters, with warm-up and synchronization. Measurements include separate runs on two A100 hosts. In the direct same-host Vor comparison, Vor encoded 58 docs/s and the text variant encoded 438 docs/s; the main run shown above recorded 442. These are document-encoding measurements, not end-to-end search latency.
  • The 442 docs/s result was measured with the text-only weights (equivalent to the text variant); the full multimodal load was not timed separately.
  • Raw vector storage assumes 16-bit values and excludes ANN structures and metadata. A 768-dimensional vector uses 1,536 bytes = 1.5 KiB. Vor's 35.2 KiB/doc is a sample average for its token vectors.
  • Tokenization uses 19,744 words from native Turkish Wikipedia contexts in TQuAD. Altus uses 25.3% fewer tokens than Gemma and 8.2% fewer than XLM-R on this sample. It has the lowest token count among the multilingual tokenizers tested here; the Turkish-only Mursit tokenizer uses fewer. These ratios depend on the text domain.

Model details

Property Value
Developer Magibu AI Research
Base google/embeddinggemma-2
Text architecture EmbeddingGemma2TextModel; 24 layers; hidden size 512; projection 512→768
Tokenizer magibu/Altus; 262,144 entries
Output One 768-dimensional L2-normalized vector per input
Text pooling Mean
Maximum text sequence 8,192 tokens, including prompt/special tokens
Parameters 744,371,512 total; 271,002,648 in the text variant
Saved weights BF16
License Apache-2.0

Limitations and deployment notes

  • Task-dependent quality: NFCorpus-TR, SciFact-TR, SQuAD-TR, CQADupStack-Gaming-TR and STS22-tr remain below the teacher. The higher retrieval mean does not imply improvement on every task.
  • Coverage: multilingual training does not establish equal quality across languages. Most reported text evidence is Turkish and English. Tokenization efficiency and quality in other languages need their own evaluation.
  • Context length: retrieval texts here were clipped to 2,000 characters. An 8K context limit does not establish reliable retrieval across an entire 8K document; choose chunking and truncation for your corpus.
  • Production validation: these benchmarks do not measure production RAG answer quality, domain-specific accuracy, query latency or complete vector-database memory use. Validate with your own queries and relevance labels.
  • Uneven cross-modal results: Turkish text→image improves on both tested sets, while XM3600-TR image→text has a substantial regression. Speech scores are slightly below the teacher. Sound/video evidence is English-only; the model has not been validated across every language–modality combination.

Citation

Please cite the paper for the adaptation methodology and link this model repository for the specific v2 checkpoint. The paper reports the predecessor model, not the v2 results above.

@misc{bayram2026embeddingmagibu,
  title         = {Adapting Multilingual Embedding Models to Turkish via Cross-Lingual Tokenizer Surgery and Offline Distillation},
  author        = {Bayram, M. Ali and Diri, Banu and Y{\i}ld{\i}r{\i}m, Sava{\c{s}}},
  year          = {2026},
  eprint        = {2605.29992},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CL}
}

Developed by Magibu AI Research. Base model: Google EmbeddingGemma 2. Tokenizer: Magibu Altus.

Downloads last month
-
Safetensors
Model size
0.7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for magibu/embeddingmagibu2

Quantized
(112)
this model

Spaces using magibu/embeddingmagibu2 2

Paper for magibu/embeddingmagibu2