Instructions to use Nanthasit/sakthai-context-1.5b-tools with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Nanthasit/sakthai-context-1.5b-tools with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "Nanthasit/sakthai-context-1.5b-tools") - Transformers
How to use Nanthasit/sakthai-context-1.5b-tools with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanthasit/sakthai-context-1.5b-tools") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Nanthasit/sakthai-context-1.5b-tools", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanthasit/sakthai-context-1.5b-tools 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-tools" # 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-tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-context-1.5b-tools
- SGLang
How to use Nanthasit/sakthai-context-1.5b-tools 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-tools" \ --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-tools", "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-tools" \ --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-tools", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-context-1.5b-tools with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-context-1.5b-tools
SakThai Context 1.5B β LoRA Adapter
LoRA adapter weights for fine-tuning Qwen2.5-1.5B-Instruct on the SakThai combined dataset. Designed for tool-calling, multi-turn context recall, and structured instruction following in agentic workflows.
Model Details
- Developed by: Nanthasit (Beer)
- Base Model: Qwen/Qwen2.5-1.5B-Instruct
- Fine-tuning Method: LoRA via PEFT 0.19.1
- Rank: 16 | Alpha: 32 | Dropout: 0.1
- Target Modules: q_proj, k_proj, v_proj, o_proj
- Task Type: Causal Language Modeling
- Training Steps: 220 | Epochs: 4
- Training Data: 974 examples (25 tool schemas)
- License: Apache 2.0
Usage
Load 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")
Merge (for Deployment)
merged = model.merge_and_unload()
merged.save_pretrained("./merged-model")
Pre-merged weights are available at Nanthasit/sakthai-context-1.5b-merged.
Training Hyperparameters
| Parameter | Value |
|---|---|
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.1 |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Learning rate | 5e-5 (linear schedule) |
| Batch size | 4 |
| Gradient accumulation | 4 |
| Epochs | 4 |
| Max steps | 220 |
| Precision | bf16 (mixed) |
| Optimizer | AdamW |
Evaluation
The merged model achieves 45/45 (100%) on the SakThai eval suite:
| Category | Pass Rate |
|---|---|
| Basic | β 6/6 |
| Multi-turn | β 9/9 |
| Instruction | β 6/6 |
| Tool calling | β 6/6 |
| Reasoning | β 6/6 |
| Format | β 12/12 |
Full eval report: Nanthasit/sakthai-context-1.5b-merged/eval/EVAL.md
Training Script
The full training script (train.py) is included in this repo and logs training loss over 220 steps.
- Downloads last month
- -