Model reference · open weights

Diba-Embed

Embeddings Dibachain Embeddings 1 build Open weights 566 dl/mo

Diba-Embed is an open-weight embedding model from Dibachain. Diba-Embed (BF16) weighs 1.2 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • Diba-Embed is a 596M parameter text embedding model by Dibachain designed for sentence-similarity tasks in Persian and English.
  • It supports a context length of 32,768 tokens and is intended for semantic search, retrieval-augmented generation, and clustering.
  • The model is released under the Apache 2.0 license.

Summary of the Dibachain/Diba-Embed model card, 2026-10-01

What it is

Released byDibachain
Released2026-09-15
Parameters596M
VRAM1.2 GB for the weights

What it runs on

Memory and cards for Diba-Embed (BF16)

1.2 GBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What Dibachain says about Diba-Embed

Read the model card

A Persian-first text embedding model by Dibachain مدل نمایش برداری متن، فارسی‌محور، ساخته‌ی دیباچین

Website · 🤖 Agent · Chat demo (GPU) · Chat demo (CPU) · Diba-Base


English

Diba-Embed is the first text-embedding model from Dibachain and the first embedding model in the Diba family — a Persian-first model that turns Persian and English text into dense vectors, placing similar meanings close together. Built by Dibachain (dibachain.ir) and tuned and packaged for Iranian, Persian-language use cases where most open models fall short.

Use it to build semantic search, retrieval‑augmented generation (RAG), FAQ matching, clustering, deduplication, and reranking — in Persian, in English, and across the two.

What it can do

  • Persian semantic search — find the most relevant document for a Persian question, even when the wording differs.
  • Retrieval for RAG — retrieve the right passages to ground a chat model such as Diba-Base on your own documents.
  • Cross‑lingual matching — a Persian query can find an English passage and vice‑versa.
  • Clustering & deduplication — group similar tickets, comments, or products; detect near‑duplicates.
  • Reranking — order candidate passages by relevance to a query.

Specifications

Parameters~0.6B
Embedding size1024 (Matryoshka: truncatable down to 32)
Max input length32,768 tokens
LanguagesMultilingual, optimized for Persian + English
Weights~1.2 GB · runs on CPU
Similaritycosine
LicenseApache 2.0

Persian retrieval benchmark

Measured on 400 Persian question/answer pairs drawn from Diba's own grounded data (Iran history, contemporary topics, and Dibachain company Q/A). Each question must retrieve its correct passage out of the full pool. Greedy, on CPU, no task‑specific training:

MetricScore
Recall@182%
Recall@395%
MRR0.89

In 95% of cases the correct passage is among the top three results — enough to drive reliable Persian RAG and search.

Quick start

Diba-Embed ships with the Diba model definition, so pass trust_remote_code=True when loading.

sentence-transformers (recommended):

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("Dibachain/Diba-Embed", trust_remote_code=True)

# queries use the built-in "query" prompt; documents are embedded as-is
queries = ["پایتخت ایران کجاست؟"]
documents = [
    "تهران پایتخت و بزرگ‌ترین شهر ایران است.",
    "اصفهان یکی از شهرهای تاریخی ایران است.",
]

q = model.encode(queries, prompt_name="query", normalize_embeddings=True)
d = model.encode(documents, normalize_embeddings=True)
scores = q @ d.T
print(scores)   # highest score points to the matching document

transformers (last-token pooling, for full control):

import torch, torch.nn.functional as F
from transformers import AutoModel, AutoTokenizer

tok = AutoTokenizer.from_pretrained("Dibachain/Diba-Embed", padding_side="left")
model = AutoModel.from_pretrained("Dibachain/Diba-Embed", trust_remote_code=True).eval()

def embed(texts, is_query=False):
    if is_query:
        texts = [f"Instruct: Given a query, retrieve passages that answer it\nQuery: {t}" for t in texts]
    enc = tok(texts, padding=True, truncation=True, max_length=512, return_tensors="pt")
    with torch.no_grad():
        h = model(**enc).last_hidden_state
    lengths = enc["attention_mask"].sum(1) - 1
    v = h[torch.arange(h.size(0)), lengths]         # last non-pad token
    return F.normalize(v, dim=1)

sim = embed(["پایتخت ایران؟"], is_query=True) @ embed(["تهران پایتخت ایران است."]).T
print(sim)

Tip: always add the query instruction to search queries; embed documents without it. Normalize vectors and rank by cosine (dot product of normalized vectors).

Run with llama.cpp (GGUF)

Diba-Embed ships ready-to-run llama.cpp files (GGUF format; the .bin files load directly with -m) for CPU inference with llama.cpp — no Python required.

FileSizeBest for
diba-embed-q8_0.bin~0.6 GBrecommended — near‑full quality
diba-embed-q4_k_m.bin~0.4 GBsmallest, fastest
diba-embed-f16.bin~1.2 GBfull precision
# start an OpenAI-compatible embeddings server on CPU
llama-server -m diba-embed-q8_0.bin --embedding --pooling last -c 2048 --port 8080

# then request embeddings
curl http://localhost:8080/v1/embeddings   -H "Content-Type: application/json"   -d '{"input": ["تهران پایتخت ایران است", "capital of Iran"]}'

Direct download: https://huggingface.co/Dibachain/Diba-Embed/resolve/main/diba-embed-q8_0.bin

Intended use and limitations

Diba-Embed is built for search and retrieval, not for generation — it produces vectors, not text. Quality is strongest on general and formal Persian and on the domains in the benchmark above; very specialized or noisy text may need domain adaptation. It reflects biases present in its training data. For generation and chat, use Diba-Base.


فارسی

دیبا-امبد نخستین مدل بردارسازی متن (Text Embedding) شرکت دیباچین و اولین مدل امبدینگ خانواده‌ی دیبا است — مدلی فارسی‌محور که متن فارسی و انگلیسی را به بردارهای عددی تبدیل می‌کند تا متن‌های هم‌معنا در فضای برداری به هم نزدیک شوند. ساخته‌ی شرکت دیباچین (dibachain.ir) و ویژه‌ی کاربردهای فارسی‌زبان و ایرانی، جایی که

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms