This repo contains a
4-bit precision version of artindnr/tea, a full fine-tune of
microsoft/phi-4 for question answering and long, multi-turn assistant conversations, with fine-tuning focused on Farsi (Persian) conversational ability.
Unlike GGUF quants, this is a
safetensors checkpoint quantized to 4-bit precision with
Unsloth (bitsandbytes nf4 backend), meant to be loaded directly with 🤗 Transformers or Unsloth — not with llama.cpp.
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4MODEL_ID = "artindnr/tea-4bit"
5
6tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
7model = AutoModelForCausalLM.from_pretrained(
8 MODEL_ID,
9 device_map="auto",
10)
11
12USER_PROMPT = "تو کی هستی و اسمت چیه؟"
13
14messages = [
15 {"role": "user", "content": USER_PROMPT},
16]
17
18inputs = tokenizer.apply_chat_template(
19 messages,
20 add_generation_prompt=True,
21 tokenize=True,
22 return_dict=True,
23 return_tensors="pt",
24).to(model.device)
25
26outputs = model.generate(
27 **inputs,
28 max_new_tokens=1024,
29 temperature=0.7,
30 do_sample=True,
31)
32
33print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name="artindnr/tea-4bit",
5 max_seq_length=8192,
6 load_in_4bit=True,
7 dtype=None, # auto-detect
8)
9FastLanguageModel.for_inference(model)
10
11messages = [
12 {"role": "user", "content": "تو کی هستی و اسمت چیه؟"},
13]
14
15inputs = tokenizer.apply_chat_template(
16 messages,
17 add_generation_prompt=True,
18 tokenize=True,
19 return_dict=True,
20 return_tensors="pt",
21).to(model.device)
22
23outputs = model.generate(
24 **inputs,
25 max_new_tokens=1024,
26 temperature=0.7,
27 do_sample=True,
28)
29
30print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Unsloth also lets you use this checkpoint as a starting point for further QLoRA fine-tuning if you want to adapt tea further while keeping it in 4-bit.
Same as
artindnr/tea: Farsi-first conversational assistance, question answering, and long multi-turn assistant deployments — this repo specifically targets
lower-VRAM GPU inference and fine-tuning via Transformers/Unsloth, as an alternative to the GGUF quants for CPU/llama.cpp-based deployment.
This model is released under the
MIT License, consistent with
artindnr/tea and the base
microsoft/phi-4 model.
1@misc{tea,
2 title = {tea: A Farsi-Focused, Full Fine-tune of Phi-4 for QA and Long-form Assistance},
3 author = {artindnr},
4 year = {2026},
5 url = {https://huggingface.co/artindnr/tea}
6}
Built on top of
artindnr/tea, itself a full fine-tune of
microsoft/phi-4. 4-bit quantization via
Unsloth.