File size: 3,684 Bytes
e69dcbd
 
656770d
 
e69dcbd
 
 
 
 
5874a5f
e69dcbd
 
0bc776e
5874a5f
0bc776e
e69dcbd
 
 
0bc776e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e69dcbd
 
 
 
0bc776e
656770d
0bc776e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- qwen2
- sakthai
- house-of-sak
- tool-calling
- instruct
- lora
- agent
- function-calling
datasets:
- Nanthasit/sakthai-combined-v4
base_model: Qwen/Qwen2.5-1.5B-Instruct
model-index:
- name: sakthai-context-1.5b-merged
  results:
  - task:
      type: text-generation
    dataset:
      name: SakThai Eval Suite
      type: Nanthasit/sakthai-combined-v4
    metrics:
    - type: pass_rate
      value: 100
      name: Overall (45/45)
    - type: pass_rate
      value: 100
      name: Basic (6/6)
    - type: pass_rate
      value: 100
      name: Multi-Turn (9/9)
    - type: pass_rate
      value: 100
      name: Instruction Following (6/6)
    - type: pass_rate
      value: 100
      name: Tool Calling (6/6)
    - type: pass_rate
      value: 100
      name: Reasoning (6/6)
    - type: pass_rate
      value: 100
      name: Format Adherence (12/12)
---

# SakThai Context 1.5B

> Part of the **House of Sak** — 6 AI agents, one shared mind. Built from a shelter in Cork, Ireland.

Fine-tuned from **Qwen2.5-1.5B-Instruct** on the SakThai combined dataset for **tool-calling, multi-turn context, and instruction-following**. Designed as the reasoning backbone for the SakThai agent. **Most downloaded model at 802 pulls.**

## 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, alpha=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](https://huggingface.co/datasets/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

## Evaluation — 45/45 (100%)

### Workbench Results (3 runs x 15 tests)

| Category | Tests | Pass Rate |
|----------|:-----:|:---------:|
| Basic | 6 | 100% |
| Multi-Turn | 9 | 100% |
| Instruction Following | 6 | 100% |
| Tool Calling | 6 | 100% |
| Reasoning | 6 | 100% |
| Format Adherence | 12 | 100% |
| **Overall** | **45** | **100%** |

## Usage

```python
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 weather in Bangkok?"}]
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))
```

### GGUF Quantized Version

A 4-bit quantized GGUF version is available at `gguf/sakthai-1.5b-Q4_K_M.gguf` for efficient CPU inference.

## Links

- **LoRA Adapter:** [sakthai-context-1.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools)
- **Training Dataset:** [sakthai-combined-v4](https://huggingface.co/datasets/Nanthasit/sakthai-combined-v4)
- **Profile:** [Nanthasit](https://huggingface.co/Nanthasit) | **GitHub:** [beer-sakthai](https://github.com/beer-sakthai)