Instructions to use Nanthasit/sakthai-context-1.5b-merged 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 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") 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") model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-context-1.5b-merged") 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]:])) - llama-cpp-python
How to use Nanthasit/sakthai-context-1.5b-merged with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Nanthasit/sakthai-context-1.5b-merged", filename="gguf/sakthai-1.5b-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Nanthasit/sakthai-context-1.5b-merged with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M # Run inference directly in the terminal: llama cli -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M # Run inference directly in the terminal: llama cli -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Use Docker
docker model run hf.co/Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Nanthasit/sakthai-context-1.5b-merged 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
- SGLang
How to use Nanthasit/sakthai-context-1.5b-merged 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Nanthasit/sakthai-context-1.5b-merged with Ollama:
ollama run hf.co/Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
- Unsloth Studio
How to use Nanthasit/sakthai-context-1.5b-merged with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Nanthasit/sakthai-context-1.5b-merged to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Nanthasit/sakthai-context-1.5b-merged to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Nanthasit/sakthai-context-1.5b-merged to start chatting
- Pi
How to use Nanthasit/sakthai-context-1.5b-merged with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Nanthasit/sakthai-context-1.5b-merged:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Nanthasit/sakthai-context-1.5b-merged with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Nanthasit/sakthai-context-1.5b-merged with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Nanthasit/sakthai-context-1.5b-merged:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use Nanthasit/sakthai-context-1.5b-merged with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
- Lemonade
How to use Nanthasit/sakthai-context-1.5b-merged with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Nanthasit/sakthai-context-1.5b-merged:Q4_K_M
Run and chat with the model
lemonade run user.sakthai-context-1.5b-merged-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)SakThai Context 1.5B
Fine-tuned from Qwen2.5-1.5B-Instruct on the SakThai combined dataset for tool-calling, multi-turn context, and instruction-following capabilities. Designed as the reasoning backbone for the SakThai agent (running on Hermes Agent framework).
Model Details
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-1.5B-Instruct |
| Architecture | Qwen2 (decoder-only transformer) |
| Hidden Size | 1536 |
| Layers | 28 |
| Attention Heads | 12 |
| Intermediate Size | 8960 |
| Vocab Size | 151936 |
| Fine-tuning Method | LoRA (r=16, α=32, dropout=0.1) |
| Target Modules | q_proj, k_proj, v_proj, o_proj |
| Training Steps | 220 |
| Training Duration | ~39 minutes (4 epochs on 974 examples) |
| License | Apache 2.0 |
Training
- Base model: Qwen/Qwen2.5-1.5B-Instruct
- Dataset: Nanthasit/sakthai-combined-v4 — 974 training + 51 test examples covering 25 canonical tool schemas
- Method: LoRA via PEFT (rank=16, alpha=32, dropout=0.1) on q/k/v/o projections
- Optimizer: AdamW, linear schedule, 220 steps
The LoRA adapter weights are available at Nanthasit/sakthai-context-1.5b-tools.
Evaluation
45/45 tests passed (100%) across 3 runs (15 tests/run).
| Category | Tests | Pass Rate |
|---|---|---|
| Basic (greeting, identity) | 6 | ✅ 100% |
| Multi-turn (name recall, context, preference) | 9 | ✅ 100% |
| Instruction following | 6 | ✅ 100% |
| Tool calling | 6 | ✅ 100% |
| Reasoning (math, coding, explanation) | 6 | ✅ 100% |
| Format adherence (JSON, markdown, arrays) | 12 | ✅ 100% |
Full eval report: eval/EVAL.md
Usage
Via Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-context-1.5b-merged")
tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-context-1.5b-merged")
messages = [{"role": "user", "content": "What's the capital of Japan?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Via Inference Client
from huggingface_hub import InferenceClient
client = InferenceClient("Nanthasit/sakthai-context-1.5b-merged")
response = client.chat_completion(
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=256
)
print(response.choices[0].message.content)
Merging the Adapter
from peft import PeftModel
from transformers import AutoModelForCausalLM
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
model = PeftModel.from_pretrained(base, "Nanthasit/sakthai-context-1.5b-tools")
merged = model.merge_and_unload()
merged.save_pretrained("./sakthai-context-1.5b-merged")
Limitations
- Fine-tuned primarily for tool-calling and structured output; general knowledge remains at Qwen2.5-1.5B-Instruct baseline level.
- Tested on CPU — performance on GPU inference may produce slightly different output distributions.
- Best suited for agentic workflows with well-defined tool schemas. Complex multi-hop reasoning may require a larger base model.
Bias, Risks & Safety
This model is fine-tuned from Qwen2.5-1.5B-Instruct and inherits its base strengths and limitations. As a small language model (1.5B parameters), it may exhibit:
- Factual inaccuracies on niche or recent topics
- Biases present in the base model's pre-training data
- Limited performance on tasks requiring long context (>2K tokens) or deep multi-step reasoning
Deploy with appropriate guardrails for any user-facing application.
Citation
@misc{sakthai-context-1.5b,
author = {Nanthasit},
title = {SakThai Context 1.5B — Tool-Calling Fine-Tune},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged}}
}
- Downloads last month
- 700
Model tree for Nanthasit/sakthai-context-1.5b-merged
Dataset used to train Nanthasit/sakthai-context-1.5b-merged
Space using Nanthasit/sakthai-context-1.5b-merged 1
Collection including Nanthasit/sakthai-context-1.5b-merged
Evaluation results
- Overall Pass Rate (45/45) on SakThai Eval Suiteself-reported100.000
- Basic (6/6) on SakThai Eval Suiteself-reported100.000
- Multi-Turn (9/9) on SakThai Eval Suiteself-reported100.000
- Instruction Following (6/6) on SakThai Eval Suiteself-reported100.000
- Tool Calling (6/6) on SakThai Eval Suiteself-reported100.000
- Reasoning (6/6) on SakThai Eval Suiteself-reported100.000
- Format Adherence (12/12) on SakThai Eval Suiteself-reported100.000
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Nanthasit/sakthai-context-1.5b-merged", filename="gguf/sakthai-1.5b-Q4_K_M.gguf", )