Instructions to use sadiqoon/fiqh-embed-ar-fa-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sadiqoon/fiqh-embed-ar-fa-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16 # Run inference directly in the terminal: llama cli -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16 # Run inference directly in the terminal: llama cli -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16 # Run inference directly in the terminal: ./llama-cli -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf sadiqoon/fiqh-embed-ar-fa-gguf:F16
Use Docker
docker model run hf.co/sadiqoon/fiqh-embed-ar-fa-gguf:F16
- LM Studio
- Jan
- Ollama
How to use sadiqoon/fiqh-embed-ar-fa-gguf with Ollama:
ollama run hf.co/sadiqoon/fiqh-embed-ar-fa-gguf:F16
- Unsloth Desktop
- Docker Model Runner
How to use sadiqoon/fiqh-embed-ar-fa-gguf with Docker Model Runner:
docker model run hf.co/sadiqoon/fiqh-embed-ar-fa-gguf:F16
- Lemonade
How to use sadiqoon/fiqh-embed-ar-fa-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sadiqoon/fiqh-embed-ar-fa-gguf:F16
Run and chat with the model
lemonade run user.fiqh-embed-ar-fa-gguf-F16
List all available models
lemonade list
- Atomic Chat
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
- -
8-bit
16-bit