Instructions to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="NightPrince/Qwen3-4B-Islamic-Arabic-GGUF", filename="qwen3-4b-islamic-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
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 NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
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 NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
Use Docker
docker model run hf.co/NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NightPrince/Qwen3-4B-Islamic-Arabic-GGUF" # 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/Qwen3-4B-Islamic-Arabic-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
- Ollama
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with Ollama:
ollama run hf.co/NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
- Unsloth Studio
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for NightPrince/Qwen3-4B-Islamic-Arabic-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for NightPrince/Qwen3-4B-Islamic-Arabic-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for NightPrince/Qwen3-4B-Islamic-Arabic-GGUF to start chatting
- Pi
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with Docker Model Runner:
docker model run hf.co/NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
- Lemonade
How to use NightPrince/Qwen3-4B-Islamic-Arabic-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NightPrince/Qwen3-4B-Islamic-Arabic-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4B-Islamic-Arabic-GGUF-Q4_K_M
List all available models
lemonade list
Qwen3-4B-Islamic-Arabic-GGUF
GGUF quantized versions of Qwen3-4B-Islamic-Arabic for llama.cpp, Ollama, and LM Studio.
This repository contains three GGUF files at different quantization levels, converted from NightPrince/Qwen3-4B-Islamic-Arabic (the merged FP16 model). All standard GGUF-compatible runtimes are supported: llama.cpp, Ollama, LM Studio, Jan, and others.
Trained and converted by Yahya Alnwsany (NightPrince) — 2026-05-05.
Files
| File | Size | Recommended for |
|---|---|---|
qwen3-4b-islamic-q4_k_m.gguf |
2.3 GB | Most users — best quality/size balance |
qwen3-4b-islamic-q8_0.gguf |
4.0 GB | High quality, more RAM available |
qwen3-4b-islamic-f16.gguf |
7.5 GB | Reference / re-quantization source |
Recommendation: Start with q4_k_m. If you have 6+ GB of RAM headroom and want noticeably sharper Arabic output, use q8_0. The f16 file is the lossless reference and is best used as a source for producing custom quantizations with llama.cpp's llama-quantize.
Model Variants
| Variant | Repo | Description |
|---|---|---|
| Merged FP16 | NightPrince/Qwen3-4B-Islamic-Arabic | Canonical merged model, FP16, ~7.6 GB — drop-in for transformers or vLLM |
| LoRA Adapter | NightPrince/Qwen3-4B-Islamic-Arabic-LoRA | PEFT adapter only, 264 MB — apply on top of Qwen/Qwen3-4B |
| INT4 Quantized | NightPrince/Qwen3-4B-Islamic-Arabic-INT4 | W4A16 compressed-tensors for fast vLLM serving, 2.5 GB |
| MLX 4-bit | NightPrince/Qwen3-4B-Islamic-Arabic-mlx-4Bit | Apple Silicon / MLX — native Mac inference, 4-bit quantized |
| GGUF (this model) | NightPrince/Qwen3-4B-Islamic-Arabic-GGUF | llama.cpp / Ollama / LM Studio — Q4_K_M (2.3 GB), Q8_0 (4.0 GB), F16 (7.5 GB) |
| Dataset | NightPrince/islamic-arabic-qa | 17,944 train / 2,101 val / 1,042 test — Islamic Arabic Q&A pairs |
Usage
Ollama
Step 1: Create a Modelfile
Save the following as Modelfile (no extension) in any directory:
FROM ./qwen3-4b-islamic-q4_k_m.gguf
SYSTEM """أنت مساعد عالم إسلامي متخصص. أجب على الأسئلة بدقة استناداً إلى القرآن الكريم والسنة النبوية والفقه الإسلامي الكلاسيكي. استشهد بالمصادر حيثما أمكن. كن موجزاً لكن شاملاً."""
PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER num_ctx 4096
Important: The
SYSTEMfield above contains the exact system prompt the model was fine-tuned with. Using it will produce the best results.
Step 2: Download the GGUF file
# Using huggingface-cli
pip install huggingface_hub
huggingface-cli download NightPrince/Qwen3-4B-Islamic-Arabic-GGUF \
qwen3-4b-islamic-q4_k_m.gguf \
--local-dir .
Step 3: Build and run
# Create the Ollama model
ollama create qwen3-islamic -f Modelfile
# Run interactively
ollama run qwen3-islamic
# Or query via API
curl http://localhost:11434/api/generate -d '{
"model": "qwen3-islamic",
"prompt": "ما حكم الاحتفال بالمولد النبوي الشريف؟",
"stream": false
}'
llama.cpp
Build llama.cpp (if not already installed):
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make -j$(nproc) # CPU
# For CUDA: make GGML_CUDA=1 -j$(nproc)
Download a GGUF file:
huggingface-cli download NightPrince/Qwen3-4B-Islamic-Arabic-GGUF \
qwen3-4b-islamic-q4_k_m.gguf \
--local-dir ./models
Run the llama.cpp HTTP server:
./llama-server \
--model ./models/qwen3-4b-islamic-q4_k_m.gguf \
--ctx-size 4096 \
--n-gpu-layers 99 \
--host 0.0.0.0 \
--port 8080 \
--system-prompt "أنت مساعد عالم إسلامي متخصص. أجب على الأسئلة بدقة استناداً إلى القرآن الكريم والسنة النبوية والفقه الإسلامي الكلاسيكي. استشهد بالمصادر حيثما أمكن. كن موجزاً لكن شاملاً."
CLI inference:
./llama-cli \
--model ./models/qwen3-4b-islamic-q4_k_m.gguf \
--ctx-size 4096 \
--n-gpu-layers 99 \
--chat-template qwen3 \
--system-prompt "أنت مساعد عالم إسلامي متخصص. أجب على الأسئلة بدقة استناداً إلى القرآن الكريم والسنة النبوية والفقه الإسلامي الكلاسيكي. استشهد بالمصادر حيثما أمكن. كن موجزاً لكن شاملاً." \
--prompt "ما هي أركان الإسلام الخمسة؟" \
--n-predict 512
LM Studio
- Open LM Studio and go to the Search tab.
- Search for
NightPrince/Qwen3-4B-Islamic-Arabic-GGUF. - Download
qwen3-4b-islamic-q4_k_m.gguf(recommended) from the file list. - Load the model and open the Chat tab.
- In System Prompt, paste:
أنت مساعد عالم إسلامي متخصص. أجب على الأسئلة بدقة استناداً إلى القرآن الكريم والسنة النبوية والفقه الإسلامي الكلاسيكي. استشهد بالمصادر حيثما أمكن. كن موجزاً لكن شاملاً. - Set Temperature to
0.7and Context Length to4096for best results.
Hardware Requirements
| File | Min RAM (CPU) | Min VRAM (GPU offload) |
|---|---|---|
q4_k_m (2.3 GB) |
4 GB | 3–4 GB |
q8_0 (4.0 GB) |
6 GB | 5–6 GB |
f16 (7.5 GB) |
10 GB | 8–10 GB |
Use --n-gpu-layers 99 in llama.cpp to offload all layers to GPU. Reduce the value if you run out of VRAM.
Citation
@misc{alnwsany2026qwen3islamicarbic,
author = {Yahya Alnwsany},
title = {Qwen3-4B-Islamic-Arabic: QLoRA Fine-Tuning of Qwen3-4B on Islamic Arabic Q\&A},
year = {2026},
howpublished = {\url{https://huggingface.co/NightPrince/Qwen3-4B-Islamic-Arabic}},
note = {Base model: Qwen/Qwen3-4B. Dataset: NightPrince/islamic-arabic-qa.}
}
License
Apache 2.0 — consistent with the base model Qwen/Qwen3-4B.
- Downloads last month
- 616
4-bit
8-bit
16-bit