How to use from the
Use from the
PEFT library
from peft import PeftModel
from transformers import AutoModelForCausalLM

base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
model = PeftModel.from_pretrained(base_model, "Nanthasit/sakthai-coder-browser-lora")

LoRA adapter for browser-automation agent training — Qwen2.5-Coder-1.5B-Instruct
Part of the SakThai Model Family

Profile GitHub Collection License Task Base Model Downloads

Model Description

sakthai-coder-browser-lora is a LoRA adapter that teaches Qwen/Qwen2.5-Coder-1.5B-Instruct to act as a browser-automation agent. It is trained to emit structured tool calls for web navigation tasks, including click, scroll, search, extract, and form interaction. This repo does not include the base model weights; merge it onto the base model before inference.

Models in this family

Model Type Notes
sakthai-coder-browser Merged GGUF / Transformers Production browser agent weights
sakthai-coder-1.5b Base/finetuned General code agent
sakthai-context-1.5b-tools-v2 Tools variant Tool-calling focused sibling
sakthai-context-0.5b-tools Compact tools Small footprint tool agent
sakthai-plus-1.5b-lora LoRA Merger + code variant

Training Details

  • Base model: Qwen/Qwen2.5-Coder-1.5B-Instruct
  • Adapter type: LoRA
  • LoRA config: r=16, alpha=32, dropout=0.05, rslora=true
  • Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Datasets: sakthai-combined-v8, sakthai-combined-v11, irrelevance-supplement, cycle-bench
  • Trainer: TRL SFT
  • License: apache-2.0

Usage

Merge with PEFT

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = "Qwen/Qwen2.5-Coder-1.5B-Instruct"
adapter = "Nanthasit/sakthai-coder-browser-lora"

tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
model = model.merge_and_unload()  # optional; or keep adapter separate for switching

Inference with Ollama

ollama create sakthai-coder-browser-lora -f ./Modelfile
# Adapter runtime merge depends on backend support; prefer merged sibling for Ollama.

Inference with llama.cpp GGUF

# Preferred zero-cost local inference:
ollama run nanthasit/sakthai-coder-browser-gguf

Inference with Hugging Face InferenceClient

from huggingface_hub import InferenceClient

client = InferenceClient(model="Nanthasit/sakthai-coder-browser")
out = client.chat_completion(
    messages=[{"role": "user", "content": "Extract all H2 headings from https://example.com"}],
    max_tokens=256,
    temperature=0.3,
)
print(out.choices[0].message.content)

Reproducing Evaluation

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct", device_map="auto")
model = PeftModel.from_pretrained(base, "Nanthasit/sakthai-coder-browser-lora")
model = model.merge_and_unload()
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")

prompt = "<tools>...</tools>\nUser: Search HuggingFace for DeepSeek V4 Flash"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
print(tokenizer.decode(model.generate(**inputs, max_new_tokens=256)[0], skip_special_tokens=True))

Inference Tips

  • Prefer merged weights (sakthai-coder-browser) for browser tasks.
  • Use low temperature (0.1–0.3) to reduce hallucinated tool names.
  • Always wrap function specs inside <tools> XML for reliable structured output.

Limitations

  • Adapter-only repo: cannot benchmark standalone; always merge onto the base model.
  • Web task success depends on DOM complexity and instruction phrasing.
  • Tool-calling accuracy drops on multi-step plans longer than 5 actions.
  • CPU inference is usable but slow; prefer GPU/TGI or llama.cpp GGUF for production.

Citation

@misc{sakthai-coder-browser-lora,
  title  = {SakThai Coder Browser LoRA},
  author = {Nanthasit},
  year   = {2026},
  url    = {https://huggingface.co/Nanthasit/sakthai-coder-browser-lora}
}
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-coder-browser-lora

Adapter
(139)
this model

Datasets used to train Nanthasit/sakthai-coder-browser-lora

Collection including Nanthasit/sakthai-coder-browser-lora

Evaluation results