Fiqh-Embed AR/FA — GGUF

Fiqh-Embed is a bilingual embedding model for semantic search over Islamic jurisprudence in the Ja'fari (Imami) tradition. It maps Arabic and Persian questions and passages into a shared 1024-dimensional space, so that a question asked in colloquial Arabic lands next to the ruling that answers it — whether that ruling is written in the Arabic of Taḥrīr al-Wasīla or the Persian of Tawḍīḥ al-Masāʾil.

The model was built by Sadiqoon Technologies from real retrieval traffic and a curated corpus of the standard reference works of the school. It continues BAAI/bge-m3 (568M parameters, 8,192-token context) and is a drop-in replacement for it: same dimensionality, same CLS pooling, no instruction prefixes.

نموذج تضمين ثنائيّ اللغة للبحث الدلاليّ في الفقه الإماميّ. يضع السؤال العربيّ — ولو بالعامّية — والنصّ الفقهيّ الذي يجيبه، عربيًّا كان أو فارسيًّا، في فضاءٍ واحد. مبنيّ على bge-m3 ويحلّ محلّه مباشرةً في أيّ منظومة استرجاع قائمة.

Highlights

  • Domain-tuned retrieval. Trained on real questions people ask a fiqh assistant — short, dialectal, often imprecise — paired with the exact passages that answered them.
  • Arabic ⇄ Persian. Persian source texts are retrievable from Arabic questions without translation; the two languages share the space by design.
  • Drop-in for bge-m3. Identical interface and vector size; re-index and go. No query prefixes, no special pooling.
  • Runs anywhere. Available as safetensors for Transformers / sentence-transformers and as GGUF for llama.cpp, Ollama and LM Studio.

Evaluation

Held-out set of 292 real questions across six categories, judged against pooled relevance labels (TREC-style, top-10 from five retrieval systems). nDCG@10:

Category n bge-m3 Fiqh-Embed
All 292 0.446 0.502
Colloquial / dialectal questions 25 0.377 0.467
Prohibition / negation rulings 60 0.469 0.545
Conceptual & applied questions 110 0.450 0.520
Terminology & definitions 45 0.484 0.503
Arabic question → Persian passage 45 0.422 0.441
Precise citation lookup 7 0.336 0.339

Both models were evaluated in the same run, with the same tokenization and 384-token passage window.

Training

  • Corpus: 40,183 passages from the reference works in Arabic and Persian — Ajwibat al-Istiftāʾāt, Taḥrīr al-Wasīla, al-Risāla al-Taʿlīmiyya, Risāla fī al-Ṣalāt wa-l-Ṣawm, al-Aḥkām al-Muntakhaba, Tawḍīḥ al-Masāʾil and others.
  • Pairs: ~3,300 real user questions matched to their source passages by verbatim quotation and page reference, plus ~8,800 Arabic queries written for Persian passages to teach the cross-lingual mapping.
  • Objective: contrastive (InfoNCE) with in-batch and mined hard negatives, Arabic and Persian mixed in every batch. Full fine-tuning of all weights.

Files

File Quant Size Notes
fiqh-embed-ar-fa-Q8_0.gguf Q8_0 0.6 GB Recommended. Indistinguishable from F16 in retrieval quality.
fiqh-embed-ar-fa-F16.gguf F16 1.1 GB Reference precision.

CLS pooling is stored in the file metadata; no flags or prefixes are needed. The original safetensors weights are in sadiqoon/fiqh-embed-ar-fa.

Usage

Ollama

ollama pull hf.co/sadiqoon/fiqh-embed-ar-fa-gguf:Q8_0
curl http://localhost:11434/api/embed \
  -d '{"model": "hf.co/sadiqoon/fiqh-embed-ar-fa-gguf:Q8_0", "input": "هل يجب الخمس في الذهب الملبوس؟"}'

LM Studio

Search for sadiqoon/fiqh-embed-ar-fa-gguf, download the Q8_0 build, and call it through the local server's /v1/embeddings endpoint like any OpenAI-compatible embedding model.

llama.cpp

llama-embedding -m fiqh-embed-ar-fa-Q8_0.gguf --pooling cls -p "هل يجب الخمس في الذهب الملبوس؟"

Python (llama-cpp-python)

from llama_cpp import Llama
llm = Llama(model_path="fiqh-embed-ar-fa-Q8_0.gguf", embedding=True, pooling_type=1)  # 1 = CLS
vec = llm.embed("هل يجب الخمس في الذهب الملبوس؟")

Citation

@misc{sadiqoon2026fiqhembed,
  title  = {Fiqh-Embed AR/FA: Bilingual Embeddings for Imami Jurisprudence},
  author = {Sadiqoon Technologies},
  year   = {2026},
  url    = {https://huggingface.co/sadiqoon/fiqh-embed-ar-fa}
}

License & Contact

MIT. Built and maintained by Sadiqoon Technologies Ltd, London. Questions and collaboration: info@sadiqoon.uk

Downloads last month
-
GGUF
Model size
0.6B params
Architecture
bert
Hardware compatibility
Log In to add your hardware

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for sadiqoon/fiqh-embed-ar-fa-gguf

Base model

BAAI/bge-m3
Quantized
(1)
this model