Instructions to use Darmm/darmm-chat-kazakh-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Darmm/darmm-chat-kazakh-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Darmm/darmm-chat-kazakh-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Darmm/darmm-chat-kazakh-8b") model = AutoModelForCausalLM.from_pretrained("Darmm/darmm-chat-kazakh-8b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Darmm/darmm-chat-kazakh-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Darmm/darmm-chat-kazakh-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Darmm/darmm-chat-kazakh-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Darmm/darmm-chat-kazakh-8b
- SGLang
How to use Darmm/darmm-chat-kazakh-8b 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 "Darmm/darmm-chat-kazakh-8b" \ --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": "Darmm/darmm-chat-kazakh-8b", "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 "Darmm/darmm-chat-kazakh-8b" \ --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": "Darmm/darmm-chat-kazakh-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Darmm/darmm-chat-kazakh-8b with Docker Model Runner:
docker model run hf.co/Darmm/darmm-chat-kazakh-8b
darmm-chat-kazakh-8b
Conversational assistant for Kazakh (with Russian and English retained) — a QLoRA fine-tune of Qwen/Qwen3-8B on ~105k instruction pairs (65k Kazakh, 25k Russian, 15k English). Supersedes the darmm-text-generation line.
Benchmarks
Zero-shot multiple-choice accuracy via option log-prob scoring (non-thinking chat template). KazMMLU: 3,000-question sample (seed 42) over all Kazakh-language subjects; Belebele: full kaz_Cyrl test (900).
| benchmark | Qwen3-8B (base) | this model |
|---|---|---|
| Belebele (kaz_Cyrl) | 27.2% | 39.8% |
| KazMMLU (kaz subjects) | 27.9% | 38.3% |
Reproducible with eval_chat.py in this repo.
Usage — generation settings matter
Use sampling, not greedy decoding: like the base model, long-form Kazakh degenerates into repetition under greedy decoding. Recommended settings:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Darmm/darmm-chat-kazakh-8b"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": "Наурыз мейрамы туралы айтып бер."}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(
**inputs, max_new_tokens=512,
do_sample=True, temperature=0.7, top_p=0.8, top_k=20, repetition_penalty=1.1,
)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The model is trained for non-thinking mode (enable_thinking=False).
Training
- QLoRA: 4-bit NF4 base, LoRA r=32 α=64 on all attention+MLP projections (59.9M trainable params)
- Data: AmanMussa/kazakh-instruction-v2 (51k) + sabinaasker/kazakh_dolly (15k) + Russian (d0rj/alpaca-cleaned-ru, 25k) + English (yahma/alpaca-cleaned, 15k)
- 1 epoch, effective batch 32, lr 1e-4 cosine, max_seq 1024, bf16 compute, single A100
The LoRA adapter alone is at Darmm/darmm-chat-kazakh-8b-lora.
Limitations
- Factual reliability is limited (38% KazMMLU): it can state dates, names, and facts confidently but wrongly — do not use as a factual reference without verification/RAG.
- Much of the Kazakh training data is machine-translated; phrasing can be unnatural and occasionally awkward.
- Greedy decoding degrades output — always use the sampling settings above.
- Not safety-tuned beyond what the base model provides.
Built by Darmm · 2026-09 · Apache 2.0
- Downloads last month
- 244