Downloads · 30 days
16
3% of all-time downloads
Nanthasit/sakthai-context-1.5b-tools
sakthai-context-1.5b-tools is a text generation model from Nanthasit. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
⚠️ Deprecated (v1) — Superseded by sakthai-context-1.5b-tools-v2 and sakthai-plus-1.5b. Kept for lineage; new work should target the v2 adapter.
Downloads · 30 days
16
3% of all-time downloads
All-time downloads
618
Public
Repo size
66.5 MB
Likes
0
Public
Click a slice to open those files.
.json11.4 MB · 57%
From the Hugging Face model README
<p align="center"> <strong>SakThai Context 1.5B Tools (LoRA)</strong><br/> <em>Tool-calling adapter for Qwen2.5-1.5B · merged into the family flagship</em><br/> <em>Part of the <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02">SakThai Model Family</a></em> </p> <p align="center"> <a href="https://huggingface.co/Nanthasit"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc" alt="Profile"/></a> <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> <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2FNanthasit%2Fsakthai-context-1.5b-tools&query=%24.downloads&label=downloads&color=blue&cacheSeconds=3600" alt="Downloads"/> <img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/> <img src="https://img.shields.io/badge/base-Qwen2.5--1.5B--Instruct-orange" alt="Base model"/> <img src="https://img.shields.io/badge/adapter-8.75%20MB-blueviolet" alt="Adapter"/> </p>⚠️ Deprecated (v1) — Superseded by
sakthai-context-1.5b-tools-v2andsakthai-plus-1.5b. Kept for lineage; new work should target the v2 adapter.
This repo contains the PEFT LoRA adapter behind the family's most popular tool-calling checkpoint. It is optimized for merging into
Qwen/Qwen2.5-1.5B-Instruct, not standalone inference. For ready-to-run weights, use the merged model instead.
SakThai Context 1.5B Tools is a prompt-masked SFT adapter trained with PEFT LoRA on top of Qwen/Qwen2.5-1.5B-Instruct. It teaches the base model structured tool selection, JSON-style arguments, and <tools>-block-aware behavior.
The merged downstream checkpoint is Nanthasit/sakthai-context-1.5b-merged, which is the recommended artifact for inference, GGUF export, and agent deployment.
Qwen/Qwen2.5-1.5B-Instruct (1.54B params)adapter_model.safetensors)sakthai-combined-v6, sakthai-combined-v7, sakthai-irrelevance-supplementimport torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-1.5B-Instruct",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
model = PeftModel.from_pretrained(model, "Nanthasit/sakthai-context-1.5b-tools")
messages = [
{"role": "system", "content": "You are a helpful assistant with access to tools."},
{"role": "user", "content": "What's the weather in Tokyo?"}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=128,
temperature=0.3,
top_p=0.9
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
merged = model.merge_and_unload()
merged.save_pretrained("./sakthai-context-1.5b-merged-local")
tokenizer.save_pretrained("./sakthai-context-1.5b-merged-local")
apply_chat_template(..., add_generation_prompt=True) for proper prompt formatting.<tools> block so the adapter emits structured calls.| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2.5-1.5B-Instruct |
| Parameters | 1.54B base + 8.6M trainable LoRA params |
| Method | PEFT LoRA |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.1 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Training data | sakthai-combined-v6 + v7 + irrelevance-supplement |
| Context | 32,768 tokens |
| Format | ChatML with tool schema |
| Model | Selection | Arguments | Strict | Held-Out | Degenerate | Verified |
|---|---|---|---|---|---|---|
| LoRA, this repo | 55.8% | 11.0% | 11.0% | 31.7% | 0% | Single-trial |
| Merged 1.5B | 100.0% | 100.0% | — | 100.0% | 0% | Verified 5x |
| Tools v2 LoRA | 75.0% | 60.0% | 55.0% | — | — | Single-trial |
Important: LoRA-only numbers are lower because this adapter was tuned for merge behavior, not solo inference. For tool-calling use, prefer the merged model or v2 LoRA.
| Goal | Recommended artifact |
|---|---|
| Local CPU/edge inference | Nanthasit/sakthai-context-1.5b-merged |
| GGUF / Ollama / llama.cpp | merged model GGUF release |
| Serverless HF Inference | merged model, not this LoRA repo |
| Keep training flexibility | this repo + Qwen2.5-1.5B-Instruct |
@misc{sakthai2026lora,
title = {SakThai 1.5B Tools: PEFT LoRA Adapter for Qwen2.5-1.5B Tool-Calling},
author = {SakThai Agent Family and beer-sakthai},
year = {2026},
month = {August},
howpublished = {\url{https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools}},
note = {Part of the SakThai Model Family}
}
For the merged model:
@misc{sakthai2026merged,
title = {SakThai 1.5B Merged: Tool-Calling GGUF for Qwen2.5-1.5B-Instruct},
author = {SakThai Agent Family and beer-sakthai},
year = {2026},
month = {August},
howpublished = {\url{https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged}},
note = {Part of the SakThai Model Family}
}
Part of the SakThai Model Family. Built with love, tears, and zero budget.
<!-- improved-by: SakThai · 2026-08-01 -->