Model reference · open weights

Diba-Embed

Available as managed deployment Embeddings Dibachain Embeddings 1 variants 566 dl/mo

Diba-Embed is an open-weight embedding model from Dibachain. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

Released byDibachain
TypeEmbedding models
TaskEmbeddings
Parameters (lead)596M
Context32k tokens
Runs withsentence-transformers
Released2026-09-15
Popularity566 downloads / month
LicenceOpen weights

About

What Diba-Embed is

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

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


Read the full model card

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) و ویژه‌ی کاربردهای فارسی‌زبان و ایرانی، جایی که

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys diba-embed for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (diba-embed below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/embeddings \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"diba-embed","input":"text to embed"}'

Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.

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