Instructions to use Nanthasit/sakthai-context-1.5b-merged-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanthasit/sakthai-context-1.5b-merged-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanthasit/sakthai-context-1.5b-merged-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-context-1.5b-merged-v2") model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-context-1.5b-merged-v2", 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-1.5b-merged-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanthasit/sakthai-context-1.5b-merged-v2" # 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-1.5b-merged-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-context-1.5b-merged-v2
- SGLang
How to use Nanthasit/sakthai-context-1.5b-merged-v2 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-1.5b-merged-v2" \ --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-1.5b-merged-v2", "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-1.5b-merged-v2" \ --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-1.5b-merged-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-context-1.5b-merged-v2 with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-1.5b-merged-v2
SakThai Context 1.5B merged v2 ðŸ§
Merged full-model tool-calling · Qwen2.5-1.5B · CPU-friendly · 3.1 GB safetensors
Part of the SakThai family — merged, full-parameter release of the 1.5B tool-calling line. Built on zero budget, runs on CPU, and remains one of the most accessible local tool-use models in the family.
Model Description
A merged, full-parameter Qwen2.5-1.5B model fine-tuned for structured tool-calling via <tools> XML schemas and <tool_call> JSON outputs. It is intended for single- and multi-tool use cases where you want a model that stays on-task without out-of-scope tool calls.
| Parameter | Value |
|---|---|
| Architecture | Qwen2ForCausalLM (qwen2) |
| Parameters | ~1.54 B |
| Hidden size | 1,536 |
| Layers | 28 |
| Attention heads | 12 (GQA, 2 KV heads) |
| Intermediate size | 8,960 |
| Vocabulary | 151,936 |
| Context length | 32,768 (32K) |
| RoPE theta | 1,000,000 |
| Base dtype | bfloat16 |
| License | Apache 2.0 |
| Size | ~3.1 GB (safetensors) |
How to Use
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Nanthasit/sakthai-context-1.5b-merged-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cpu")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Find news about Tesla, then get its latest stock price."}
]
tools = [
{"type": "function", "function": {
"name": "search_web",
"description": "Search recent news",
"parameters": {"type": "object", "properties": {"query": {"type": "string"}}, "required": ["query"]}
}},
{"type": "function", "function": {
"name": "get_stock_price",
"description": "Get current stock price by ticker",
"parameters": {"type": "object", "properties": {"ticker": {"type": "string"}}, "required": ["ticker"]}
}}
]
prompt = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=1024, temperature=0.7, top_p=0.8)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=False))
llama.cpp / GGUF note
This repo ships safetensors only. If you want CPU inference with llama.cpp / Ollama, use the GGUF companion:
# companion GGUF (if available in the family)
ollama run Nanthasit/sakthai-context-1.5b-merged
Benchmarks & Evaluation Status
SakThai Bench v2 (verified artifacts)
| Metric | Score | Verified |
|---|---|---|
| Strict Accuracy | 34.2 | ✅ |
| Selection Accuracy | 34.9 | ✅ |
| Arguments Accuracy | 44.2 | ✅ |
Source: .eval_results/sakthai-bench-v2.yaml in this repo, verified 2026-07-31.
Internal smoke test (cron eval, 2026-07-31)
| Metric | Score | Verified |
|---|---|---|
| Multi-tool correctness | 100% | ✅ |
| Valid JSON rate | 100% | ✅ |
Backend: llama.cpp Q4_K_M on CPU, 3 trials, multi-tool prompt (search_web + get_stock_price). Single-prompt smoke test, not a full benchmark.
Limitations
- Merged full-parameter release; no PEFT/LoRA adapter.
- Benchmarks are limited: bench-v2 scores show argument accuracy is still weak on this scale.
- Strong
<tool>schema requirement; tool-calling degrades without explicit schemas. - English-first training; non-English tool use is not validated.
- 32K context is config-supported but not stress-tested in this card.
- Serverless Inference API may be unreliable for merged 3.1 GB safetensors on free tiers.
- Internal benchmark is a single-prompt smoke test; treat 100% as presence-of-life, not full capability.
- Evaluation artifacts are local/cron-generated; no third-party evaluation has been run on this merged artifact yet.
Citation
@misc{sakthai-context-1.5b-merged-v2,
title = {SakThai Context 1.5B merged v2},
author = {Beer, Nanthasit},
year = {2026},
url = {https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged-v2}
}
@misc{qwen2.5,
title = {Qwen2.5: A Party of Foundation Models},
author = {Qwen Team},
year = {2024},
url = {https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct}
}
Sibling Models
| Model | Size | Role | Downloads |
|---|---|---|---|
| context-1.5b-merged | 3.1 GB | Flagship tool-calling merged | 1,599 |
| context-1.5b-merged-v2 (you are here) | 3.1 GB | v2 merged | 337 |
| context-0.5b-merged | 988 MB | Lightweight merged | 1,370 |
| context-7b-merged | 15.2 GB | Full-power merged | 744 |
| context-7b-128k | recipe | 128K long-context config | 506 |
| plus-1.5b | 3.1 GB | Plus merged | 0 |
| plus-1.5b-lora | 74 MB | Plus adapter | 0 |
Downloads verified live 2026-07-31 via HF API.
Links
House of Sak · GitHub · All models · All datasets
License
Apache 2.0.
Evaluation & Verification
Benchmarks in this card are either directly read from repo artifacts (.eval_results/*.yaml) or referenced from the base model. Smoke-test metrics are single-prompt local runs, not third-party benchmarks, and are labeled verified: false where appropriate. If you independently re-run these evals, Beer asks that you share results back to the leaderboard Space.
- Downloads last month
- 337
Model tree for Nanthasit/sakthai-context-1.5b-merged-v2
Datasets used to train Nanthasit/sakthai-context-1.5b-merged-v2
Nanthasit/sakthai-combined-v7
Nanthasit/sakthai-irrelevance-supplement
Space using Nanthasit/sakthai-context-1.5b-merged-v2 1
Collection including Nanthasit/sakthai-context-1.5b-merged-v2
Evaluation results
- Selection Accuracy on SakThai Bench v2self-reported34.900
- Arguments Accuracy on SakThai Bench v2self-reported44.200
- Strict Accuracy on SakThai Bench v2self-reported34.200
- multi-tool correctness on Internal tool-call smoke testself-reported100.000
- valid JSON rate on Internal tool-call smoke testself-reported100.000