You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Farabi-1.7B

Multilingual instruction-tuned LLM for Kazakh / Russian / English. Supports function calling.

vLLM (server)

pip install "vllm>=0.9.0"

vllm serve nur-dev/farabi-1.7b \
  --dtype bfloat16 \
  --max-model-len 32768 \
  --gpu-memory-utilization 0.85 \
  --enable-auto-tool-choice \
  --tool-call-parser hermes
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nur-dev/farabi-1.7b",
    "messages": [{"role": "user", "content": "าšะฐะทะฐา›ัั‚ะฐะฝะฝั‹าฃ ะฐัั‚ะฐะฝะฐัั‹ า›ะฐะน า›ะฐะปะฐ?"}],
    "temperature": 0.4,
    "top_p": 0.9,
    "presence_penalty": 0.5,
    "frequency_penalty": 0.2,
    "max_tokens": 256
  }'

vLLM (offline)

from vllm import LLM, SamplingParams
from transformers import AutoTokenizer

ckpt = "nur-dev/farabi-1.7b"
tok  = AutoTokenizer.from_pretrained(ckpt)
llm  = LLM(model=ckpt, dtype="bfloat16", max_model_len=32768)
sp   = SamplingParams(
    temperature=0.4, top_p=0.9, max_tokens=512,
    presence_penalty=0.5, frequency_penalty=0.2,
    stop_token_ids=[tok.encode("<|im_end|>", add_special_tokens=False)[0]],
)

text = tok.apply_chat_template(
    [{"role": "user", "content": "17 า›ะพะน ร— 3 า›ะพะทั‹ = ?"}],
    tokenize=False, add_generation_prompt=True,
)
print(llm.generate([text], sp)[0].outputs[0].text)

transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

ckpt  = "nur-dev/farabi-1.7b"
tok   = AutoTokenizer.from_pretrained(ckpt)
model = AutoModelForCausalLM.from_pretrained(ckpt, dtype=torch.bfloat16, device_map="cuda:0")
eos   = tok.encode("<|im_end|>", add_special_tokens=False)[0]

messages = [{"role": "user", "content": "ะ ะฐััะบะฐะถะธ ะบั€ะฐั‚ะบะพ ะพะฑ ัะบะพัะธัั‚ะตะผะต ะณะพั€ะฝะพะณะพ ะะปั‚ะฐั."}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
enc  = tok(text, return_tensors="pt", add_special_tokens=False).to("cuda:0")

out = model.generate(
    **enc, max_new_tokens=512,
    do_sample=True, temperature=0.4, top_p=0.9,
    repetition_penalty=1.1,
    eos_token_id=eos, pad_token_id=tok.eos_token_id,
)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))

Tool calling

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "าšะฐะปะฐะดะฐา“ั‹ ะฐา“ั‹ะผะดะฐา“ั‹ ะฐัƒะฐ-ั€ะฐะนั‹ะฝ ะฐะปะฐะดั‹.",
        "parameters": {
            "type": "object",
            "properties": {"city": {"type": "string", "description": "าšะฐะปะฐ ะฐั‚ะฐัƒั‹"}},
            "required": ["city"],
        },
    },
}]
messages = [
    {"role": "system", "content": "ะกะตะฝ า›ะฐะทะฐา›ัˆะฐ ะบำฉะผะตะบัˆั–ัั–าฃ. าšะฐะถะตั‚ ะฑะพะปัะฐ, ะฐัƒะฐ-ั€ะฐะนั‹ า›าฑั€ะฐะปั‹ะฝ ัˆะฐา›ั‹ั€."},
    {"role": "user",   "content": "ะ‘าฏะณั–ะฝ ะัั‚ะฐะฝะฐะดะฐา“ั‹ ะฐัƒะฐ-ั€ะฐะนั‹ า›ะฐะฝะดะฐะน?"},
]
text = tok.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)

Sampling

Recommended (anti-loop) defaults:

param value
temperature 0.4
top_p 0.9
presence_penalty (vLLM) 0.5
frequency_penalty (vLLM) 0.2
repetition_penalty (transformers) 1.1
stop `<

On short-form KK reasoning prompts the model can loop with the temperature=0.6 / top_p=0.95 defaults. The settings above are tuned to suppress that mode. Greedy (temperature=0) is not recommended.

License

Apache 2.0.

Downloads last month
28
Safetensors
Model size
2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for nur-dev/farabi-1.7b

Finetuned
Qwen/Qwen3-1.7B
Finetuned
(1,404)
this model