Text Generation
Transformers
Safetensors
English
qwen2
agent
conversational
ollama
small-language-model
slm
tool-use
qwen
qwen2.5
sakthai
house-of-sak
tool-calling
function-calling
merged
edge
lightweight
low-resource
raspberry-pi
on-device
benchmark
eval
Eval Results (legacy)
Eval Results
text-generation-inference
Instructions to use Nanthasit/sakthai-context-0.5b-tools 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 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") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-context-0.5b-tools") model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-context-0.5b-tools", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanthasit/sakthai-context-0.5b-tools 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-context-0.5b-tools
- SGLang
How to use Nanthasit/sakthai-context-0.5b-tools 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-context-0.5b-tools with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-0.5b-tools
docs: add Model Description, Limitations, and Citation sections to README
Browse files
README.md
CHANGED
|
@@ -114,6 +114,23 @@ model-index:
|
|
| 114 |
|
| 115 |
**SakThai Context 0.5B Tools** is the v4 release of the tool-calling agent — fine-tuned from Qwen2.5-0.5B-Instruct with prompt-masked SFT. It achieves **91.2% selection accuracy** (multiset-corrected scorer) on the SakThai Bench v2, a 2.3× improvement over the 40.2% baseline.
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
## Benchmark Results
|
| 118 |
|
| 119 |
All scores on [SakThai Bench v2](https://huggingface.co/datasets/Nanthasit/sakthai-bench-v2) (500 rows, 4 categories, multi-turn + held-out tools).
|
|
@@ -335,6 +352,36 @@ These sibling assets have traction building but less visibility. A download or l
|
|
| 335 |
| [🔊 TTS Showcase](https://huggingface.co/spaces/Nanthasit/sakthai-tts) | Text-to-speech in 15 languages |
|
| 336 |
| [📊 Leaderboard](https://huggingface.co/spaces/Nanthasit/sakthai-leaderboard) | Benchmark tracker for all models |
|
| 337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
## Links
|
| 339 |
|
| 340 |
- [🏠 SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02)
|
|
|
|
| 114 |
|
| 115 |
**SakThai Context 0.5B Tools** is the v4 release of the tool-calling agent — fine-tuned from Qwen2.5-0.5B-Instruct with prompt-masked SFT. It achieves **91.2% selection accuracy** (multiset-corrected scorer) on the SakThai Bench v2, a 2.3× improvement over the 40.2% baseline.
|
| 116 |
|
| 117 |
+
## Model Description
|
| 118 |
+
|
| 119 |
+
**SakThai Context 0.5B Tools** is the v4 release of the SakThai tool-calling agent -- an ultra-lightweight fine-tune of [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) (494M parameters) trained with **prompt-masked SFT** (completion-only loss) for structured tool-calling.
|
| 120 |
+
|
| 121 |
+
| Attribute | Value |
|
| 122 |
+
|-----------|-------|
|
| 123 |
+
| Base model | Qwen/Qwen2.5-0.5B-Instruct |
|
| 124 |
+
| Parameters | 494M |
|
| 125 |
+
| Model size | ~990 MB bfloat16 (Q4: ~295 MB) |
|
| 126 |
+
| Context length | 32,768 tokens (32K) |
|
| 127 |
+
| Method | SFT with prompt-masked loss (completion-only) |
|
| 128 |
+
| Precision | bfloat16 |
|
| 129 |
+
| Output format | `<tool_call>{"name": ..., "arguments": {...}}</tool_call>` XML |
|
| 130 |
+
| License | Apache 2.0 |
|
| 131 |
+
|
| 132 |
+
It calls tools with **91.8% selection accuracy** on [SakThai Bench v2](https://huggingface.co/datasets/Nanthasit/sakthai-bench-v2) (500 rows, 4 categories, multi-turn + held-out tools) -- a **2.3x improvement** over the 40.2% baseline -- while running in roughly **1 GB of RAM**, on a Raspberry Pi, or any edge device. The biggest gain came from per-assistant-turn prompt/completion pairs with `completion_only_loss=True`, which stopped the model from spending its gradient reproducing tool schemas instead of learning when to call tools.
|
| 133 |
+
|
| 134 |
## Benchmark Results
|
| 135 |
|
| 136 |
All scores on [SakThai Bench v2](https://huggingface.co/datasets/Nanthasit/sakthai-bench-v2) (500 rows, 4 categories, multi-turn + held-out tools).
|
|
|
|
| 352 |
| [🔊 TTS Showcase](https://huggingface.co/spaces/Nanthasit/sakthai-tts) | Text-to-speech in 15 languages |
|
| 353 |
| [📊 Leaderboard](https://huggingface.co/spaces/Nanthasit/sakthai-leaderboard) | Benchmark tracker for all models |
|
| 354 |
|
| 355 |
+
## Limitations
|
| 356 |
+
|
| 357 |
+
- **Small model, small ceiling.** With 494M parameters, complex multi-step reasoning, long code generation, and nuanced instruction-following are limited. This is a *tool-calling* specialist, not a general reasoning engine.
|
| 358 |
+
- **Exact argument accuracy is still weak** (45.7% overall; 38.7% simple / 52.7% parallel). The model usually selects the right tool but often emits imperfect argument values -- validate arguments before acting on them in production.
|
| 359 |
+
- **Single-trial internal benchmarks.** All scores come from an internal eval run (greedy, batch 16, max 200 new tokens) on SakThai Bench v2 -- reproducible via `eval_bench.py`, but not a third-party benchmark such as the Open LLM Leaderboard.
|
| 360 |
+
- **English-only.** Trained on English data; other languages degrade quickly.
|
| 361 |
+
- **Tool-schema sensitivity.** The model emits `<tool_call>` XML. Non-standard schemas, other function-calling formats, or very long tool lists can reduce accuracy.
|
| 362 |
+
- **32K context on a 0.5B model** does not mean 32K of reliable deep recall -- attention quality degrades well before the window fills for long documents.
|
| 363 |
+
|
| 364 |
+
## Citation
|
| 365 |
+
|
| 366 |
+
If you use this model, please cite the base model and the SakThai family work:
|
| 367 |
+
|
| 368 |
+
```bibtex
|
| 369 |
+
@misc{qwen25,
|
| 370 |
+
title={Qwen2.5 Technical Report},
|
| 371 |
+
author={Qwen Team, Alibaba Group},
|
| 372 |
+
year={2025},
|
| 373 |
+
url={https://arxiv.org/abs/2412.15115}
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
@software{sakthai-context-0.5b-tools,
|
| 377 |
+
author = {SakThai Family (beer-sakthai)},
|
| 378 |
+
title = {SakThai Context 0.5B Tools -- Ultra-light tool-calling agent},
|
| 379 |
+
year = {2026},
|
| 380 |
+
url = {https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools},
|
| 381 |
+
note = {Built from a shelter in Cork, Ireland, with a $0 budget.}
|
| 382 |
+
}
|
| 383 |
+
```
|
| 384 |
+
|
| 385 |
## Links
|
| 386 |
|
| 387 |
- [🏠 SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02)
|