Instructions to use ibnsina-llm/ibnsina-30b 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 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:Q4_K_M # Run inference directly in the terminal: llama cli -hf ibnsina-llm/ibnsina-30b: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:Q4_K_M # Run inference directly in the terminal: llama cli -hf ibnsina-llm/ibnsina-30b: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 ibnsina-llm/ibnsina-30b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ibnsina-llm/ibnsina-30b: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 ibnsina-llm/ibnsina-30b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ibnsina-llm/ibnsina-30b:Q4_K_M
Use Docker
docker model run hf.co/ibnsina-llm/ibnsina-30b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ibnsina-llm/ibnsina-30b 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ibnsina-llm/ibnsina-30b:Q4_K_M
- Ollama
How to use ibnsina-llm/ibnsina-30b with Ollama:
ollama run hf.co/ibnsina-llm/ibnsina-30b:Q4_K_M
- Unsloth Desktop
- Pi
How to use ibnsina-llm/ibnsina-30b 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: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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ibnsina-llm/ibnsina-30b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ibnsina-llm/ibnsina-30b with Docker Model Runner:
docker model run hf.co/ibnsina-llm/ibnsina-30b:Q4_K_M
- Lemonade
How to use ibnsina-llm/ibnsina-30b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ibnsina-llm/ibnsina-30b:Q4_K_M
Run and chat with the model
lemonade run user.ibnsina-30b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ibnsina-llm/ibnsina-30b 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: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 ibnsina-llm/ibnsina-30b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ibnsina-llm/ibnsina-30b 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: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:8080/v1 \ --custom-model-id "ibnsina-llm/ibnsina-30b: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 — Persian continued pretraining of Qwen3-30B-A3B-Base
⚠️ این یک مدل پایه است، نه یک دستیار گفتوگو. فقط متن را ادامه میدهد؛ دستور نمیگیرد، نقشبازی نمیکند و برای مکالمه تنظیم نشده است. برای گفتوگو به فارسی از ابنسینا ۳B استفاده کنید. این مدل برای پژوهشگران و توسعهدهندگانی است که میخواهند روی آن fine-tune کنند.
⚠️ This is a BASE model, not a chat assistant. It continues text; it does not follow instructions, hold a conversation, or refuse anything — there is no instruction tuning and no chat template. For Persian conversation use IbnSina-3B. This model is for researchers and developers who want to fine-tune on top of it.
IbnSina-30B is Qwen3-30B-A3B-Base continued-pretrained on 6.0 B tokens of the IbnSina Persian mix. It is the third and largest model of the IbnSina family and the only one that is not trained from scratch: the 1.5B and 3B are Persian-first models built from zero, while this one adapts a strong open Mixture-of-Experts base to Persian. 30.5 B total parameters with 3.3 B active per token, so it runs at roughly 3B-model speed while holding 30B-model knowledge. Author: Sina Meraji · ORCID 0009-0002-8028-1932 · github.com/ibnsina-llm.
Files
| file | use |
|---|---|
ibnsina-30b-Q4_K_M.gguf |
single GPU / big laptop (18.6 GB) |
ibnsina-30b-Q8_0.gguf |
near-lossless (32.5 GB) |
model-*.safetensors (bf16, 61.1 GB) |
full precision — HF Transformers, further fine-tuning, or convert to GGUF yourself (convert_hf_to_gguf.py --outtype bf16) |
ollama run hf.co/ibnsina-llm/ibnsina-30b # completes text, does not chat
llama-cli -m ibnsina-30b-Q4_K_M.gguf -p "ایران کشوری در غرب آسیا است که"
Model
| base | Qwen/Qwen3-30B-A3B-Base (Apache-2.0) |
| architecture | Qwen3-MoE: 48 layers, d=2048, 128 experts with 8 active per token, GQA, QK-norm, SwiGLU, RMSNorm, RoPE |
| parameters | 30.5 B total · ≈ 3.3 B active per token |
| tokenizer | Qwen3 BPE, 151,936 tokens (unchanged from the base — not the IbnSina 32k tokenizer used by the 1.5B/3B) |
| context | trained at 4,096; base supports 32,768 |
| continued pretraining | 6.0 B tokens (11,445 steps × 524,288; one pass over 20 % of the 29.6 B-token pool, seeded global shuffle), bf16, AdamW (peak LR 2e-5, cosine to 10 %), guards + router-health probes, 8×A100-80GB spot (FSDP2), 7.4 days, zero preemptions, 15 skipped batches |
| data | the IbnSina Persian mix (train_v3b_open) re-tokenized with the Qwen3 tokenizer: Persian web (CulturaX, mC4, FineWeb-2, classifier-filtered), English educational text, code, math, Persian literature, Wikipedia, fa–en parallel text, and judged synthetic Persian |
Evaluation
Log-likelihood multiple-choice scoring, the same harness and prompts as the rest of the family, with the untouched base model as the control — the honest question for a continued-pretraining run is what did Persian training change, not how does it rank.
| task | IbnSina-30B | Qwen3-30B-A3B-Base (control) | IbnSina-3B | random |
|---|---|---|---|---|
| ParsiNLU-MC | 53.6 % | 52.6 % | 32.4 % | 25 % |
| PersianMedQA (5,235) | 56.6 % | 51.4 % | 30.5 % | 25 % |
| ParsiNLU-Entailment | 53.5 % | 58.3 % | 39.9 % | 33 % |
| ParsiNLU-QQP | 56.7 % | 50.0 % | 52.2 % | 50 % |
| PersianMedQA, generative protocol (all 5,235 / answered only) | 57.0 % / 61.8 % (411 unparsed) | 56.8 % / 57.3 % (52 unparsed) | 24.8 % | 25 % |
| held-out Persian bits-per-byte (lower is better) | 0.4835 | 0.5646 | — | — |
What 6 B tokens of Persian did: the held-out Persian bits-per-byte fell by 14 % (0.5646 → 0.4835; perplexity per token 3.77 → 3.12), the clearest signal and the one the training optimised. On the knowledge side PersianMedQA rose 5.2 points (51.4 → 56.6 %, gains in most fields) and ParsiNLU multiple choice 1 point; paraphrase detection moved off the base's constant-answer prior (50.0 → 56.7 %). Entailment fell 4.8 points (58.3 → 53.5 %): the base leaned on one label (1,139 of 1,673 answers were "entailment") and was often right; ours spreads its answers across the three labels and gets fewer of them — a calibration change more than a knowledge loss, but a regression on that row and reported as one. Under the generative protocol (answer with the option number, temperature 0) the two are level on all 5,235 questions (57.0 vs 56.8 %) because ours fails the number-only format eight times more often (411 vs 52 unparsed replies); on the questions it does answer it is 4.5 points ahead (61.8 vs 57.3 %). The base model's English and general abilities were not re-measured; a 0.02 % extra pass of mostly Persian data is unlikely to move them much, but that is an expectation, not a measurement.
Intended use and limitations
A base model for research and for building Persian systems: fine-tune it, probe it, or use it for completion. It has no instruction tuning, no chat template, no safety tuning of its own beyond what the base model carries, and no behaviour policy — the scope banner and the symmetric-respect policy of the IbnSina chat models do not apply here, because nothing in this training taught them. It inherits the base model's knowledge cutoff and its biases, plus whatever the Persian mix added. Knowledge questions, medical, legal and financial matters: not a reliable source, and with no refusal behaviour it will answer anything. Verify everything that matters.
Licence
Apache-2.0, the same as the base model. Training-data licences are per source (see the repo's licence table); the mix admits only sources whose licences permit an Apache-2.0 release, and no source text is redistributed.
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 model, llama.cpp for distribution, and the Persian NLP work listed on the IbnSina-3B card. The pipeline, training runs and evaluations were executed by AI coding agents (Claude Code) under Sina Meraji's direction.
- Downloads last month
- 418