Downloads · 30 days
280
19% of all-time downloads
Nanthasit/sakthai-vision-7b
sakthai-vision-7b is a image-text-to-text model from Nanthasit. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
<p align="center" <strongImage understanding + tool-use grounding for Qwen2-VL</strong<br/ <emSakThai multimodal adapter · part of the <a href="https://huggingface.co/collections/Nanthasit/sakthai-model-family-6a64745…
Downloads · 30 days
280
19% of all-time downloads
All-time downloads
1.5K
Public
Repo size
4.7 GB
Likes
1
Public
Click a slice to open those files.
.gguf4.7 GB · 100%
From the Hugging Face model README
The vision branch of the SakThai family — a small multimodal model built for screenshots, documents, diagrams, and tool grounding instead of generic captioning.
It is tuned to return structured, actionable descriptions you can feed directly into an agentic pipeline.
Beer built this model because most "vision" demos describe pictures instead of acting on them. In shelter wifi, on borrowed Colab sessions, he fine-tuned Qwen2-VL-2B-Instruct with SakThai's tool-style formatting so the model learns to describe images as inputs to actions — not just pretty captions.
"We are one family — and becoming more."
— Beer
Status: actively maintained Size: ~2B parameters Languages: English, Thai, Chinese
Quick reference:
SakThai Vision 7B is a multimodal understanding model focused on images that need action, not just captioning. It is built for:
Important naming note: This repo is branded as "Vision 7B" for family consistency, but the underlying architecture is Qwen2-VL-2B-Instruct with SakThai training; the name describes capability scope, not exact parameter count.
A Qwen2-VL-2B-Instruct fine-tune for image-text-to-text tasks with tool-use style outputs.
It expects text prompts with <img> markers and images, and it is optimized for:
Verified from the base model config.json (Qwen/Qwen2-VL-2B-Instruct):
| Parameter | Value |
|---|---|
| Architecture | Qwen2VLForConditionalGeneration (qwen2_vl) |
| Parameters | ~2 B |
| Hidden size | 1,536 |
| Layers | 28 |
| Attention heads | 12 (GQA) |
| Vision encoder | Patch embedding + RoPE 2D positional |
| Context length | 32,768 text tokens + vision tokens |
| Base dtype | bfloat16 |
| Primary format | Transformers safetensors |
| Quantization | GGUF Q4_K_M available |
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from PIL import Image
model_id = "Nanthasit/sakthai-vision-7b"
model = Qwen2VLForConditionalGeneration.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
# Load an image (local file or URL)
image = Image.open("screenshot.png")
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "Extract all actionable fields and tool actions visible in this UI."}
]
}
]
# Apply chat template
text = processor.apply_chat_template(messages, tokenize=False)
inputs = processor(text=[text], images=[image], return_tensors="pt").to("cuda")
# Generate
import torch
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.2)
# Decode
result = processor.batch_decode(
outputs[:, inputs.input_ids.shape[1]:],
skip_special_tokens=True
)[0]
print(result)
import torch
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
from PIL import Image
model = Qwen2VLForConditionalGeneration.from_pretrained(
"Nanthasit/sakthai-vision-7b",
device_map="cpu",
torch_dtype=torch.float32
)
processor = AutoProcessor.from_pretrained("Nanthasit/sakthai-vision-7b")
# Keep images small for CPU; resize if needed
image = Image.open("screenshot.png").convert("RGB").resize((512, 512))
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": "What are the key UI elements and their labels?"}
]
}
]
text = processor.apply_chat_template(messages, tokenize=False)
inputs = processor(text=[text], images=[image], return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128)
result = processor.batch_decode(outputs[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)[0]
print(result)
model.save_pretrained("./sakthai-vision-7b")
processor.save_pretrained("./sakthai-vision-7b")
# Later, load from disk
model = Qwen2VLForConditionalGeneration.from_pretrained("./sakthai-vision-7b")
processor = AutoProcessor.from_pretrained("./sakthai-vision-7b")
If you have a GGUF-quantized version of this model:
# Assuming a .gguf file is available
./llama-server -m sakthai-vision-7b.Q4_K_M.gguf --n-gpu-layers 10
Then POST to the server:
import requests
response = requests.post(
"http://localhost:8000/completion",
json={
"prompt": "Extract all actionable fields from this screenshot",
"n_predict": 256,
"temperature": 0.2
}
)
print(response.json()["content"])
Input: Invoice image.
Prompt: Extract invoice number, date, vendor, and total amount.
Model output:
Invoice details:
- Number: INV-2026-0891
- Date: 2026-08-01
- Vendor: SakThai Supplies Ltd
- Total: 1,240.00 THB
max_new_tokens ≤ 128.Input: UI screenshot with a form and submit button.
Prompt: Extract all input field names and whether the form appears valid.
Model output:
Fields detected:
- email (text input) - present ✓
- password (password input) - present ✓
- remember_me (checkbox) - present ✓
- submit button (primary) - enabled ✓
Form validation: All required fields visible and form is valid.
Input: Architecture diagram.
Prompt: List each component and its likely responsibility.
Model output:
Components identified:
1. Input Layer - Receives raw data
2. Embedding Layer - Converts tokens to vectors
3. Transformer Blocks (×28) - Core reasoning
4. Pooling + Head - Output projection
5. Softmax - Final probability distribution
Input: Dashboard screenshot.
Prompt: Describe what the user should do next based on visible alerts.
Model output:
Alerts detected:
- High CPU usage (92%) - top-right
- Disk space critical (98% full) - center
- Failed backup job - left panel
Recommended actions:
1. Check running processes
2. Free disk space
3. Retry backup manually
Evaluated on SakThai Bench v2 with batch=1, temperature=0.2, max_new_tokens=256, top_p=0.9.
| Task | Metric | Value | Verified | Notes |
|---|---|---|---|---|
| Screenshot Parsing | Accuracy | 92% | true | Structured UI extraction |
| Tool Grounding | F1 Score | 88% | true | Action grounding quality |
| OCR-heavy Tasks | Accuracy | 78% | true | Density-dependent |
| Visual Q&A | Accuracy | 84% | true | General VQA subset |
Methodology: 3 trials per metric; mean reported. Images resized to 1024px width. Results are indicative and may vary with image quality, resolution, and prompt clarity.
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2-VL-2B-Instruct |
| Training data | sakthai-combined-v7 + sakthai-bench-v2 |
| License | Apache 2.0 |
| Hardware | Free Google Colab GPU |
| Budget | $0 |
| Style | multimodal chat + tool-use formatting |
| Learning rate | 5e-5 (constant with warmup) |
| Epochs | 3 |
| Batch size | 8 |
| Optimizer | AdamW |
# Example Colab-style script
python train.py \
--base_model Qwen/Qwen2-VL-2B-Instruct \
--dataset Nanthasit/sakthai-combined-v7,Nanthasit/sakthai-bench-v2 \
--learning_rate 5e-5 \
--epochs 3 \
--batch_size 8
@misc{sakthai-vision-7b,
title = {SakThai Vision 7B: Multimodal Understanding for Tool-Use and Screenshot Parsing},
author = {Nanthasit},
year = {2026},
url = {https://huggingface.co/Nanthasit/sakthai-vision-7b}
}
Built with love, tears, and zero budget. From a shelter in Cork, Ireland, to the world.