Model Description
Table with columns: Property, Value| Property | Value |
|---|
| Base model | Nanthasit/sakthai-context-0.5b-tools (Qwen2.5-0.5B-Instruct) |
| Adapter type | LoRA |
LoRA rank r | 8 |
| LoRA alpha | 16 |
| Dropout | 0.0 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Adapter size | ~158 KB |
| Max context | 32,768 tokens |
| Parameters | 495M base + adapter |
| Language | English |
This adapter is a low-rank delta over the base SakThai 0.5B tool-calling model. It preserves the same architecture and tokenizer.
What's in the box
Table with columns: File, Size, Description| File | Size | Description |
|---|
adapter_model.safetensors | 138 KB | LoRA delta weights |
adapter_config.json | 1.1 KB | Adapter hyperparameters |
training_args.bin | 129 B | Serialized training args |
tokenizer.json | 13.2 KB | Tokenizer |
|
Total adapter size: ~158 KB
How to Use
Merge with base model
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = "Nanthasit/sakthai-context-0.5b-tools"
adapter = "Nanthasit/sft-out"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
Generate:
messages = [{"role": "user", "content": "What's the weather in Tokyo?"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=128, temperature=0.3, top_p=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Merge to GGUF (llama.cpp)
python -m peft.utils.merge_adapters \
--base_model Nanthasit/sakthai-context-0.5b-tools \
--adapter Nanthasit/sft-out \
--output merged-model
python -m transformers.convert_save_to_gguf merged-model --outtype q4_k_m --outfile sakthai-0.5b-sft-out-q4_k_m.gguf
Then run with llama.cpp:
./llama-cli -m sakthai-0.5b-sft-out-q4_k_m.gguf -p "What's the weather in Tokyo?" -n 128 --temp 0.3
This adapter was trained on the SakThai tool-calling format.
Prompt format:
<tools>
{
"function": "get_weather",
"params": {"location": "Bangkok"}
}
</tools>
Model output:
{"name": "get_weather", "arguments": {"location": "Bangkok"}}
Multi-turn tool results:
<tool_result>
{"result": "The weather in Bangkok is 32°C and sunny."}
</tool_result>
Benchmarks
No published benchmarks for this specific adapter yet. The base model
Nanthasit/sakthai-context-0.5b-tools
achieves strong single-shot tool-calling on sakthai-bench-v2.
For the SakThai family benchmarks, see the SakThai Leaderboard.
Reproduce
pip install transformers>=5.14.1 trl>=1.9.2 peft datasets accelerate
python -m trl.cli.sft \
--model_name_or_path Nanthasit/sakthai-context-0.5b-tools \
--dataset_name Nanthasit/sakthai-combined-v7 \
--adapter_output_dir sft-out \
--per_device_train_batch_size 8 \
--learning_rate 2e-4 \
--num_train_epochs 3 \
--lora_r 8 --lora_alpha 16 --lora_dropout 0.0 \
--lora_target_modules q_proj,k_proj,v_proj,o_proj \
--bf16
Training Details
Table with columns: Attribute, Value| Attribute | Value |
|---|
| Base model | Nanthasit/sakthai-context-0.5b-tools |
| Method | Supervised Fine-Tuning (SFT) via TRL |
| TRL version | 1.9.2 |
| Transformers | 5.14.1 |
| PyTorch | 2.11.0 |
| Datasets | 5.0.0 |
| Tokenizers | 0.22.2 |
Note: Exact training hyperparameters (learning rate, batch size, epochs) are not available from this repo alone. The training_args.bin file is present but contains unparsed binary data. Check sibling model sakthai-context-0.5b-tools for comparable settings.
Limitations
- Adapter-only. Must be loaded on top of the base model. Cannot be used standalone via
AutoModelForCausalLM.
- No standalone GGUF. Must be merged with base before GGUF conversion.
- Not servable serverless. The Hugging Face Inference API does not support dynamic LoRA adapter loading.
- Experimental. This is a new SFT training experiment; performance has not been extensively evaluated.
- Placeholder tokenizer. The
tokenizer.json in this repo is a placeholder; the actual tokenizer lives in the base model repo.
- License compatibility depends on base-model license (
apache-2.0).
Working Alternatives
Citation
If you use this adapter or the SakThai family in your work, please cite:
@misc{sakthai-sft-out,
title = {SakThai SFT-out LoRA Adapter},
author = {Beer (beer-sakthai) and the SakThai Agent family},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Nanthasit/sft-out}}
Base model:
@misc{qwen25-2025,
title = {Qwen2.5: A Party of Foundation Models},
author = {Qwen Team},
year = {2025},
url = {https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct}
}
TRL:
@software{vonwerra2020trl,
title = {{TRL: Transformers Reinforcement Learning}},
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
license = {Apache-2.0},
url = {https://github.com/huggingface/trl},
year = {2020}
}
SakThai Family
This adapter is part of the SakThai model family.
Downloads verified 2026-07-31.
Built with zero budget. Part of the House of Sak.