Text Generation
Transformers
Safetensors
English
qwen2
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
merged
conversational
Eval Results (legacy)
Eval Results
text-generation-inference
Instructions to use Nanthasit/sakthai-coder-browser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanthasit/sakthai-coder-browser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanthasit/sakthai-coder-browser") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-coder-browser") model = AutoModelForCausalLM.from_pretrained("Nanthasit/sakthai-coder-browser", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanthasit/sakthai-coder-browser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanthasit/sakthai-coder-browser" # 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-coder-browser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-coder-browser
- SGLang
How to use Nanthasit/sakthai-coder-browser 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-coder-browser" \ --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-coder-browser", "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-coder-browser" \ --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-coder-browser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanthasit/sakthai-coder-browser with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-coder-browser
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,192 +1,116 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
pipeline_tag: text-generation
|
| 4 |
-
license: apache-2.0
|
| 5 |
-
base_model: Qwen/Qwen2.5-1.5B-Instruct
|
| 6 |
tags:
|
| 7 |
-
- qwen2
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
- browser-automation
|
| 12 |
- web-agent
|
|
|
|
| 13 |
- function-calling
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
-
-
|
| 17 |
-
-
|
| 18 |
-
-
|
|
|
|
|
|
|
| 19 |
datasets:
|
| 20 |
- Nanthasit/SimpleToolCalling
|
| 21 |
- Nanthasit/sakthai-combined-v7
|
| 22 |
-
widget:
|
| 23 |
-
- messages:
|
| 24 |
-
- role: system
|
| 25 |
-
content: You are a browser automation assistant. You can browse the web, click elements, type text, and extract information from pages.
|
| 26 |
-
- role: user
|
| 27 |
-
content: Search for the latest AI news and summarize the top story.
|
| 28 |
---
|
| 29 |
|
| 30 |
# SakThai Coder Browser
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
Part of the **SakThai** model family — a collection of compact, edge-deployable models by the House of Sak.
|
| 37 |
-
|
| 38 |
-
## Model Details
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
| **Chat Template** | Qwen2 chat format with `<tool_call>` XML tool calling |
|
| 48 |
-
| **Pipeline** | Text Generation |
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
| Source | Link |
|
| 53 |
-
|--------|------|
|
| 54 |
-
| **LoRA Adapter** | [Nanthasit/sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) |
|
| 55 |
-
| **GGUF Quant** | [Nanthasit/sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) |
|
| 56 |
-
| **SakThai Family** | [sakthai-model-family](https://huggingface.co/collections/Nanthasit/sakthai-model-family-67e7b8c9f0a1b2c3d4e5f6a7) |
|
| 57 |
-
|
| 58 |
-
## Uses
|
| 59 |
-
|
| 60 |
-
### Direct Use
|
| 61 |
|
| 62 |
-
|
| 63 |
-
- **Browser automation** — instruct the model to navigate pages, click elements, fill forms, extract content
|
| 64 |
-
- **Web QA** — ask questions about web page content
|
| 65 |
-
- **Tool-use agents** — the model is trained to emit structured `<tool_call>` JSON for function execution
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
-
-
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
##
|
| 75 |
|
| 76 |
```python
|
| 77 |
-
import torch
|
| 78 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 79 |
|
| 80 |
-
model_name = "Nanthasit/sakthai-coder-browser"
|
| 81 |
-
|
| 82 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 83 |
model = AutoModelForCausalLM.from_pretrained(
|
| 84 |
-
|
| 85 |
torch_dtype=torch.bfloat16,
|
| 86 |
-
device_map="auto"
|
| 87 |
)
|
|
|
|
| 88 |
|
| 89 |
messages = [
|
| 90 |
-
{"role": "system", "content": "You are
|
| 91 |
{"role": "user", "content": "Search for the latest AI news and summarize the top story."},
|
| 92 |
]
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
tokenize=False,
|
| 97 |
-
add_generation_prompt=True,
|
| 98 |
-
)
|
| 99 |
-
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 100 |
-
outputs = model.generate(
|
| 101 |
-
**inputs,
|
| 102 |
-
max_new_tokens=1024,
|
| 103 |
-
temperature=0.7,
|
| 104 |
-
top_p=0.8,
|
| 105 |
-
repetition_penalty=1.1,
|
| 106 |
-
)
|
| 107 |
-
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
|
| 108 |
-
print(response)
|
| 109 |
```
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
```bash
|
| 114 |
-
# Download the GGUF version
|
| 115 |
-
huggingface-cli download Nanthasit/sakthai-coder-browser-gguf sakthai-coder-browser-f16.gguf --local-dir ./
|
| 116 |
-
|
| 117 |
-
# Run inference
|
| 118 |
-
llama-cli -m sakthai-coder-browser-f16.gguf \
|
| 119 |
-
-p "<|im_start|>system\nYou are a browser automation assistant.<|im_end|>\n<|im_start|>user\nSearch for AI news<|im_end|>\n<|im_start|>assistant\n" \
|
| 120 |
-
-n 512 -t 8
|
| 121 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
## Training Details
|
| 124 |
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
-
|
| 128 |
-
- Web navigation instructions paired with structured tool calls
|
| 129 |
-
- Multi-step browsing tasks (click, type, extract, wait, navigate)
|
| 130 |
-
- Diverse web page contexts across domains
|
| 131 |
|
| 132 |
-
|
| 133 |
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
-
-
|
| 137 |
-
- **Precision:** bfloat16 mixed precision
|
| 138 |
-
- **Optimizer:** AdamW
|
| 139 |
-
- **Learning rate:** 2e-5 with cosine decay
|
| 140 |
-
- **Context length:** 32,768 tokens
|
| 141 |
-
- **Hardware:** NVIDIA GPU (Kaggle/Colab)
|
| 142 |
|
| 143 |
## Evaluation
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
- Use with a structured generation parser (e.g., outline JSON from `<tool_call>` tags) for reliable function calling
|
| 148 |
-
- For production use, pair with browser automation frameworks (Playwright, Puppeteer, Browser Use)
|
| 149 |
-
- Benchmark on your specific browser automation tasks before deployment
|
| 150 |
-
|
| 151 |
-
## Related Models
|
| 152 |
-
|
| 153 |
-
| Model | Type | Description |
|
| 154 |
-
|-------|------|-------------|
|
| 155 |
-
| [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) | LoRA | LoRA adapter for browser automation (4.3M params) |
|
| 156 |
-
| [sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) | GGUF | F16 GGUF quantized version for llama.cpp |
|
| 157 |
-
| [sakthai-coder-1.5b](https://huggingface.co/Nanthasit/sakthai-coder-1.5b) | Text Gen | General-purpose code generation variant |
|
| 158 |
-
| [sakthai-context-1.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools) | Text Gen | General tool-use model at 1.5B scale |
|
| 159 |
-
|
| 160 |
-
## Technical Specifications
|
| 161 |
-
|
| 162 |
-
### Model Architecture
|
| 163 |
-
|
| 164 |
-
Qwen2 Decoder-only transformer:
|
| 165 |
-
- **Hidden size:** 1,536
|
| 166 |
-
- **Layers:** 28
|
| 167 |
-
- **Attention heads:** 12
|
| 168 |
-
- **KV heads:** 2 (grouped-query attention)
|
| 169 |
-
- **Intermediate size:** 8,960
|
| 170 |
-
- **Vocab size:** 151,936
|
| 171 |
-
- **Max position:** 32,768
|
| 172 |
-
- **Activation:** SiLU (Swiglu)
|
| 173 |
-
- **Normalization:** RMSNorm (eps=1e-6)
|
| 174 |
-
|
| 175 |
-
### Software
|
| 176 |
-
|
| 177 |
-
- **Framework:** PyTorch + Transformers v5.14.1
|
| 178 |
-
- **Chat template:** Qwen2 format with `<tool_call>` / `<tool_response>` XML
|
| 179 |
-
|
| 180 |
-
## License
|
| 181 |
-
|
| 182 |
-
This model is released under **Apache 2.0**, inheriting from Qwen2.5.
|
| 183 |
-
|
| 184 |
-
## Environmental Impact
|
| 185 |
-
|
| 186 |
-
- **Hardware Type:** NVIDIA GPU (T4/L4)
|
| 187 |
-
- **Hours used:** ~48 hours
|
| 188 |
-
- **Compute Region:** US
|
| 189 |
|
| 190 |
---
|
| 191 |
|
| 192 |
-
*
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
library_name: transformers
|
| 6 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
| 7 |
tags:
|
| 8 |
+
- qwen2.5
|
| 9 |
+
- qwen2.5-coder
|
| 10 |
+
- sakthai
|
| 11 |
+
- house-of-sak
|
| 12 |
- browser-automation
|
| 13 |
- web-agent
|
| 14 |
+
- tool-calling
|
| 15 |
- function-calling
|
| 16 |
+
- agent
|
| 17 |
+
- code-generation
|
| 18 |
+
- finetuned
|
| 19 |
+
- sft
|
| 20 |
+
- text-generation
|
| 21 |
+
- merged
|
| 22 |
+
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 23 |
datasets:
|
| 24 |
- Nanthasit/SimpleToolCalling
|
| 25 |
- Nanthasit/sakthai-combined-v7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
---
|
| 27 |
|
| 28 |
# SakThai Coder Browser
|
| 29 |
|
| 30 |
+
<p align="center">
|
| 31 |
+
<strong>Browser automation agent — Qwen2.5-Coder-1.5B-Instruct fine-tuned for web interaction</strong><br/>
|
| 32 |
+
<em>Part of the <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745450b12d421c1f9f02">SakThai Model Family</a></em>
|
| 33 |
+
</p>
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
<p align="center">
|
| 36 |
+
<a href="https://huggingface.co/Nanthasit"><img src="https://img.shields.io/badge/%F0%9F%A4%97-Nanthasit-6644cc" alt="Profile"/></a>
|
| 37 |
+
<a href="https://github.com/beer-sakthai"><img src="https://img.shields.io/badge/GitHub-beer--sakthai-181717?logo=github" alt="GitHub"/></a>
|
| 38 |
+
<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>
|
| 39 |
+
<img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/>
|
| 40 |
+
<img src="https://img.shields.io/badge/task-browser%20automation-ff6b6b" alt="Task"/>
|
| 41 |
+
</p>
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
## Model Description
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
SakThai Coder Browser transforms Qwen2.5-Coder-1.5B-Instruct into a **browser automation assistant** that outputs structured `<tool_call>` XML for web interaction. It can navigate pages, click elements, type text, and extract content — designed to work with browser automation frameworks.
|
| 48 |
|
| 49 |
+
**Available actions via `<tool_call>` XML:**
|
| 50 |
+
- `browser_navigate(url)` — navigate to a URL
|
| 51 |
+
- `browser_click(element)` — click a UI element
|
| 52 |
+
- `browser_type(element, text)` — type text into a field
|
| 53 |
+
- `browser_extract()` — extract page content
|
| 54 |
|
| 55 |
+
---
|
| 56 |
|
| 57 |
+
## Quick Start
|
| 58 |
|
| 59 |
```python
|
|
|
|
| 60 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 61 |
+
import torch
|
| 62 |
|
|
|
|
|
|
|
|
|
|
| 63 |
model = AutoModelForCausalLM.from_pretrained(
|
| 64 |
+
"Nanthasit/sakthai-coder-browser",
|
| 65 |
torch_dtype=torch.bfloat16,
|
| 66 |
+
device_map="auto"
|
| 67 |
)
|
| 68 |
+
tokenizer = AutoTokenizer.from_pretrained("Nanthasit/sakthai-coder-browser")
|
| 69 |
|
| 70 |
messages = [
|
| 71 |
+
{"role": "system", "content": "You are SakThai Browser Agent. Use <tool_call> blocks to control the browser."},
|
| 72 |
{"role": "user", "content": "Search for the latest AI news and summarize the top story."},
|
| 73 |
]
|
| 74 |
+
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 75 |
+
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
|
| 76 |
+
print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
```
|
| 78 |
|
| 79 |
+
Expected output format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
```
|
| 81 |
+
<tool_call>{"name": "browser_navigate", "arguments": {"url": "https://news.google.com"}}</tool_call>
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
|
| 86 |
## Training Details
|
| 87 |
|
| 88 |
+
| Detail | Value |
|
| 89 |
+
|--------|-------|
|
| 90 |
+
| **Base model** | Qwen/Qwen2.5-Coder-1.5B-Instruct |
|
| 91 |
+
| **Method** | Full parameter fine-tuning via SFT |
|
| 92 |
+
| **Training data** | SimpleToolCalling + sakthai-combined-v7 |
|
| 93 |
+
| **Optimizer** | AdamW |
|
| 94 |
+
| **Learning rate** | 2e-5 (cosine decay) |
|
| 95 |
+
| **Context length** | 32,768 tokens |
|
| 96 |
+
| **Precision** | BF16 |
|
| 97 |
+
| **Hardware** | Free T4 GPU (Kaggle / Colab) |
|
| 98 |
|
| 99 |
+
---
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
+
## Sibling Models
|
| 102 |
|
| 103 |
+
| Variant | Repository |
|
| 104 |
+
|:--------|:-----------|
|
| 105 |
+
| **LoRA Adapter** (unmerged) | [sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) |
|
| 106 |
+
| **Merged model** (this repo) ⬅ | [sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) |
|
| 107 |
|
| 108 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
## Evaluation
|
| 111 |
|
| 112 |
+
**Benchmarks are pending.** Formal evaluation on browser automation tasks coming soon.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
---
|
| 115 |
|
| 116 |
+
*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.*
|