Nanthasit commited on
Commit
72181e2
Β·
verified Β·
1 Parent(s): 0d911fe

docs: improve model card with concise usage, verified benchmarks, metadata summary

Browse files
Files changed (1) hide show
  1. README.md +45 -143
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.'}}</tool_call>"
39
  - text: "What's the weather in Bangkok?"
40
  output:
41
- text: "<tool_call>{'name': 'get_weather', 'arguments': {'location': 'Bangkok'}}</tool_call>"
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
- # SakThai Plus 1.5B
 
 
 
 
 
 
112
 
113
- **House of Sak** β€” enhanced tool-calling instruct model, fine-tuned from Qwen2.5-1.5B-Instruct with rsLoRA and merged to full weight.
 
114
 
115
- ![Profile](https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc) ![GitHub](https://img.shields.io/badge/GitHub-beer--sakthai-181717?logo=github) ![Downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2FNanthasit%2Fsakthai-plus-1.5b&query=%24.downloads&label=downloads&color=blue&cacheSeconds=3600) ![License](https://img.shields.io/badge/license-Apache%202.0-green) ![Params](https://img.shields.io/badge/params-1.54B-blueviolet)
116
 
117
- ## Model Description
118
-
119
- SakThai Plus 1.5B is a **rsLoRA-merged** instruction-tuned model for tool calling and agentic workflows. It builds on the SakThai Context lineage with improved tool-use precision, conversational grounding, and instruction adherence.
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 (subset of v10) |
143
  | **Nanthasit/SimpleToolCalling** | 2,002 | Structured function-calling examples |
144
 
145
- **Training method:** rsLoRA (rank-stabilized) via TRL SFTTrainer, merged to full weights.
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
- **Key takeaways:**
174
- - **Tool calling performs reliably** β€” 3/3 on every trial in the verified `send_email` scenario. The model correctly formats `<tool_call>` XML with valid JSON arguments.
175
- - **Tool selection is strong** (84.8% selection accuracy on sakthai-bench-v2) but argument precision needs refinement (33.7% strict).
176
- - **Commonsense and math** scores reflect the base Qwen2.5-1.5B-Instruct capabilities with minor degradation from tool-calling specialization.
177
-
178
- > ⚠ Unverified scores are single-trial results from `.eval_results/`. Multi-trial replication is planned. The 3-trial tool-calling benchmark is the only verified result.
 
 
 
 
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, trust_remote_code=True)
189
- model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
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
- Expected output format:
201
- ```
202
- <tool_call>{'name': 'get_weather', 'arguments': {'location': 'Bangkok'}}</tool_call>
203
- ```
204
-
205
- ### Python β€” Tool-Calling with Multiple Tools
206
 
207
- This model uses the `<tool_call>` XML dialect (v2 format). Provide tool definitions in the system prompt:
 
 
 
208
 
209
- ```python
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
- ## License
 
 
 
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