Instructions to use ibnsina-llm/ibnsina-30b-chat 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 ibnsina-llm/ibnsina-30b-chat 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 ibnsina-llm/ibnsina-30b-chat:Q4_K_M # Run inference directly in the terminal: llama cli -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M # Run inference directly in the terminal: llama cli -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Use Docker
docker model run hf.co/ibnsina-llm/ibnsina-30b-chat:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use ibnsina-llm/ibnsina-30b-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ibnsina-llm/ibnsina-30b-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ibnsina-llm/ibnsina-30b-chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ibnsina-llm/ibnsina-30b-chat:Q4_K_M
- Ollama
How to use ibnsina-llm/ibnsina-30b-chat with Ollama:
ollama run hf.co/ibnsina-llm/ibnsina-30b-chat:Q4_K_M
- Unsloth Desktop
- Pi
How to use ibnsina-llm/ibnsina-30b-chat with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ibnsina-llm/ibnsina-30b-chat:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ibnsina-llm/ibnsina-30b-chat with Docker Model Runner:
docker model run hf.co/ibnsina-llm/ibnsina-30b-chat:Q4_K_M
- Lemonade
How to use ibnsina-llm/ibnsina-30b-chat with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Run and chat with the model
lemonade run user.ibnsina-30b-chat-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ibnsina-llm/ibnsina-30b-chat with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ibnsina-llm/ibnsina-30b-chat: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:9931/v1 hermes config set model.default ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ibnsina-llm/ibnsina-30b-chat with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ibnsina-llm/ibnsina-30b-chat:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "ibnsina-llm/ibnsina-30b-chat:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
ibnsina-30b-chat — the IbnSina Persian assistant at 30B
IbnSina-30B-Chat is IbnSina-30B (Qwen3-30B-A3B-Base continued-pretrained on 6.0 B Persian tokens) fine-tuned for conversation on the IbnSina SFT mix. It is the conversational member of the 30B branch of the IbnSina family: 30.5 B total parameters, ≈ 3.3 B active per token (Qwen3-MoE), Persian-first, Apache-2.0. Author: Sina Meraji · ORCID 0009-0002-8028-1932 · github.com/ibnsina-llm.
Run it:
ollama run ibnsina/ibnsina-30b-chat # ollama.com registry (Q4_K_M, 18.6 GB)
ollama run hf.co/ibnsina-llm/ibnsina-30b-chat # the same files straight from this repo
Files
| file | use |
|---|---|
ibnsina-30b-chat-Q4_K_M.gguf |
single GPU / big laptop |
ibnsina-30b-chat-Q8_0.gguf |
near-lossless |
model-*.safetensors (bf16, 61.1 GB) |
full precision — HF Transformers (enable_thinking=False), further fine-tuning, or convert to GGUF yourself |
Modelfile, system, template, params |
ollama: ChatML template in Qwen3 non-thinking form, the IbnSina identity/scope system prompt, stop tokens, temperature 0.6 |
eval/ |
the evaluation jsons and the blind-judge summaries behind the table below |
Model
| starting point | ibnsina-llm/ibnsina-30b — recipe R1. A second recipe, R2 (the same SFT applied to Qwen3-30B-A3B-Instruct-2507 instead of our base), was trained and evaluated alongside and is reported below but not released |
| SFT data | 13,166 rows of the IbnSina SFT v2.1 mix (general instruction, Persian writing, reasoning with chain-of-thought in Persian, formatting control, NLI/paraphrase/format rows, translation fa↔en, Iran knowledge, everyday advice, ta'arof register, identity), label-masked (loss on assistant turns only), 2 epochs |
| recipe | 206 steps × 128 rows × 4,096 tokens (≈ 108 M tokens), LR 1e-5 cosine to 10 %, 10 warmup steps, AdamW wd 0.1, bf16 FSDP2 on 8×A100-80GB, same guard suite as the CPT run |
| chat format | ChatML with the Qwen3 non-thinking prefix (`< |
| context | trained at 4,096; the base supports 32,768 |
Evaluation
Both recipes were trained and evaluated; the released one is R1 (SFT on IbnSina-30B): it wins the blind judgement more clearly and leads on three of the four knowledge rows. Control = Qwen3-30B-A3B-Instruct-2507, Alibaba's own chat tuning of the same base, scored with the same harness in the same chat format.
| task (chat format, log-likelihood) | R1: SFT on IbnSina-30B | R2: SFT on Qwen-Instruct-2507 | Qwen3-30B-A3B-Instruct-2507 (control) | random |
|---|---|---|---|---|
| ParsiNLU-MC | 58.7 % | 51.6 % | 53.5 % | 25 % |
| PersianMedQA (5,235) | 62.0 % | 56.8 % | 59.4 % | 25 % |
| ParsiNLU-Entailment | 76.4 % | 78.0 % | 61.6 % | 33 % |
| ParsiNLU-QQP | 78.1 % | 79.9 % | 79.0 % | 50 % |
Blind pairwise judge (300 held-out Persian prompts from the SFT eval split, randomised A/B, Gemini 2.5 Pro on Vertex at temperature 0):
| pair | win | tie | loss | win rate excl. ties | judged more natural Persian |
|---|---|---|---|---|---|
| R1 vs control | 174 | 15 | 111 | 61.1 % | 96.3 % vs 85.3 % |
| R2 vs control | 146 | 22 | 132 | 52.5 % | 93.7 % vs 89.0 % |
By category (R1 vs control, wins / ties / losses): general instruction 129 / 10 / 80, Persian-native questions 25 / 1 / 18, formatting control 20 / 4 / 13. The judge saw the two replies in random order and did not know which model wrote which.
Reading: the SFT put a chat layer on the Persian base without losing what continued pretraining had added — R1 keeps the knowledge lead over Qwen's own Instruct model (+5.2 on ParsiNLU multiple choice, +2.6 on PersianMedQA, ahead in 17 of 22 medical specialties and in all three MC sub-categories, literature most of all: 52.9 vs 46.6 %) and turns the base's weakest row, entailment, into its strongest gain (+14.8 over the control). R2, the same SFT on the Instruct model, gets the NLI/paraphrase rows slightly higher still but gives up 2–3 points of knowledge relative to the untouched Instruct model, and wins the blind comparison only narrowly. On the 300 held-out prompts the judge preferred R1 over Qwen3-30B-A3B-Instruct-2507 61 % of the time (ties excluded) and rated its Persian natural in 96 % of replies versus 85 % for the control. Caveats: one judge model, one seed, 300 prompts drawn from the same distribution the SFT mix was built from (held out, but same taxonomy); the control answered without a system prompt, as did ours. English ability was not measured.
Identity: with the shipped system prompt it introduces itself as IbnSina built on Qwen3-30B-A3B (verified on the Q4_K_M GGUF); with no system prompt it says «من ابنسینا هستم … از صفر با متن فارسی آموزش دیدهام» — the from-scratch wording inherited from the SFT rows (see limitations); given a client system prompt with another persona («باب») it follows it; asked for a number-only answer it answers with the number.
Intended use and limitations
A Persian conversational assistant: answering, writing, summarising, translating. The system prompt shipped in the Modelfile gives it its identity and scope (an open-source model from the IbnSina project, built on Qwen3-30B-A3B, not a person, not online, not a reliable source on people, politics or news, general information only on medical, legal and financial matters with a referral to a professional). Without a system prompt the identity comes from the SFT rows, which were written for the from-scratch 3B, so it may describe itself as "trained from scratch" or "small" — that text is inherited, not true of this model. No safety tuning of its own beyond what the SFT mix and the base carry; it will follow instructions and can be wrong. Verify everything that matters.
Licence
Apache-2.0. Training-data licences are per source (see the repo's licence table); SFT rows are synthetic (Gemini-generated and judged) or from openly licensed sources; ParsiNLU is used for evaluation only.
Citation
@software{ibnsina2026, title={IbnSina: an open Persian-first language model family}, author={Meraji, Sina}, year={2026}, url={https://github.com/ibnsina-llm}, note={ORCID 0009-0002-8028-1932}}
Acknowledgments: Qwen for the base and instruct models, llama.cpp for distribution. The pipeline, training runs and evaluations were executed by AI coding agents (Claude Code) under Sina Meraji's direction.
- Downloads last month
- 724
Model tree for ibnsina-llm/ibnsina-30b-chat
Evaluation results
- accuracy on ParsiNLU-MCself-reported58.700
- accuracy on PersianMedQAself-reported62.000
- accuracy on ParsiNLU-Entailmentself-reported76.400
- accuracy on ParsiNLU-QQPself-reported78.100
- win rate excluding ties on IbnSina SFT held-out promptsself-reported61.100