Downloads

SakThai Context 0.5B — Tools + SFT bootstrap (experimental)
Part of the SakThai Model Family

What this is

An experimental SFT bootstrap of sakthai-context-0.5b-tools, built to test whether the model's agentic (multi-turn) tool-use could be improved. This is an honest, mixed-result research checkpoint — read the results before treating it as a replacement for the base model.

This adapter is a LoRA (r=16) supervised-fine-tune of sakthai-context-0.5b-tools on 6 verified oracle trajectories — one correct multi-step solution (read → edit → submit) for each task in the hermes-tool-use-rl-env agentic coding environment. Each trajectory was checked to earn full reward against the environment's real grader before training.

Why it exists

The base 0.5b-tools solves those agentic tasks 0/6, which means reinforcement learning (GRPO) has no successes to reinforce from the start. This SFT was an attempt to lift the success rate above zero so RL could take over.

Results (honest)

Benchmark Base 0.5b-tools This checkpoint
Agentic (hermes-env, 6 tasks, native template) 0/6 1/6
Single-shot selection (sakthai-bench-v2) 91.0% 77.8% ⚠️
Single-shot arguments (sakthai-bench-v2) 45.7% 36.7% ⚠️

The SFT nudged agentic in the right direction (+1 task solved from scratch) but the config was too aggressive: it cost ~13 points of single-shot selection for that one agentic task. It also did not provide enough of a lift for a follow-up GRPO run to gain traction (GRPO from this checkpoint still saw zero reward variance).

Bottom line: this is a proof that the SFT-bootstrap direction works, not a recommended replacement for the base model. If you want the strong single-shot tool selector, use sakthai-context-0.5b-tools. The agentic improvement effort for this family is more promising on the 7B model (which already solves 3/6 and has a real RL learning signal).

Important format note: this adapter was trained with the model's native chat template (tokenizer.apply_chat_template(messages, tools=...)). Evaluate/serve it in that format — not the hand-rolled <tools> renderer some sibling models use — or it will underperform.

Training

  • Method: SFT, LoRA r=16 / α=32, targets q/k/v/o proj
  • Data: 6 oracle trajectories × 8 copies (48 rows), 3 epochs
  • Result: loss 1.98 → 0.30, token-accuracy 0.69 → 0.94
  • Compute: ~35s on a single L4 (HF Jobs)

Related

How to Use

This adapter is a LoRA on top of sakthai-context-0.5b-tools. Load it with the base model and use the native chat template (tokenizer.apply_chat_template(messages, tools=...)). Do NOT force it through a hand-rolled <tools> renderer or it will underperform.

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_id = "Nanthasit/sakthai-context-0.5b-tools"
adapter_id = "Nanthasit/sakthai-context-0.5b-tools-sft"

tokenizer = AutoTokenizer.from_pretrained(base_id)
base_model = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

tools = [
  {
    "type": "function",
    "function": {
      "name": "list_files",
      "description": "List files in a directory.",
      "parameters": {
        "type": "object",
        "properties": {
          "path": {"type": "string", "description": "Directory path"}
        },
        "required": ["path"]
      }
    }
  }
]

messages = [{"role": "user", "content": "List files under /tmp."}]
prompt = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False)
inputs = tokenizer(prompt, return_tensors="pt").to(base_model.device)
out = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(out[0], skip_special_tokens=True))

If you only need the adapter weights, load them with PeftModel on top of the base model.

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_id = "Nanthasit/sakthai-context-0.5b-tools"
adapter_id = "Nanthasit/sakthai-context-0.5b-tools-sft"

tokenizer = AutoTokenizer.from_pretrained(base_id)
base_model = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

prompt = "List the tools available for this session."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(out[0], skip_special_tokens=True))

Limitations

  • Mixed-quality tradeoff: agentic pass-rate improved but single-shot selection and arguments accuracy dropped vs. the base model.
  • Very small data: only 48 rows; results may not generalize.
  • Agentic range: still solves only 1/6 agentic tasks.
  • Template sensitivity: requires the base model's native chat template with tools=....
  • Scale ceiling: 0.5B parameters; not suitable for complex reasoning or tool use.
  • Verification status: benchmarks are self-run and unverified by HF.
  • Experimental checkpoint: not a recommended replacement for the base model.
  • GRPO not helpful yet: no success variance for RL to exploit from this point.
  • License: apache-2.0, but downstream tasks must comply with the base model license.

Citation

@misc{sakthai2026context05btoolssft,
  title={SakThai Context 0.5B Tools SFT: Experimental Agentic Bootstrap},
  author={SakThai Family (beer-sakthai)},
  year={2026},
  publisher={Hugging Face},
  howpublished={\url{https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools-sft}
}

Built from a shelter in Cork, Ireland. "We are one family — and becoming more."

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/sakthai-context-0.5b-tools-sft

Adapter
(3)
this model

Dataset used to train Nanthasit/sakthai-context-0.5b-tools-sft

Space using Nanthasit/sakthai-context-0.5b-tools-sft 1

Collection including Nanthasit/sakthai-context-0.5b-tools-sft

Evaluation results

  • Agentic pass-rate (1/6, native template) on hermes-tool-use-rl-env (6 multi-step coding tasks)
    self-reported
    16.700
  • Selection Accuracy on SakThai Bench v2 (500 rows)
    self-reported
    77.800
  • Arguments Accuracy on SakThai Bench v2 (500 rows)
    self-reported
    36.700