Qwen3-4B-Islamic-Arabic — MLX 4-bit (Apple Silicon)

MLX 4-bit quantized version of NightPrince/Qwen3-4B-Islamic-Arabic for native inference on Apple Silicon Macs.

Converted from the merged FP16 model using mlx-community/mlx-my-repo.

Trained by Yahya Alnwsany (NightPrince) on 17,944 Islamic Arabic Q&A pairs covering Fiqh, Fatwa, Aqeedah, Quran Sciences, and Islamic Finance.


Model Variants

Variant Repo Description
Merged FP16 NightPrince/Qwen3-4B-Islamic-Arabic Canonical merged model — transformers / vLLM
LoRA Adapter NightPrince/Qwen3-4B-Islamic-Arabic-LoRA PEFT adapter, 264 MB
INT4 compressed-tensors NightPrince/Qwen3-4B-Islamic-Arabic-INT4 W4A16 for vLLM serving, 2.5 GB
GGUF NightPrince/Qwen3-4B-Islamic-Arabic-GGUF Q4_K_M / Q8_0 / F16 — Ollama / llama.cpp / LM Studio
MLX 4-bit (this model) NightPrince/Qwen3-4B-Islamic-Arabic-mlx-4Bit Apple Silicon native inference
Dataset NightPrince/islamic-arabic-qa 21,087 Islamic Arabic Q&A pairs

Requirements

  • Mac with Apple Silicon (M1 / M2 / M3 / M4)
  • macOS 13.3+
  • Python 3.9+
pip install mlx-lm

Usage

Generate

from mlx_lm import load, generate

model, tokenizer = load("NightPrince/Qwen3-4B-Islamic-Arabic-mlx-4Bit")

messages = [
    {
        "role": "system",
        "content": (
            "أنت مساعد عالم إسلامي متخصص. أجب على الأسئلة بدقة استناداً إلى "
            "القرآن الكريم والسنة النبوية والفقه الإسلامي الكلاسيكي. "
            "استشهد بالمصادر حيثما أمكن. كن موجزاً لكن شاملاً."
        ),
    },
    {"role": "user", "content": "ما حكم زكاة الفطر وما مقدارها؟"},
]

prompt = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=512, verbose=True)

CLI

mlx_lm.generate     --model NightPrince/Qwen3-4B-Islamic-Arabic-mlx-4Bit     --prompt "ما حكم زكاة الفطر؟"     --max-tokens 512

Hardware Requirements

RAM Notes
8 GB Minimum — works but tight
16 GB Recommended
32 GB+ Comfortable with long contexts

Model Details

  • Base model: Qwen/Qwen3-4B
  • Fine-tuned on: NightPrince/islamic-arabic-qa — 17,944 samples
  • Fine-tuning method: QLoRA (r=64, α=128) on 4× RTX 2080 Ti
  • Training loss: 1.8918 → best eval loss 2.4094
  • Quantization: MLX 4-bit (converted from FP16)
  • Language: Arabic (ar)
  • Domain: Islamic scholarship — Fiqh, Fatwa, Aqeedah, Quran Sciences, Islamic Finance

Limitations

  • Answers reflect classical Islamic scholarship and may not represent all scholarly opinions.
  • Not a substitute for a qualified Islamic scholar (مفتٍ).
  • Performance on dialectal Arabic may be lower than MSA.
  • Coverage is predominantly Sunni scholarship.

Citation

@misc{qwen3-4b-islamic-arabic,
  author    = {Yahya Alnwsany},
  title     = {Qwen3-4B Islamic Arabic},
  year      = {2026},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/NightPrince/Qwen3-4B-Islamic-Arabic},
}

License

Apache 2.0 — inherited from the base model and primary training dataset.

Downloads last month
25
Safetensors
Model size
0.6B params
Tensor type
F16
·
U32
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

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

Model tree for NightPrince/Qwen3-4B-Islamic-Arabic-mlx-4Bit

Finetuned
Qwen/Qwen3-4B
Quantized
(4)
this model

Dataset used to train NightPrince/Qwen3-4B-Islamic-Arabic-mlx-4Bit