Downloads · 30 days
1.1K
100% of all-time downloads
Dibachain/Diba-Base
Diba-Base is a text generation model from Dibachain. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
1.1K
100% of all-time downloads
All-time downloads
1.1K
Public
Parameters
4.2B
11.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.7 GB · 76%
From the Hugging Face model README
An Iranian LLM — a Persian-first chat & code model that runs on a CPU یک مدل زبانی ایرانی — گفتگو و کدنویسی فارسیمحور که روی CPU اجرا میشود
🌐 dibachain.ir · 🤖 Agent · Chat (GPU) · Chat (CPU) · Diba-Embed · Diba-Vision · Diba-STT
</div>Diba-Base is an Iranian large language model (LLM) from Dibachain — a ~4B‑parameter, Persian‑first model built to be excellent at Persian (Farsi), to know Iran (including its contemporary history), and to write code from Persian or English prompts. It runs offline on a CPU via GGUF, replies in the language you write in, and supports tool calling. If you are looking for a Persian LLM, an Iranian AI chatbot, or an on‑device Farsi language model, this is it.
Measured against same‑size open models on identical prompts and tests (greedy decoding): 20 Python and 20 JavaScript tasks with real unit tests, 40 Iran‑history questions, and whether the model replies in the user's language.

| Model | Python | JavaScript | Iran history (fa) | Replies in Persian |
|---|---|---|---|---|
| Diba-Base | 13/20 | 13/20 | 29/40 | 10/10 |
| Gemma 3 4B | 11/20 | 12/20 | 15/40 | 10/10 |
| Granite 4.0 Micro 3B | 14/20 | 11/20 | 11/40 | 10/10 |
| Phi‑4‑mini 3.8B | 11/20 | 10/20 | 5/40 | 10/10 |
| SmolLM3 3B | 11/20 | 10/20 | 4/40 | 9/10 |
For a 4B‑class model, Diba‑Base leads on code, matches the best on replying in the right language, and is far ahead on Persian knowledge of Iran — where general models are weak.
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("Dibachain/Diba-Base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("Dibachain/Diba-Base", dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
messages = [
{"role": "system", "content": "تو «دیبا» هستی، دستیار هوش مصنوعی دیباچین. به همان زبانی پاسخ بده که کاربر نوشته است."},
{"role": "user", "content": "یک تابع پایتون بنویس که تشخیص دهد یک رشته پالیندروم است."},
]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=512, temperature=0)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
Diba-Base 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-Base diba-base-q4_k_m.bin --local-dir .
llama-server -m diba-base-q4_k_m.bin -c 8192 --jinja \n --chat-template-kwargs '{"enable_thinking": false}'
Ollama
hf download Dibachain/Diba-Base diba-base-q4_k_m.bin Modelfile --local-dir .
ollama create diba -f Modelfile && ollama run diba
LM Studio — download diba-base-q4_k_m.bin, rename it to end with .gguf, and import it (lms import <file>).
تو «دیبا» هستی، دستیار هوش مصنوعی دیباچین. به همان زبانی پاسخ بده که کاربر نوشته است؛ به فارسی نوشتاری، روشن و مؤدبانه.enable_thinking=false) for direct answers.0 for code and precise answers; 0.3 for casual chat.Diba‑Base is a compact 4B model built for on‑device Persian use. As with any model this size, verify important facts and generated code before relying on them. It reflects the perspectives present in its training data. For images use Diba-Vision, for semantic search Diba-Embed, and for speech‑to‑text Diba-STT.
دیبا (Diba-Base) یک مدل زبانی بزرگ (LLM) ایرانی ساختهی دیباچین است؛ مدلی حدود ۴ میلیارد پارامتری و فارسیمحور که برای عالی بودن در فارسی، شناخت ایران (از جمله تاریخ معاصر) و کدنویسی از روی دستور فارسی یا انگلیسی ساخته شده. آفلاین روی CPU با GGUF اجرا میشود، به همان زبانی که مینویسید پاسخ میدهد و از فراخوانی ابزار (Tool Calling) پشتیبانی میکند. اگر دنبال یک مدل زبانی فارسی، چتبات هوش مصنوعی ایرانی یا مدل زبان فارسی روی دستگاه خودتان هستید، دیبا همان است.
روی مدلهای متنباز هماندازه، با پرسشها و تستهای یکسان سنجیده شد: ۲۰ تست پایتون و ۲۰ تست جاوااسکریپت با اجرای واقعی، ۴۰ پرسش تاریخ ایران، و اینکه آیا مدل به زبان کاربر پاسخ میدهد.

| مدل | پایتون | جاوااسکریپت | تاریخ ایران | پاسخ به فارسی |
|---|---|---|---|---|
| دیبا | ۱۳/۲۰ | ۱۳/۲۰ | ۲۹/۴۰ | ۱۰/۱۰ |
| Gemma 3 4B | ۱۱/۲۰ | ۱۲/۲۰ | ۱۵/۴۰ | ۱۰/۱۰ |
| Granite 4.0 Micro 3B | ۱۴/۲۰ | ۱۱/۲۰ | ۱۱/۴۰ | ۱۰/۱۰ |
| Phi‑4‑mini 3.8B | ۱۱/۲۰ | ۱۰/۲۰ | ۵/۴۰ | ۱۰/۱۰ |
| SmolLM3 3B | ۱۱/۲۰ | ۱۰/۲۰ | ۴/۴۰ | ۹/۱۰ |
با توجه به اندازهی ۴ میلیاردی، دیبا در کدنویسی پیشتاز است، در پاسخ به زبان درست همتراز بهترینهاست، و در دانش فارسی دربارهی ایران با اختلاف زیاد جلوتر است؛ جایی که مدلهای عمومی ضعیفاند.
از همان نمونههای بخش انگلیسی استفاده کنید (Transformers، llama.cpp، Ollama). حالت فکر را خاموش نگه دارید (enable_thinking=false) و برای کد دما را روی ۰ بگذارید.
تو «دیبا» هستی، دستیار هوش مصنوعی دیباچین. به همان زبانی پاسخ بده که کاربر نوشته است؛ به فارسی نوشتاری، روشن و مؤدبانه.۰ برای کد و پاسخ دقیق، ۰٫۳ برای گفتگوی راحت.دیبا یک مدل جمعوجور ۴ میلیاردی برای اجرای فارسی روی دستگاه است. مانند هر مدل هماندازه، اطلاعات مهم و کدِ تولیدشده را پیش از اتکا بررسی کنید. برای تصویر از Diba-Vision، برای جستوجوی معنایی از Diba-Embed و برای گفتار به متن از Diba-STT استفاده کنید.
خانوادهی دیبا · The Diba family — Diba-Base · Diba-Embed · Diba-Vision · Diba-STT · Diba-Code · Diba-TTS · Diba-Image · Diba-ImageEdit
</div>