Instructions to use Nanthasit/sakthai-context-0.5b-tools-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanthasit/sakthai-context-0.5b-tools-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanthasit/sakthai-context-0.5b-tools-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Nanthasit/sakthai-context-0.5b-tools-sft", device_map="auto") - PEFT
How to use Nanthasit/sakthai-context-0.5b-tools-sft with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanthasit/sakthai-context-0.5b-tools-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanthasit/sakthai-context-0.5b-tools-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nanthasit/sakthai-context-0.5b-tools-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-context-0.5b-tools-sft
- SGLang
How to use Nanthasit/sakthai-context-0.5b-tools-sft with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Nanthasit/sakthai-context-0.5b-tools-sft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nanthasit/sakthai-context-0.5b-tools-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Nanthasit/sakthai-context-0.5b-tools-sft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nanthasit/sakthai-context-0.5b-tools-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-context-0.5b-tools-sft with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-0.5b-tools-sft
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
- Base model:
sakthai-context-0.5b-tools - Environment:
hermes-tool-use-rl-env - Full write-up:
sakthai-bench-v2/FINDINGS_20260731.md
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."
Model tree for Nanthasit/sakthai-context-0.5b-tools-sft
Base model
Qwen/Qwen2.5-0.5BDataset 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-reported16.700
- Selection Accuracy on SakThai Bench v2 (500 rows)self-reported77.800
- Arguments Accuracy on SakThai Bench v2 (500 rows)self-reported36.700