Instructions to use Nanthasit/sakthai-context-7b-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanthasit/sakthai-context-7b-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanthasit/sakthai-context-7b-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-7b-merged") model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-context-7b-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanthasit/sakthai-context-7b-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-7b-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-7b-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-context-7b-merged
- SGLang
How to use Nanthasit/sakthai-context-7b-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-7b-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-7b-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-7b-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-7b-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-context-7b-merged with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-7b-merged
SakThai Context 7B — Merged Model
The best-performing model in the SakThai Context family. A full-parameter merged checkpoint of Qwen2.5-7B-Instruct with LoRA adapters fine-tuned for structured tool-calling and instruction following.
LoRA adapter: Nanthasit/sakthai-context-7b-tools
Training data: Nanthasit/sakthai-combined-v5
Model Details
| Property | Value |
|---|---|
| Developed by | Nanthasit |
| Base model | Qwen/Qwen2.5-7B-Instruct |
| Parameters | 7.6B |
| Architecture | Qwen2.5 decoder-only transformer |
| Precision | BF16 |
| Fine-tuning method | LoRA → merged (rank=16, alpha=32, target=q/k/v/o/gate/up/down) |
| License | Apache 2.0 |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"Nanthasit/sakthai-context-7b-merged",
torch_dtype="bfloat16",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-context-7b-merged")
messages = [{"role": "user", "content": "What's the weather like in Bangkok?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Tool Calling
The model supports structured tool-calling via Qwen2.5's tokenizer tool schema:
messages = [
{"role": "system", "content": "You are a helpful assistant with access to tools."},
{"role": "user", "content": "What's the weather in Bangkok?"}
]
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather",
"parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}
}
}
]
text = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)
Evaluation Results
Tested on a Tesla T4 (5.56 GB VRAM) via Hugging Face Jobs:
| Category | Result |
|---|---|
| Basic Response | ✅ 1/1 |
| Context Recall | ✅ 1/1 |
| Factual Accuracy | ✅ 1/1 |
| Instruction Following | ✅ 1/1 |
| JSON Output | ✅ 1/1 |
| Multi-turn | ✅ 1/1 |
| Name Recognition | ✅ 1/1 |
| Tool Calling | ✅ 1/1 |
| Overall | ✅ 8/8 (100%) |
Model load time: 137s on T4
Full eval report: eval/workbench-7b-2026-07-07.json
Smaller Variants
| Model | Size | Description |
|---|---|---|
| ⭐ sakthai-context-1.5b-merged | 1.5B | Balanced size/quality |
| ⭐ sakthai-context-0.5b-merged | 0.5B | Lightweight for edge/CPU |
Files
| File | Description |
|---|---|
model.safetensors |
Merged BF16 weights (13.8 GB) |
config.json |
Model configuration |
tokenizer.json / tokenizer_config.json |
Qwen2.5 tokenizer with chat template |
generation_config.json |
Default generation parameters |
eval/ |
Workbench evaluation scripts and results |
- Downloads last month
- 388
Model tree for Nanthasit/sakthai-context-7b-merged
Dataset used to train Nanthasit/sakthai-context-7b-merged
Space using Nanthasit/sakthai-context-7b-merged 1
Collection including Nanthasit/sakthai-context-7b-merged
Evaluation results
- Overall Pass Rate (8/8) on SakThai Workbench Evalself-reported100.000