SakThai Context 7B — LoRA Adapter

A LoRA fine-tune of Qwen/Qwen2.5-7B-Instruct for structured tool-calling and instruction following, trained on the SakThai tool-calling curriculum.

Model Details

  • Developed by: Nanthasit
  • Base model: Qwen/Qwen2.5-7B-Instruct (7B parameters)
  • Architecture: Qwen2.5 decoder-only transformer + LoRA adapters
  • Fine-tuning method: LoRA (rank=16, alpha=32) via TRL SFTTrainer
  • Training data: Nanthasit/sakthai-combined-v5
  • License: Apache 2.0
  • Inference: BF16 (use transformers with device_map="auto")

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen2.5-7B-Instruct",
    torch_dtype="bfloat16",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")

model = PeftModel.from_pretrained(base_model, "Nanthasit/sakthai-context-7b-tools")

Chat Template

The model uses Qwen2.5's standard chat template with system/user/assistant roles and supports function-calling via the tools parameter in the tokenizer.

Merged Version

For production inference, use the merged model instead: 👉 Nanthasit/sakthai-context-7b-merged

Intended Use

  • Tool-calling and function-calling agents
  • Structured instruction following
  • Chat and assistant applications requiring external tool use

Training Details

  • Framework: Hugging Face TRL (SFTTrainer)
  • Compute: HF Jobs (T4 GPU)
  • Quantization: 4-bit NF4 for training
  • Dataset size: ~4,000+ tool-calling examples
  • LoRA config: r=16, lora_alpha=32, target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
Downloads last month
55
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Nanthasit/sakthai-context-7b-tools

Base model

Qwen/Qwen2.5-7B
Adapter
(2364)
this model

Dataset used to train Nanthasit/sakthai-context-7b-tools

Collection including Nanthasit/sakthai-context-7b-tools