Base Model LoRA TRL License

⚠️ Adapter-only repository — this repo contains only a LoRA adapter, not a standalone model. You must merge it with the base model before inference or GGUF export.

Model Card for sft-out

Model Description

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

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
tokenizer_config.json 694 B Tokenizer config
chat_template.jinja 2.5 KB Chat template

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

Tool-Calling Format

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.

Training Details

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

Model Type Best for
sakthai-context-0.5b-tools Base adapter (8.7 MB) Strongest standalone 0.5B tool caller
sakthai-context-0.5b-merged Merged (988 MB) Direct inference, no merge needed
sakthai-context-0.5b-tools-sft-v2 Adapter (8.3 MB) Newer SFT variant with richer data
sakthai-context-1.5b-merged Merged (3.1 GB) Mid-size, best balance

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.

Model Downloads Type
context-1.5b-merged 1,855 Merged weights
context-0.5b-merged 1,692 Merged weights
context-7b-merged 1,024 Merged weights
context-0.5b-tools 251 Base adapter
context-0.5b-tools-sft 0 SFT v1
context-0.5b-tools-sft-v2 0 SFT v2
sft-out 0 Adapter-only experiment

Downloads verified 2026-07-31.


Built with zero budget. Part of the House of Sak.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Nanthasit/sft-out

Adapter
(3)
this model

Dataset used to train Nanthasit/sft-out

Collection including Nanthasit/sft-out

Evaluation results

  • Standalone usable without merge on Adapter merge pipeline
    self-reported
    0.000
  • Tool-call success post-merge on Adapter merge pipeline
    self-reported
    pending