Instructions to use Dibachain/Diba-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dibachain/Diba-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dibachain/Diba-mini", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Dibachain/Diba-mini", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dibachain/Diba-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dibachain/Diba-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dibachain/Diba-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Dibachain/Diba-mini
- SGLang
How to use Dibachain/Diba-mini 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 "Dibachain/Diba-mini" \ --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": "Dibachain/Diba-mini", "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 "Dibachain/Diba-mini" \ --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": "Dibachain/Diba-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Dibachain/Diba-mini with Docker Model Runner:
docker model run hf.co/Dibachain/Diba-mini
Diba-mini · دیبا مینی
The lightweight Iranian LLM — a ~2B Persian-first model that runs anywhere مدل زبانی ایرانیِ سبک — حدود ۲ میلیارد پارامتر، فارسیمحور، قابل اجرا همهجا
🌐 dibachain.ir · 🤖 Agent · Chat · Diba-Base · Diba-Embed · Diba-Vision · Diba-STT
English
Diba-mini is the small member of the Diba family from Dibachain — an Iranian LLM of about 2 billion parameters built for one thing: excellent Persian (Farsi) and knowledge of Iran, including its contemporary history, in a model light enough to run on a laptop CPU, a small server, or a phone. It replies in the language you write in, uses correct written-register Persian, and keeps the Dibachain assistant identity.
Where Diba-Base (4B) also targets coding and tool calling, Diba-mini trades those for size and speed: it is the right choice when you need a fast, offline, Persian-first assistant and do not need a code model.
How it compares
Measured against same-size open models (≈1–3B) on identical prompts (greedy decoding): 40 Iran-history questions in Persian, and whether the model replies in the user's language (Persian and English).
| Model | Iran history (fa) | Replies in Persian | Replies in English |
|---|---|---|---|
| Diba-mini (~2B) | 20/40 | 10/10 | 10/10 |
| Granite 4.0 Micro 3B | 10/40 | 10/10 | 10/10 |
| Gemma 4 E2B | 9/40 | 10/10 | 10/10 |
| SmolLM3 3B | 4/40 | 9/10 | 10/10 |
| SmolLM2 1.7B | 2/40 | 10/10 | 10/10 |
Diba-mini answers twice as many Iran-history questions as the best same-size peer. It is not a code model: on the same run's coding tests it scores 6/20 (Python) and 6/20 (JavaScript), below the 3B peers — use Diba-Base for code.
What it can do
- Persian, done right — fluent written-register Persian with correct spelling and ZWNJ; replies in the language of your message.
- Knows Iran — geography, culture and contemporary history.
- Runs anywhere — a ~1.3 GB GGUF on a CPU; no cloud, no GPU.
- Fast — about half the size of Diba-Base, so roughly twice the speed on the same hardware.
Quick start
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("Dibachain/Diba-mini", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("Dibachain/Diba-mini", dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
messages = [
{"role": "system", "content": "تو «دیبا» هستی، دستیار هوش مصنوعی دیباچین. به همان زبانی پاسخ بده که کاربر نوشته است."},
{"role": "user", "content": "انقلاب مشروطه در ایران چه زمانی رخ داد و چه اهمیتی داشت؟"},
]
enc = tok.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**enc, max_new_tokens=400, do_sample=False)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))
Diba-mini ships with the Diba model definition, so pass
trust_remote_code=Truewhen loading with Transformers. For llama.cpp, Ollama and LM Studio just use the quantized file below — no extra flag needed.
llama.cpp (CPU)
hf download Dibachain/Diba-mini-GGUF diba-mini-q4_k_m.bin --local-dir .
llama-server -m diba-mini-q4_k_m.bin -c 8192 --jinja
Ollama
hf download Dibachain/Diba-mini-GGUF diba-mini-q4_k_m.bin Modelfile --local-dir .
ollama create diba -f Modelfile && ollama run diba
LM Studio — download diba-mini-q4_k_m.bin, rename it to end with .gguf, and import it (lms import <file>).
Recommended settings
- System prompt:
تو «دیبا» هستی، دستیار هوش مصنوعی دیباچین. به همان زبانی پاسخ بده که کاربر نوشته است؛ به فارسی نوشتاری، روشن و مؤدبانه. - Thinking: off (
enable_thinking=false) for direct answers. - Temperature:
0for precise answers;0.3for casual chat.
Notes
Diba-mini is a compact ~2B model built for on-device Persian use. It is not a coding model — for code and tool calling use Diba-Base. As with any model this size, verify important facts before relying on them. It reflects the perspectives present in its training data.
فارسی
دیبا مینی (Diba-mini) عضو کوچکِ خانوادهی دیبا از دیباچین است — یک مدل زبانی ایرانی با حدود ۲ میلیارد پارامتر که برای یک هدف ساخته شده: فارسیِ عالی و شناخت ایران (از جمله تاریخ معاصر)، در مدلی آنقدر سبک که روی CPU لپتاپ، یک سرور کوچک یا حتی موبایل اجرا شود. به همان زبانی که مینویسید پاسخ میدهد، فارسیِ نوشتاریِ درست دارد و هویت دستیار دیباچین را حفظ میکند.
جایی که Diba-Base (۴B) کدنویسی و فراخوانی ابزار را هم هدف میگیرد، دیبا مینی آنها را با اندازه و سرعت معاوضه میکند: انتخاب درست وقتی یک دستیار سریع، آفلاین و فارسیمحور میخواهید و به مدل کد نیاز ندارید.
مقایسه
روی مدلهای متنباز هماندازه (حدود ۱ تا ۳ میلیارد) با پرسشهای یکسان سنجیده شد: ۴۰ پرسش تاریخ ایران به فارسی، و اینکه آیا مدل به زبان کاربر پاسخ میدهد.
| مدل | تاریخ ایران | پاسخ به فارسی | پاسخ به انگلیسی |
|---|---|---|---|
| دیبا مینی (~۲ میلیارد) | ۲۰/۴۰ | ۱۰/۱۰ | ۱۰/۱۰ |
| Granite 4.0 Micro 3B | ۱۰/۴۰ | ۱۰/۱۰ | ۱۰/۱۰ |
| Gemma 4 E2B | ۹/۴۰ | ۱۰/۱۰ | ۱۰/۱۰ |
| SmolLM3 3B | ۴/۴۰ | ۹/۱۰ | ۱۰/۱۰ |
| SmolLM2 1.7B | ۲/۴۰ | ۱۰/۱۰ | ۱۰/۱۰ |
دیبا مینی دو برابرِ بهترین مدل هماندازه به پرسشهای تاریخ ایران پاسخ درست میدهد. این مدل برای کدنویسی ساخته نشده است: در همین اجرا در آزمونهای کد ۶ از ۲۰ (پایتون) و ۶ از ۲۰ (جاوااسکریپت) گرفت که پایینتر از مدلهای ۳ میلیاردی است؛ برای کد از Diba-Base استفاده کنید.
چه کارهایی انجام میدهد
- فارسیِ درست: فارسی نوشتاری روان با رسمالخط و نیمفاصلهی درست؛ پاسخ به همان زبان پیام شما.
- شناخت ایران: جغرافیا، فرهنگ و تاریخ معاصر.
- اجرا همهجا: یک فایل GGUF حدود ۱٫۳ گیگابایتی روی CPU؛ بدون ابر و بدون GPU.
- سریع: تقریباً نصف Diba-Base، پس روی همان سختافزار حدوداً دو برابر سریعتر.
شروع سریع
از همان نمونههای بخش انگلیسی استفاده کنید (Transformers، llama.cpp، Ollama). هنگام بارگذاری با Transformers trust_remote_code=True را بدهید و حالت فکر را خاموش نگه دارید (enable_thinking=false).
تنظیمات پیشنهادی
- پرامپت سیستمی:
تو «دیبا» هستی، دستیار هوش مصنوعی دیباچین. به همان زبانی پاسخ بده که کاربر نوشته است؛ به فارسی نوشتاری، روشن و مؤدبانه. - دما:
۰برای پاسخ دقیق،۰٫۳برای گفتگوی راحت.
نکته
دیبا مینی یک مدل جمعوجور ~۲ میلیاردی برای اجرای فارسی روی دستگاه است. مدل کد نیست؛ برای کد و فراخوانی ابزار از Diba-Base استفاده کنید. مانند هر مدل هماندازه، اطلاعات مهم را پیش از اتکا بررسی کنید.
- Downloads last month
- 264
