Instructions to use NightPrince/Muslim-6B-PRO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NightPrince/Muslim-6B-PRO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NightPrince/Muslim-6B-PRO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NightPrince/Muslim-6B-PRO") model = AutoModelForCausalLM.from_pretrained("NightPrince/Muslim-6B-PRO", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - PEFT
How to use NightPrince/Muslim-6B-PRO with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NightPrince/Muslim-6B-PRO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NightPrince/Muslim-6B-PRO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NightPrince/Muslim-6B-PRO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NightPrince/Muslim-6B-PRO
- SGLang
How to use NightPrince/Muslim-6B-PRO with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "NightPrince/Muslim-6B-PRO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NightPrince/Muslim-6B-PRO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "NightPrince/Muslim-6B-PRO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NightPrince/Muslim-6B-PRO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NightPrince/Muslim-6B-PRO with Docker Model Runner:
docker model run hf.co/NightPrince/Muslim-6B-PRO
Muslim-6B-PRO
Muslim-6B-PRO is a behavior-tuned Islamic voice-assistant model, fine-tuned from Karnak-6B-v1.0 (a depth-extended Qwen3-4B-Instruct-2507) to serve as the reasoning core of Muslim, a voice-first Islamic assistant. It is trained for tool-call routing, persona/scope discipline, and calibrated general Islamic knowledge โ not for reciting scripture from memory.
Model Details
| Base model | Karnak-6B-v1.0 (Qwen3 architecture) |
| Parameters | 5.94B |
| Layers | 54 |
| Hidden size | 2,560 |
| Attention heads | 32 (8 KV heads, GQA) |
| Vocabulary | 192,728 |
| Context length | 262,144 tokens |
| Fine-tuning method | QLoRA (4-bit NF4 base, fp16 compute) |
| License | Apache 2.0 |
| Languages | Arabic, English |
Key Capabilities
- Reliable tool-call routing across the full Qur'an/hadith/tafsir/fatwa retrieval toolset (31 tools, including mcp.tafsir.net's 17 tools, IslamQA's 5 tools, and local Qur'an audio playback), with schemas verified against the live tool servers rather than assumed.
- Clean, standards-correct tool-call JSON โ
tool_call.argumentsdecodes with a singlejson.loads(), matching the Hermes-style format used by the base Qwen3 model. - Full 114-surah coverage, including alternate/colloquial surah names and named-ayah nicknames (e.g. ุขูุฉ ุงููุฑุณู, ุณูุฑุฉ ุจุฑุงุกุฉ, ุณูุฑุฉ ุชุจุงุฑู), each verified against real scholarly source text to avoid ambiguous nameโnumber mappings.
- Calibrated general Islamic knowledge โ Seerah, stories of the prophets, aqeedah basics, broad fiqh concepts, akhlaq, foundational history, and comparative/interfaith framing, with appropriate hedging on genuinely contested specifics rather than flat assertions.
- Persona and scope discipline, including resistance to adversarial attempts to override its identity or push it outside its intended scope.
Intended Use
Muslim-6B-PRO is trained on behavior, not memorized facts, for anything requiring exact, source-cited text โ Qur'an wording, hadith matn/isnad, tafsir attribution. Those are retrieved at inference time via tool calls, never generated from memory, because language models reliably hallucinate scripture when asked to recite it directly. The one exception is well-established, broadly-agreed general Islamic knowledge with no dedicated retrieval tool (Seerah, stories of the prophets, aqeedah basics, broad fiqh concepts, akhlaq, foundational history, comparative/interfaith framing) โ there, the model is trained for calibrated tone and appropriate hedging on contested specifics, not fact injection.
This model is designed to be served with a tool-calling layer (Qur'an/hadith/tafsir retrieval, audio playback) and a system prompt defining its persona and scope. It is not intended as a general-purpose scripture-reciting or fatwa-issuing model on its own.
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "NightPrince/Muslim-6B-PRO"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [
{"role": "system", "content": "<your Muslim agent system prompt>"},
{"role": "user", "content": "ู
ุง ูู ุขูุฉ ุงููุฑุณูุ"},
]
inputs = tokenizer.apply_chat_template(
messages, tools=your_tool_schemas, add_generation_prompt=True,
return_tensors="pt", return_dict=True,
).to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Tool-calling format
Uses the same Hermes-style <tool_call> format as the base Qwen3 model. Bind your tool
schemas via the standard tools= argument to apply_chat_template. tool_call.arguments
decodes cleanly with a single json.loads() call.
Try it live
huggingface.co/spaces/NightPrince/muslim-6b-pro-demo โ a free ZeroGPU chat demo with real tool-calling: it actually calls mcp.tafsir.net, islamqa-mcp.org, and real Qur'an audio CDNs live, instead of a scripted response. Also exposes an MCP server endpoint.
GGUF quantizations
Quantized GGUF builds (Q2_K through Q8_0, plus F16) for llama.cpp-based local inference are
published separately at NightPrince/Muslim-6B-PRO-GGUF.
Training Data
2,731 examples (59% tool-calling traces), from three ground-truth-checked sources: hand-curated examples, real production voice-session turns, and real tool-augmented conversations โ each example checked against source-of-truth references, with anything that couldn't be verified mechanically excluded rather than guessed at.
| Behavior | Count | Description |
|---|---|---|
| B1 | 1,943 | Tool routing |
| B2 | 42 | Scripture-audio guardrail |
| B3 | 271 | Persona/identity, incl. adversarial-override resistance |
| B4 | 63 | Scope discipline |
| B5 | 167 | Measured fiqh rulings |
| B6 | 22 | English / mixed-language |
| B7 | 66 | Seerah |
| B8 | 78 | Stories of the prophets |
| B9 | 21 | Aqeedah |
| B10 | 26 | Broad fiqh concepts |
| B11 | 14 | Akhlaq |
| B12 | 11 | Islamic history |
| B13 | 7 | Comparative / interfaith |
Training Procedure
- Method: QLoRA (4-bit NF4 base, fp16 compute โ trained on hardware with no native bf16
support) via TRL
SFTTrainer. - LoRA config: r=16, alpha=32, dropout=0.05, targeting
q/k/v/o/gate/up/down_proj. - Schedule: 3 epochs, cosine LR decay from 2e-4, 3% warmup, effective batch size 16.
- Best checkpoint selection:
load_best_model_at_endon held-out eval loss across the full 3-epoch run โ the published weights are the best-performing checkpoint, not simply the last.
Limitations
- Not intended for direct scripture recitation or fatwa-issuing without the retrieval tool layer it was trained to route through.
- Behavioral eval-gate results (57 adversarial/generalization probes) are pending publication โ loss curves alone do not fully capture tool-routing correctness or persona robustness; treat this card as provisional on that front until updated.
- Trained and evaluated primarily on Arabic Islamic-assistant use cases; general-purpose capability outside that domain is inherited from the base model and not separately verified.
Citation
If you use this model, please cite it as:
@misc{muslim6bpro2026,
title = {Muslim-6B-PRO: A Behavior-Tuned Islamic Voice-Assistant Language Model},
author = {Alnwsany, Yahya},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/NightPrince/Muslim-6B-PRO}},
note = {Fine-tuned from Karnak-6B-v1.0}
}
Related resources:
- Base model: Applied-Innovation-Center/Karnak-6B-v1.0
- Training dataset: NightPrince/muslim-6b-v1-dataset
- GGUF quantizations: NightPrince/Muslim-6B-PRO-GGUF
- Live demo: NightPrince/muslim-6b-pro-demo
- Fine-tuning code: github.com/NightPrinceY/Karnak-6B-Finetuning
Copyright & License
Copyright ยฉ 2026 Yahya Alnwsany (NightPrince). This model's fine-tuning work โ the LoRA adapter, training data curation, and this model card โ is released under the Apache License 2.0; see LICENSE for the full text. Use of the base model Karnak-6B-v1.0 remains subject to its own license terms from Applied Innovation Center.
- Downloads last month
- 69
Model tree for NightPrince/Muslim-6B-PRO
Base model
Qwen/Qwen3-4B-Instruct-2507