Sadiq-Cite 8B

Sadiq-Cite is a retrieval-grounded citation model for Islamic jurisprudence in the Ja'fari (Imami) tradition. Given a question and a set of retrieved passages, it finds the rulings that bear on the question, quotes them verbatim between «…», and lists their book and page. It does not issue verdicts, does not reason its way to a ruling, and does not apply the law to the asker's situation — and when the passages contain nothing relevant, it says so instead of improvising.

It is the answer stage of a pipeline, not a chatbot: run it behind LM Studio's server, inside AnythingLLM, in an n8n flow, or from any OpenAI-compatible client, with your own corpus supplying the passages. Built by Sadiqoon Technologies on Qwen/Qwen3-8B.

نموذج استشهاد مؤسَّس على الاسترجاع في الفقه الإماميّ. يُعطى السؤال والمقاطع المسترجعة، فيلتقط النصوص التي تخصّ المسألة وينقلها حرفيًّا بين «» ويعزوها بالكتاب والصفحة. لا يُفتي ولا يستنبط ولا ينزّل الحكم على حال السائل، وإذا لم يكن في المقاطع ما يخصّ السؤال صرّح بذلك ولم يخترع. يُشغَّل خلف خادم محلّي داخل منظومة استرجاع، لا كواجهة محادثة.

Why a citation model rather than an answering one

A jurisprudential answer has two halves: what the sources say, and what follows for you. The first is verifiable — the quote is either in the passage or it is not. The second is where a language model, however large, quietly invents. Sadiq-Cite is trained to do only the first half, so that everything it produces can be checked by a machine.

That check ships with it: sadiq_fiqh.verify() matches every «quote» in the output against the passages you supplied and returns a per-quote verdict, so your pipeline can drop an unverified quote before a reader ever sees it.

Evaluation

282 held-out questions with their retrieved passages, plus 100 refusal probes — real questions paired with passages deliberately drawn from unrelated chapters. All metrics are computed programmatically; no LLM judge was used.

Answers that quote at least one passage 99.6%
Quotes traceable to the supplied passages 87.5% (84.5% exact after orthographic normalization, 3.0% near-verbatim)
Quotes not found in the passages 10.8%
Answers where every quote verified 79.4%
Answers giving a book-and-page citation 97.2%
Citations matching a supplied passage 82.5%
Correct refusals on the 100 probes 100%
False refusals on genuine questions 0.4% (1 of 282)

Two things are worth reading carefully. Refusal discrimination is exact: on a hundred questions given deliberately irrelevant context it refused every time, and on 282 answerable ones it refused once. Groundedness, on the other hand, is high but not perfect — roughly one quote in nine is reconstructed from what the model learned rather than copied from what it was given. That is the reason the verifier is part of the release rather than an afterthought: run it, and the residual becomes a rejected quote instead of a false citation.

Robustness to prompt format

Different RAG tools inject context differently, so the same 60 questions were re-run in four injection styles:

Injection style Answers with quotes Quote verbatim rate Citation matches a passage
Native (the shape below) 100% 88.8% 67.8%
AnythingLLM-style context block 98.3% 85.5% 79.7%
XML <doc source= page=> tags 100% 87.7% 66.7%
Bare passages, no book or page given 100% 83.0% 0%

Quoting holds up across all four — the model does not need our exact template to find and copy the right text. Citation is a different matter: if you do not pass the book and page with each passage, the model will produce a citation anyway, and it will be fabricated. Always include source metadata in the passage header, or strip the citations from the output.

Training

3,949 question–passage–answer examples in which the answer quotes and cites only, plus 500 refusal examples. LoRA (r=32) on all attention and MLP projections, two epochs, merged into the base weights.

Running it

LM Studio as a server

Load the model, start the local server, then point any OpenAI-compatible client at it:

from sadiq_fiqh import Sadiq, Passage, verify        # pip install sadiq-fiqh
s = Sadiq(base_url="http://localhost:1234/v1", model="sadiq-cite-8b")

passages = [Passage(text="لا يجب الخمس في ما لا يدخل في مسمّى التكسّب…", book="…", page=120)]
answer = s.cite("هل يجب الخمس في الذهب الملبوس؟", passages)
print(verify(answer, passages))   # {'quotes': [...], 'all_verbatim': True}

AnythingLLM

Point the workspace's LLM at your local server (LM Studio or Ollama) and select this model; use Fiqh-Embed as the embedder — AnythingLLM supports LM Studio and Ollama embedders natively, so the whole stack stays local. Paste the system prompt below into the workspace's prompt setting.

Ollama

ollama create sadiq-cite -f Modelfile        # Modelfile ships in this repo
ollama run sadiq-cite

n8n and custom pipelines

Retrieve with Fiqh-Embed, re-rank with Fiqh-Rerank, then call this model. sadiq_fiqh.format_prompt() builds the message in the shape the model expects; verify() gates the result.

System prompt

أنت «صادق»، مساعد بحث في فقه أهل البيت (عليهم السلام). مهمتك أن تعثر في المقاطع المرفقة على النصوص الشرعية التي تخصّ سؤال السائل وتنقلها حرفيًّا بين علامتي «» مرقّمةً، ثم تسرد مصادرها بالكتاب ورقم الصفحة. لا تفتِ ولا تستنبط ولا تطبّق الحكم على حالة السائل. إن لم تجد في المقاطع ما يخصّ السؤال فقل ذلك صراحةً، وإن كان السؤال ناقصًا فاطلب التوضيح.

Expected input shape

السؤال:
<the question>

المقاطع المسترجعة:
[1] (<book>، ص <page>)
<passage text>

[2] (<book>، ص <page>)
<passage text>

Greedy decoding (temperature=0) is recommended.

The rest of the stack

Fiqh-Embed · Fiqh-Rerank · Fiqh-Classifier · Fiqh-Glossary Linker

Citation

@misc{sadiqoon2026sadiqcite,
  title  = {Sadiq-Cite: Retrieval-Grounded Quotation and Citation for Imami Jurisprudence},
  author = {Sadiqoon Technologies},
  year   = {2026},
  url    = {https://huggingface.co/sadiqoon/sadiq-cite-8b}
}

License & Contact

MIT (the base model is Qwen3-8B, Apache 2.0). Built and maintained by Sadiqoon Technologies Ltd, London. Questions and collaboration: info@sadiqoon.uk

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

Model tree for sadiqoon/sadiq-cite-8b

Finetuned
Qwen/Qwen3-8B
Finetuned
(2029)
this model
Quantizations
1 model