Text Generation
Transformers
Safetensors
English
qwen2
qwen2.5
sakthai
house-of-sak
tool-calling
function-calling
agent
instruct
finetuned
sft
merged
conversational
assistant
cpu-inference
rsLoRA
benchmark
Eval Results
llama-cpp
Eval Results (legacy)
text-generation-inference
Instructions to use Nanthasit/sakthai-plus-1.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanthasit/sakthai-plus-1.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanthasit/sakthai-plus-1.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-plus-1.5b") model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-plus-1.5b", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanthasit/sakthai-plus-1.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanthasit/sakthai-plus-1.5b" # 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-plus-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-plus-1.5b
- SGLang
How to use Nanthasit/sakthai-plus-1.5b 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-plus-1.5b" \ --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-plus-1.5b", "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-plus-1.5b" \ --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-plus-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-plus-1.5b with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-plus-1.5b
docs: improve model card with concise usage, verified benchmarks, metadata summary
Browse files
README.md
CHANGED
|
@@ -35,10 +35,10 @@ inference:
|
|
| 35 |
widget:
|
| 36 |
- text: "Send an email to Beer with the subject 'Status update' and body 'The model is running well.'"
|
| 37 |
output:
|
| 38 |
-
text: "<tool_call>{'name': 'send_email', 'arguments': {'to': 'Beer', 'subject': 'Status update', 'body': 'The model is running well.'}}
|
| 39 |
- text: "What's the weather in Bangkok?"
|
| 40 |
output:
|
| 41 |
-
text: "<tool_call>{'name': 'get_weather', 'arguments': {'location': 'Bangkok'}}
|
| 42 |
model-index:
|
| 43 |
- name: sakthai-plus-1.5b
|
| 44 |
results:
|
|
@@ -106,178 +106,80 @@ model-index:
|
|
| 106 |
value: 50.9
|
| 107 |
name: GSM8K
|
| 108 |
verified: false
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
---
|
| 110 |
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
-
|
|
|
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
- **Base model:** [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct)
|
| 122 |
-
- **Fine-tuning:** Full-parameter merge of rsLoRA adapters trained on curated tool-calling datasets
|
| 123 |
-
- **Architecture:** Qwen2ForCausalLM β 28 layers, 12 attention heads, 2 KV heads, hidden size 1536, intermediate 8960
|
| 124 |
-
- **Parameters:** ~1.54B (bf16, 2.88 GiB on disk)
|
| 125 |
-
- **Format:** Qwen2.5 chat template (standard)
|
| 126 |
-
- **Context length:** 32K tokens (max_position_embeddings: 32768)
|
| 127 |
- **License:** Apache 2.0
|
| 128 |
-
|
| 129 |
-
## Intended Use
|
| 130 |
-
|
| 131 |
-
- Tool/function calling agents and assistants
|
| 132 |
-
- Conversational AI with structured output generation
|
| 133 |
-
- Lightweight on-device agent deployments (CPU-friendly at 1.5B)
|
| 134 |
-
- Prototyping agentic workflows before scaling to larger models
|
| 135 |
|
| 136 |
## Training Data
|
| 137 |
|
| 138 |
-
The model was fine-tuned on a curated mixture of:
|
| 139 |
-
|
| 140 |
| Dataset | Rows | Description |
|
| 141 |
|---------|------|-------------|
|
| 142 |
-
| **Nanthasit/sakthai-combined-v11** | 2,003 | Multi-source tool-calling examples
|
| 143 |
| **Nanthasit/SimpleToolCalling** | 2,002 | Structured function-calling examples |
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
| Hyperparameter | Value |
|
| 148 |
-
|---------------|-------|
|
| 149 |
-
| r / alpha / dropout | 16 / 32 / 0.05 |
|
| 150 |
-
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (all 7 linear) |
|
| 151 |
-
| Optimizer | AdamW (8-bit) |
|
| 152 |
-
| Learning rate | 2e-4 |
|
| 153 |
-
| Epochs | 3 |
|
| 154 |
-
| Precision | bf16 |
|
| 155 |
-
| Hardware | Free T4 GPU (Kaggle / Colab / HF Inference), $0 budget |
|
| 156 |
-
|
| 157 |
-
## Performance
|
| 158 |
-
|
| 159 |
-
Benchmark results across tool-calling, reasoning, and math tasks:
|
| 160 |
-
|
| 161 |
-
| Task | Metric | Score | Verified | Source |
|
| 162 |
-
|------|--------|:-----:|:--------:|--------|
|
| 163 |
-
| Tool Calling (send_email) | Success Rate | **1.0** (3/3) | β
Yes | llama.cpp 3-trial |
|
| 164 |
-
| Tool Calling | Valid JSON Args | **1.0** (3/3) | β
Yes | llama.cpp 3-trial |
|
| 165 |
-
| Tool Calling | Correct Answer | **1.0** (3/3) | β
Yes | llama.cpp 3-trial |
|
| 166 |
-
| Tool Selection (v2) | Selection Accuracy | **84.8%** | β No | sakthai-bench-v2 |
|
| 167 |
-
| Tool Selection (v2) | Arguments Accuracy | **33.7%** | β No | sakthai-bench-v2 |
|
| 168 |
-
| Tool Selection (v2) | Strict Accuracy | **33.7%** | β No | sakthai-bench-v2 |
|
| 169 |
-
| WinoGrande (WSC) | Accuracy | **59.6%** | β No | lighteval |
|
| 170 |
-
| HellaSwag | Accuracy | **34.0%** | β No | lighteval |
|
| 171 |
-
| GSM8K (Math) | Accuracy | **50.9%** | β No | lighteval |
|
| 172 |
|
| 173 |
-
|
| 174 |
-
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
|
| 180 |
## Quick Start
|
| 181 |
|
| 182 |
-
### Python β Direct Transformers
|
| 183 |
-
|
| 184 |
```python
|
| 185 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 186 |
|
| 187 |
model_id = "Nanthasit/sakthai-plus-1.5b"
|
| 188 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id
|
| 189 |
-
model = AutoModelForCausalLM.from_pretrained(model_id,
|
| 190 |
|
| 191 |
messages = [
|
| 192 |
{"role": "system", "content": "You are a helpful assistant with tool-calling capabilities."},
|
| 193 |
{"role": "user", "content": "What's the weather in Bangkok?"}
|
| 194 |
]
|
| 195 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt")
|
| 196 |
-
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.3, do_sample=True)
|
| 197 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 198 |
```
|
| 199 |
|
| 200 |
-
|
| 201 |
-
```
|
| 202 |
-
<tool_call>{'name': 'get_weather', 'arguments': {'location': 'Bangkok'}}</tool_call>
|
| 203 |
-
```
|
| 204 |
-
|
| 205 |
-
### Python β Tool-Calling with Multiple Tools
|
| 206 |
|
| 207 |
-
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
-
|
| 210 |
-
messages = [
|
| 211 |
-
{"role": "system", "content": """You have access to these tools:
|
| 212 |
-
- get_weather(location: str) β get weather for a city
|
| 213 |
-
- send_email(to: str, subject: str, body: str) β send an email
|
| 214 |
-
- search_web(query: str) β search the internet
|
| 215 |
-
|
| 216 |
-
Respond with the appropriate tool call in <tool_call> XML format."""},
|
| 217 |
-
{"role": "user", "content": "Send an email to Beer with the subject 'Status update' and body 'The model is running well.'"}
|
| 218 |
-
]
|
| 219 |
-
|
| 220 |
-
inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt")
|
| 221 |
-
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.3, do_sample=True)
|
| 222 |
-
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 223 |
-
# Extracts: <tool_call>{'name': 'send_email', 'arguments': {...}}</tool_call>
|
| 224 |
-
```
|
| 225 |
-
|
| 226 |
-
### llama.cpp / Ollama (GGUF)
|
| 227 |
-
|
| 228 |
-
For CPU inference, use the [llama.cpp](https://github.com/ggml-ai/llama.cpp) compatible GGUF version or convert manually:
|
| 229 |
-
|
| 230 |
-
```bash
|
| 231 |
-
# Convert to GGUF via llama.cpp
|
| 232 |
-
git clone https://github.com/ggml-ai/llama.cpp
|
| 233 |
-
cd llama.cpp
|
| 234 |
-
python3 convert_hf_to_gguf.py Nanthasit/sakthai-plus-1.5b --outfile sakthai-plus-1.5b-f16.gguf
|
| 235 |
-
|
| 236 |
-
# Run with llama-cli
|
| 237 |
-
./llama-cli -m sakthai-plus-1.5b-f16.gguf \
|
| 238 |
-
-p "<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n<|im_start|>user\nWhat's the weather in Bangkok?<|im_end|>\n<|im_start|>assistant\n" \
|
| 239 |
-
-no-cnv --simple-io -n 256 -t 2
|
| 240 |
-
```
|
| 241 |
-
|
| 242 |
-
## Model Family
|
| 243 |
-
|
| 244 |
-
This model is part of the **SakThai Model Family** β 25 models across sizes and specializations:
|
| 245 |
-
|
| 246 |
-
| Variant | Type | Description |
|
| 247 |
-
|---------|------|-------------|
|
| 248 |
-
| **sakthai-plus-1.5b** | β
This | Merged instruct, tool calling |
|
| 249 |
-
| **sakthai-plus-1.5b-lora** | LoRA adapter | Lightweight adapter for the same base |
|
| 250 |
-
| **sakthai-plus-1.5b-coder** | Skeleton | Code-specialized variant (base: Qwen2.5-Coder-1.5B) |
|
| 251 |
-
| **sakthai-context-1.5b-tools-v2** | Model | Improved tool-use variant |
|
| 252 |
-
| **sakthai-context-1.5b-merged-v2** | Model | Full weights, merged from v2 LoRA |
|
| 253 |
-
| **Family size** | 25 public models across merged, LoRA, vision, embedding, TTS, and coder variants |
|
| 254 |
-
| **Current downloads** | 244 |
|
| 255 |
-
| **Last updated** | 2026-07-31 |
|
| 256 |
-
| [View full collection β](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02) |
|
| 257 |
-
|
| 258 |
-
## Limitations
|
| 259 |
-
|
| 260 |
-
- **Language:** Optimized for English tool-calling scenarios. Multilingual prompts may degrade performance.
|
| 261 |
-
- **Knowledge cutoff:** The base Qwen2.5-1.5B-Instruct has a knowledge cutoff of ~2024. The fine-tuning dataset (2025β2026 tool-calling examples) does not expand world knowledge.
|
| 262 |
-
- **Argument precision:** sakthai-bench-v2 shows 84.8% selection accuracy but only 33.7% strict accuracy β the model often selects the right tool but generates malformed arguments.
|
| 263 |
-
- **Hallucination risk:** Like all language models, it may generate plausible-sounding but incorrect tool arguments. Always validate tool calls before execution in production.
|
| 264 |
-
- **Not a general reasoning model:** Benchmarks on commonsense (HellaSwag 34.0%, WinoGrande 59.6%) are below larger models. This is a tool-calling specialist, not a general-purpose reasoner.
|
| 265 |
-
- **Unverified benchmarks:** 8 of 9 metric entries are single-trial and unverified. Verified scores (3/3 tool-calling) were measured on llama.cpp q4_k_m (CPU, 2 threads).
|
| 266 |
-
- **Free-tier constraints:** Trained entirely on free T4 GPU credits. No production-grade training infra was used.
|
| 267 |
-
|
| 268 |
-
## Citation
|
| 269 |
-
|
| 270 |
-
```bibtex
|
| 271 |
-
@misc{sakthai-plus-1.5b,
|
| 272 |
-
author = {Burankum, Nanthasit},
|
| 273 |
-
title = {SakThai Plus 1.5B: Enhanced Tool-Calling Language Model},
|
| 274 |
-
year = {2026},
|
| 275 |
-
publisher = {Hugging Face},
|
| 276 |
-
howpublished = {\url{https://huggingface.co/Nanthasit/sakthai-plus-1.5b}},
|
| 277 |
-
note = {Fine-tuned from Qwen2.5-1.5B-Instruct with rsLoRA}
|
| 278 |
-
}
|
| 279 |
-
```
|
| 280 |
|
| 281 |
-
|
|
|
|
|
|
|
|
|
|
| 282 |
|
| 283 |
-
Apache 2.0
|
|
|
|
| 35 |
widget:
|
| 36 |
- text: "Send an email to Beer with the subject 'Status update' and body 'The model is running well.'"
|
| 37 |
output:
|
| 38 |
+
text: "<tool_call>{'name': 'send_email', 'arguments': {'to': 'Beer', 'subject': 'Status update', 'body': 'The model is running well.'}}"
|
| 39 |
- text: "What's the weather in Bangkok?"
|
| 40 |
output:
|
| 41 |
+
text: "<tool_call>{'name': 'get_weather', 'arguments': {'location': 'Bangkok'}}"
|
| 42 |
model-index:
|
| 43 |
- name: sakthai-plus-1.5b
|
| 44 |
results:
|
|
|
|
| 106 |
value: 50.9
|
| 107 |
name: GSM8K
|
| 108 |
verified: false
|
| 109 |
+
extra:
|
| 110 |
+
downloads: 244
|
| 111 |
+
likes: 0
|
| 112 |
+
last_modified: 2026-08-01 07:31:41+00:00
|
| 113 |
---
|
| 114 |
|
| 115 |
+
<p align="center">
|
| 116 |
+
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A//huggingface.co/api/models/Nanthasit/sakthai-plus-1.5b&query=%24.downloads&label=downloads&color=blue&cacheSeconds=3600" alt="Downloads"/>
|
| 117 |
+
<img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/>
|
| 118 |
+
<img src="https://img.shields.io/badge/params-1.54B-blueviolet" alt="Params"/>
|
| 119 |
+
<a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02"><img src="https://img.shields.io/badge/%F0%9F%8F%A0-SakThai%20Family-6644cc" alt="Collection"/></a>
|
| 120 |
+
<a href="https://huggingface.co/spaces/Nanthasit/sakthai-leaderboard"><img src="https://img.shields.io/badge/%F0%9F%93%8A-Leaderboard-ff6b6b" alt="Leaderboard"/></a>
|
| 121 |
+
</p>
|
| 122 |
|
| 123 |
+
<h1 align="center">SakThai Plus 1.5B</h1>
|
| 124 |
+
<p align="center"><em>rsLoRA-merged instruct model for tool calling and agentic workflows</em></p>
|
| 125 |
|
| 126 |
+
**SakThai Plus 1.5B** is a **merged** rsLoRA fine-tune of [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct), optimized for structured tool-calling and instruction-following.
|
| 127 |
|
| 128 |
+
- **Base model:** Qwen/Qwen2.5-1.5B-Instruct
|
| 129 |
+
- **Method:** rsLoRA β merged full weights
|
| 130 |
+
- **Context length:** 32,768 tokens
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
- **License:** Apache 2.0
|
| 132 |
+
- **Format:** Qwen2.5 chat template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
## Training Data
|
| 135 |
|
|
|
|
|
|
|
| 136 |
| Dataset | Rows | Description |
|
| 137 |
|---------|------|-------------|
|
| 138 |
+
| **Nanthasit/sakthai-combined-v11** | 2,003 | Multi-source tool-calling examples |
|
| 139 |
| **Nanthasit/SimpleToolCalling** | 2,002 | Structured function-calling examples |
|
| 140 |
|
| 141 |
+
## Benchmarks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
+
| Task | Metric | Score | Verified |
|
| 144 |
+
|:-----|-------:|------:|:--------|
|
| 145 |
+
| Tool Calling | Tool Call Success Rate | 1.0 | β
Yes |
|
| 146 |
+
| Tool Calling | Valid JSON Arguments | 1.0 | β
Yes |
|
| 147 |
+
| Tool Calling | Correct Answer Rate | 1.0 | β
Yes |
|
| 148 |
+
| Tool Selection (v2) | Selection Accuracy | 84.8% | β No |
|
| 149 |
+
| Tool Selection (v2) | Strict Accuracy | 33.7% | β No |
|
| 150 |
+
| Commonsense | WinoGrande | 59.6% | β No |
|
| 151 |
+
| Commonsense | HellaSwag | 34.0% | β No |
|
| 152 |
+
| Math | GSM8K | 50.9% | β No |
|
| 153 |
|
| 154 |
## Quick Start
|
| 155 |
|
|
|
|
|
|
|
| 156 |
```python
|
| 157 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 158 |
|
| 159 |
model_id = "Nanthasit/sakthai-plus-1.5b"
|
| 160 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 161 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
| 162 |
|
| 163 |
messages = [
|
| 164 |
{"role": "system", "content": "You are a helpful assistant with tool-calling capabilities."},
|
| 165 |
{"role": "user", "content": "What's the weather in Bangkok?"}
|
| 166 |
]
|
| 167 |
inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt")
|
| 168 |
+
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.3, do_sample=True)
|
| 169 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 170 |
```
|
| 171 |
|
| 172 |
+
## Notes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
+
- 3/3 verified tool-calling score measured with llama.cpp q4_k_m.
|
| 175 |
+
- Tool selection is strong, but argument accuracy needs refinement.
|
| 176 |
+
- Unverified scores are single-trial; multi-trial replication is planned.
|
| 177 |
+
- Trained on free T4 credits; no paid compute was used.
|
| 178 |
|
| 179 |
+
## SakThai Family
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
+
| Repo | Downloads | Pipeline |
|
| 182 |
+
|-----:|----------:|:---------|
|
| 183 |
+
| [sakthai-plus-1.5b-lora](https://huggingface.co/Nanthasit/sakthai-plus-1.5b-lora) | β | text-generation |
|
| 184 |
+
| [sakthai-context-1.5b-tools-v2](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools-v2) | β | text-generation |
|
| 185 |
|
|
|