File size: 17,514 Bytes
6aa2e27
4d80bbb
 
 
6aa2e27
4fd05bb
 
4d80bbb
 
 
 
4fd05bb
 
4d80bbb
4fd05bb
db1252d
4d80bbb
 
 
db1252d
4d80bbb
 
 
db1252d
 
 
4d80bbb
4fd05bb
56b13ff
eeb26d1
e6bbc6b
 
56b13ff
db1252d
 
 
 
 
 
 
 
1f7261f
 
 
 
8213424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6aa2e27
 
4fd05bb
6aa2e27
4d80bbb
 
440f49f
4d80bbb
6aa2e27
4d80bbb
56b13ff
4d80bbb
 
db1252d
4d80bbb
 
db1252d
4d80bbb
6aa2e27
28603fd
1f7261f
28603fd
4d80bbb
6aa2e27
4d80bbb
6aa2e27
db1252d
6aa2e27
4d80bbb
db1252d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6aa2e27
4d80bbb
6aa2e27
4d80bbb
4fd05bb
 
 
4d80bbb
4fd05bb
 
4d80bbb
4fd05bb
4d80bbb
4fd05bb
4d80bbb
4fd05bb
 
4d80bbb
4fd05bb
 
4d80bbb
db1252d
4d80bbb
4fd05bb
 
4d80bbb
4fd05bb
4d80bbb
 
 
1f7261f
db1252d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f7261f
db1252d
 
 
 
 
 
4d80bbb
6aa2e27
 
 
4d80bbb
 
 
1f7261f
4d80bbb
 
 
db1252d
 
 
 
 
 
 
 
 
 
 
 
1f7261f
 
 
db1252d
28603fd
 
 
1f7261f
 
28603fd
 
 
db1252d
 
 
56b13ff
db1252d
 
 
 
 
 
 
 
 
 
 
 
6aa2e27
4d80bbb
6aa2e27
4d80bbb
6aa2e27
4d80bbb
 
 
23e313e
1f7261f
6aa2e27
4d80bbb
6aa2e27
8f3e4f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
db1252d
 
 
 
6aa2e27
28603fd
75465f7
 
 
 
 
6aa2e27
4fd05bb
6aa2e27
1f7261f
 
 
 
 
 
 
 
 
 
440f49f
1f7261f
 
 
 
 
 
 
440f49f
1f7261f
 
 
 
 
5d15100
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
---
license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- qwen2.5
- qwen2.5-coder
- sakthai
- house-of-sak
- browser-automation
- web-agent
- tool-calling
- function-calling
- tool-use
- agent
- code-generation
- finetuned
- finetune
- sft
- text-generation
- merged
- conversational
- safetensors
- transformers
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
datasets:
- Nanthasit/sakthai-combined-v8
- Nanthasit/sakthai-combined-v8
- Nanthasit/sakthai-combined-v11
- Nanthasit/sakthai-irrelevance-supplement
- Nanthasit/cycle-bench
inference:
  parameters:
    temperature: 0.3
    max_new_tokens: 256
    top_p: 0.9
  widget:
    - text: "Search for the latest AI news and summarize the top story."
      example_title: "Navigate + extract"
    - text: "Go to Hacker News, find the top post, and click through to read it."
      example_title: "Multi-step navigation"
    - text: "Open google.com, search for 'weather in Cork Ireland', and tell me the current conditions."
      example_title: "Search + extract weather"
model-index:
- name: SakThai Coder Browser
  results:
  - task:
      type: text-generation
      name: Browser Tool Calling (diagnostic)
    dataset:
      name: sakthai-coder-browser internal probe 2026-07-31
      type: internal
    metrics:
    - type: tool_call_rate
      value: 0.0
      verified: true
      notes: Multi-trial llama.cpp GGUF Q4_K_M CPU probe, 2026-07-31 05:21 UTC. 3/3 trials returned 0 output tokens; diagnosed as corrupted merged weights (nonzero attention-projection biases). Not deployable until clean re-merge and re-verification.
    - type: valid_json_rate
      value: 0.0
      verified: true
      notes: No <tool_call> JSON emitted in any trial at temp <= 0.7.
---

# SakThai Coder Browser

<p align="center">
  <strong>Browser automation agent β€” Qwen2.5-Coder-1.5B-Instruct fine-tuned for web interaction</strong><br/>
  <em>Part of the <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02>SakThai Model Family</a></em>
</p>

<p align="center">
  <a href="https://huggingface.co/Nanthasit><img src="https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc" alt="Profile"/></a>
  <a href="https://github.com/beer-sakthai"><img src="https://img.shields.io/badge/GitHub-beer--sakthai-181717?logo=github" alt="GitHub"/></a>
  <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02"><img src="https://img.shields.io/badge/%F0%9F%8F%A0-SakThai%20Family-6644cc" alt="Collection"/></a>
  <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2FNanthasit%2Fsakthai-coder-browser&query=%24.downloads&label=downloads&color=blue" alt="Downloads"/>
  <img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/>
  <img src="https://img.shields.io/badge/task-browser%20automation-ff6b6b" alt="Task"/>
  <img src="https://img.shields.io/badge/base-Qwen2.5--Coder--1.5B--Instruct-blueviolet" alt="Base"/>
</p>

> [!CAUTION]
> **BROKEN β€” DO NOT DEPLOY (as of 2026-07-31)** β€” The merged weights in this repo are **corrupted by a faulty LoRA merge**: all 84 attention-projection bias tensors are non-zero while Qwen2 initializes these biases to ZERO (layer-0 `k_proj.bias` absmean 27.7 / max 354). Multi-trial inference probes produced only whitespace loops β€” 0 tool calls, 0 valid JSON at temp <= 0.7. Full evidence: [`.eval_results/benchmark-20260731_052122.yaml`](https://huggingface.co/Nanthasit/sakthai-coder-browser/blob/main/.eval_results/benchmark-20260731_052122.yaml). The fault is in the **weights, not the GGUF conversion or the prompt format**. The [GGUF variant](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) was converted from these same corrupted weights and must be re-checked; the [LoRA adapter](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) needs a clean re-merge. Treat this repo as **not deployable** until re-merged and re-verified.

---

## Model Description

SakThai Coder Browser transforms Qwen2.5-Coder-1.5B-Instruct into a **browser automation assistant** that outputs structured `<tool_call>` XML/JSON for web interaction. It can navigate pages, click elements, type text, and extract content β€” designed to work with browser automation frameworks.

**Available actions via `<tool_call>` XML:**

| Tool | Example |
|------|---------|
| `browser_navigate(url)` | `<tool_call>{"name": "browser_navigate", "arguments": {"url": "https://example.com"}}</tool_call>` |
| `browser_click(element)` | `<tool_call>{"name": "browser_click", "arguments": {"element": "#search-button"}}</tool_call>` |
| `browser_type(element, text)` | `<tool_call>{"name": "browser_type", "arguments": {"element": "#search-input", "text": "AI news"}}</tool_call>` |
| `browser_extract()` | `<tool_call>{"name": "browser_extract", "arguments": {}}</tool_call>` |

---

## Tool-Calling Format

The repo ships its own `chat_template.jinja` (Qwen2.5 tool-calling style). When tools are provided, the system prompt embeds function signatures inside `<tools></tools>` XML tags and the model replies with a `<tool_call>` JSON block:

```text
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.

# Tools

You may call one or more functions to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
{"type": "function", "function": {"name": "browser_navigate", "parameters": {...}}}
</tools>

For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call><|im_end|>
<|im_start|>user
Search for the latest AI news.<|im_end|>
<|im_start|>assistant
<tool_call>
{"name": "browser_navigate", "arguments": {"url": "https://news.google.com"}}
</tool_call><|im_end|>
```

Tool results are wrapped in `<tool_response></tool_response>` blocks. Multi-turn loops are supported by the chat template.

---

## Quick Start

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Nanthasit/sakthai-coder-browser",
    torch_dtype=torch.bfloat16,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-coder-browser")

messages = [
    {"role": "system", "content": "You are SakThai Browser Agent. Use <tool_call> blocks to control the browser."},
    {"role": "user", "content": "Search for the latest AI news and summarize the top story."},
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.3)
print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
```

Expected output format:
```
<tool_call>{"name": "browser_navigate", "arguments": {"url": "https://news.google.com"}}</tool_call>
```

> Use the chat template. This model was trained with the Qwen2.5 tool-calling format β€” pass tools through `apply_chat_template` (or the repo's `chat_template.jinja`) rather than hand-rolling prompts.

### GGUF / llama.cpp variant

Prefer CPU inference or Ollama? Use the [GGUF build](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) (F16, ~7.1 GB) with llama.cpp:

```bash
huggingface-cli download Nanthasit/sakthai-coder-browser-gguf \
  sakthai-coder-browser-f16.gguf --local-dir ./
./llama-cli -m sakthai-coder-browser-f16.gguf \
  -p "<|im_start|>system\nYou are a browser automation assistant.<|im_end|>\n<|im_start|>user\nGo to google.com and search for the latest AI news<|im_end|>\n<|im_start|>assistant\n" \
  -n 512 -t 8 --temp 0.3
```

---

## Architecture

Verified from this repo's `config.json` (transformers 5.14.1):

| Property | Value |
|----------|-------|
| **Base Model** | [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct) |
| **Architecture** | Qwen2ForCausalLM (decoder-only transformer) |
| **Parameters** | 1,543,714,304 (1.54B) |
| **Hidden Size** | 1,536 |
| **Layers** | 28 |
| **Attention Heads** | 12 (GQA, 2 KV heads) |
| **Intermediate Size** | 8,960 |
| **Max Position** | 32,768 tokens |
| **Vocab Size** | 151,936 |
| **RoPE Theta** | 1,000,000 |
| **Activation** | SiLU (SwiGLU) |
| **Normalization** | RMSNorm (eps=1e-6) |
| **Precision** | BF16 |
| **Weights** | Single `model.safetensors` β€” 3,087,467,144 B (2.88 GB, API-verified) |
| **Tied embeddings** | yes (`tie_word_embeddings: true`) |

---

## Training Details

| Detail | Value |
|--------|-------|
| **Base model** | Qwen/Qwen2.5-Coder-1.5B-Instruct |
| **Method** | SFT via LoRA (r=16, alpha=32, dropout 0.05, rsLoRA) on all 7 linear projections, then merged to full weights |
| **Context length** | 32,768 tokens |
| **Precision** | BF16 |
| **Hardware** | Free T4 GPU (Kaggle / Colab) |
| **Budget** | $0 |

Training configuration mirrors the sibling [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) adapter (verified from its `adapter_config.json`: `peft` 0.20.0, `use_rslora: true`, `lora_dropout: 0.05`, target modules q/k/v/o/gate/up/down_proj).

---

## Evaluation & Status

**Honest status: inference benchmarks were attempted and did not produce output.** The repo's own `.eval_results/benchmark-20260731_052122.yaml` records a llama.cpp GGUF Q4_K_M run (3 trials, CPU, 2 threads, 2026-07-31 05:21 UTC, tool-calling browser prompt, 244 input tokens) in which **all 3 trials returned 0 output tokens** β€” no tool call, no valid JSON, no correct answer:

| Trial | Seed | Output tokens | Tool call | Valid JSON | Correct answer |
|:-----:|:----:|:-------------:|:---------:|:----------:|:--------------:|
| 1 | 7 | 0 | No | No | No |
| 2 | 42 | 0 | No | No | No |
| 3 | 1337 | 0 | No | No | No |

**Verdict β€” MODEL_BROKEN (bias corruption):** the repo's own eval YAML (updated 2026-07-31 05:50 UTC) includes **weight inspection** of `model.safetensors` that proves the fault is in the weights, not the harness:

- Qwen2 initializes attention-projection biases to **zero**; this merge left **all 84 bias tensors non-zero** (absmean > 0.01), e.g. layer-0 `k_proj.bias` absmean **27.7** / max **354**, layer-0 `q_proj.bias` absmean 1.17
- Degenerate generation at temp <= 0.7 on all 3 seeds β€” **whitespace loops** (150 newline tokens, 0 tool calls, 0 valid JSON); only at temp 1.5 did the model emit `Hi` on a trivial prompt
- GGUF tensor layout is structurally identical to the working `sakthai-plus-1.5b` GGUF (338 tensors, same names) -> the fault is in the **merged weights**, not the conversion
- No NaN present; `embed_tokens` is normal (absmean 0.0136) β€” corruption is isolated to the attention biases

**Recommended fix:** re-merge the LoRA adapter into `Qwen2.5-Coder-1.5B-Instruct` with correct bias handling (do not write adapter-state biases into the base where Qwen2 expects zeros), re-run the multi-trial probe, and update this card. Until then, this repo is **not deployable**.

**Hosted inference:** not available β€” router probe returned 404 (`Not Found`) and the legacy api-inference host does not resolve (per the same eval YAML). No `model-index` is published because there are no verified scores yet; publishing one would be misleading.

Ecosystem status from `.eval_results/cron-eval-sakthai-coder-browser-2026-07-30-1.yaml`: card quality **85/100**, repo hygiene **95/100**, health **23/100** (rank 20/20 β€” new repo, zero downloads at eval time; popularity/momentum/benchmarks components are 0 because the repo had no traction yet).

---

## Repo Contents

| File | Size | Purpose |
|------|-----:|---------|
| `model.safetensors` | 3,087,467,144 B | Merged BF16 weights (single shard) |
| `chat_template.jinja` | 2,507 B | Qwen2.5 tool-calling chat template |
| `config.json` | 1,373 B | Qwen2 config (32K ctx, GQA 2 KV heads) |
| `tokenizer.json` | 11,421,892 B | Tokenizer |
| `.eval_results/` | β€” | benchmark + cron-eval YAMLs |

---

## Sibling Models

| Variant | Repository |
|:--------|:-----------|
| **LoRA Adapter** (unmerged) | [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) |
| **GGUF** (llama.cpp / Ollama) | [sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) |
| **Merged model** (this repo) | [sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) |

---

## SakThai Model Family

One of **25 public model repos** in the [SakThai Model Family collection](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02) (plus companion repos [sakthai-bench-v3](https://huggingface.co/Nanthasit/sakthai-bench-v3), [sakthai-pipeline](https://huggingface.co/Nanthasit/sakthai-pipeline), [eval_results](https://huggingface.co/Nanthasit/eval_results), [sft-out](https://huggingface.co/Nanthasit/sft-out), and adapter pilots). Live download counts as of **2026-08-01**; this repo has 54 downloads.

| Model | Downloads |
|:------|----------:|
| [sakthai-context-1.5b-merged](https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged) | 1,855 |
| [sakthai-context-0.5b-merged](https://huggingface.co/Nanthasit/sakthai-context-0.5b-merged) | 1,692 |
| [sakthai-context-7b-merged](https://huggingface.co/Nanthasit/sakthai-context-7b-merged) | 1,024 |
| [sakthai-embedding-multilingual](https://huggingface.co/Nanthasit/sakthai-embedding-multilingual) | 627 |
| [sakthai-context-7b-128k](https://huggingface.co/Nanthasit/sakthai-context-7b-128k) | 610 |
| [sakthai-context-7b-tools](https://huggingface.co/Nanthasit/sakthai-context-7b-tools) | 489 |
| [sakthai-context-1.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools) | 477 |
| [sakthai-context-1.5b-merged-v2](https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged-v2) | 337 |
| [sakthai-vision-7b](https://huggingface.co/Nanthasit/sakthai-vision-7b) | 315 |
| [sakthai-plus-1.5b-lora](https://huggingface.co/Nanthasit/sakthai-plus-1.5b-lora) | 306 |
| [sakthai-context-0.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools) | 251 |
| [sakthai-tts-model](https://huggingface.co/Nanthasit/sakthai-tts-model) | 248 |
| [sakthai-plus-1.5b](https://huggingface.co/Nanthasit/sakthai-plus-1.5b) | 244 |
| [sakthai-context-1.5b-tools-v2](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools-v2) | 173 |
| [sakthai-coder-1.5b](https://huggingface.co/Nanthasit/sakthai-coder-1.5b) | 151 |
| **Coder Browser (this model)** β¬… | 54 |
| [sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) | 35 |
| [sakthai-embedding](https://huggingface.co/Nanthasit/sakthai-embedding) | 23 |
| [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) | 21 |
| [sakthai-plus-1.5b-coder](https://huggingface.co/Nanthasit/sakthai-plus-1.5b-coder) | 0 |
| [eval_results](https://huggingface.co/Nanthasit/eval_results) | 0 |
| [sakthai-bench-v3](https://huggingface.co/Nanthasit/sakthai-bench-v3) | 0 |
| [sakthai-pipeline](https://huggingface.co/Nanthasit/sakthai-pipeline) | 0 |
| [sakthai-context-0.5b-tools-sft](https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools-sft) | 0 |
| [sft-out](https://huggingface.co/Nanthasit/sft-out) | 0 |
| [sakthai-context-0.5b-tools-sft-v2](https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools-sft-v2) | 0 |

---

## Limitations

- **BROKEN weights** β€” all 84 attention bias tensors are corrupted by a faulty LoRA merge (see [Evaluation & Status](#evaluation--status)); do not deploy until re-merged and re-verified
- **No verified benchmark scores yet** β€” `model-index` currently carries 0% `tool_call_rate` and 0% `valid_json_rate` from the 2026-07-31 diagnostic probe; these are failure signals from corrupted weights, not representative task scores
- **Text-only** β€” cannot see images or screenshots (use [sakthai-vision-7b](https://huggingface.co/Nanthasit/sakthai-vision-7b) for vision tasks)
- **English-only web actions** β€” training data is primarily English web interactions; non-English pages may yield lower-quality actions
- **Context-limited** β€” best results with page content <= 4K tokens per interaction; long pages can exceed the model's effective working memory
- **Not servable on HF serverless inference** β€” no provider supports this custom fine-tune (router 404 verified); run locally via Transformers or the GGUF build once weights are repaired

---

## Citation

If you use SakThai Coder Browser in your work, please cite the base model and the fine-tuning approach:

```bibtex
@misc{qwen25coder,
    title = {Qwen2.5-Coder: Code Language Models},
    author = {Qwen Team},
    year = {2024},
    publisher = {Hugging Face},
    howpublished = {\url{https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct}}
}

@misc{sakthai-model-family,
    title = {SakThai Model Family: Zero-Budget Fine-Tuned Language Models},
    author = {{Beer Nanthasit}},
    year = {2026},
    publisher = {Hugging Face},
    howpublished = {\url{https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02}}
}
```

---

*Part of the [SakThai Model Family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02). Built with love, tears, and zero budget. From a shelter in Cork, Ireland, to the world.*