Instructions to use Nanthasit/sakthai-vision-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanthasit/sakthai-vision-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Nanthasit/sakthai-vision-7b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Nanthasit/sakthai-vision-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Nanthasit/sakthai-vision-7b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Nanthasit/sakthai-vision-7b:Q4_K_M # Run inference directly in the terminal: llama cli -hf Nanthasit/sakthai-vision-7b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Nanthasit/sakthai-vision-7b:Q4_K_M # Run inference directly in the terminal: llama cli -hf Nanthasit/sakthai-vision-7b:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Nanthasit/sakthai-vision-7b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Nanthasit/sakthai-vision-7b:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Nanthasit/sakthai-vision-7b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Nanthasit/sakthai-vision-7b:Q4_K_M
Use Docker
docker model run hf.co/Nanthasit/sakthai-vision-7b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Nanthasit/sakthai-vision-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanthasit/sakthai-vision-7b" # 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-vision-7b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Nanthasit/sakthai-vision-7b:Q4_K_M
- SGLang
How to use Nanthasit/sakthai-vision-7b 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-vision-7b" \ --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-vision-7b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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-vision-7b" \ --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-vision-7b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use Nanthasit/sakthai-vision-7b with Ollama:
ollama run hf.co/Nanthasit/sakthai-vision-7b:Q4_K_M
- Unsloth Studio
How to use Nanthasit/sakthai-vision-7b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Nanthasit/sakthai-vision-7b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Nanthasit/sakthai-vision-7b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Nanthasit/sakthai-vision-7b to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Nanthasit/sakthai-vision-7b with Docker Model Runner:
docker model run hf.co/Nanthasit/sakthai-vision-7b:Q4_K_M
- Lemonade
How to use Nanthasit/sakthai-vision-7b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Nanthasit/sakthai-vision-7b:Q4_K_M
Run and chat with the model
lemonade run user.sakthai-vision-7b-Q4_K_M
List all available models
lemonade list
Image understanding + tool-use grounding for Qwen2-VL
SakThai multimodal adapter · part of the SakThai Model Family
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.
The Story Behind It
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
How You Can Help
- ⭐ Leave a like — increases visibility for free multimodal tool-use models.
- 🔄 Share it with agents needing screenshot parsing on CPU.
- 🍴 Fork it and add your own visual grounding examples.
- 💬 Report real-world screenshot or document parsing results.
Model Description
Status: actively maintained Size: ~2B parameters Languages: English, Thai, Chinese
Quick reference:
- Multimodal image-text-to-text model
- Optimized for screenshots, documents, diagrams, and tool grounding
- Runs on CPU and GPU
SakThai Vision 7B is a multimodal understanding model focused on images that need action, not just captioning. It is built for:
- Visual question answering with image context
- Screenshot parsing and structured extraction
- Tool-use grounding from image content
- Multimodal assistant-style reasoning
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.
What it is
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:
- structured UI extraction
- diagram/dense OCR reasoning where instructions are explicit
- bridging vision into tool-calling agents
Architecture
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 |
How to Use
Basic usage with Transformers (GPU)
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)
CPU-only inference (with reduced resolution)
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)
Save locally for reuse
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")
With llama.cpp (GGUF format)
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"])
Example 4: OCR-dense document
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
Hardware requirements
- Recommended: GPU with ≥6 GB VRAM for comfortable batch-1 inference (2-3 sec/image).
- CPU-only: Possible but slow (~30–60 sec/image depending on CPU); prefer small images (<512px) and
max_new_tokens ≤ 128. - Mobile/edge: GGUF quantization strongly recommended; see model card assets.
Usage Examples
Example 1: Screenshot → structured actions
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.
Example 2: Diagram Q&A
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
Example 3: Visual grounding for agents
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
Benchmarks
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.
Training Details
| 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 |
Limitations
- Parameter scale is small; complex OCR and dense diagram reasoning can be brittle.
- Best results require clear images and explicit instructions in the text prompt.
- Vision encoder is frozen; model learns to bridge vision and language only at the text-generation layer.
- Benchmarks are limited; treat reported metrics as indicative, not conclusive.
- No standalone tool-execution layer included; combine with a separate tool router for agentic use.
- Performance degrades on images > 2048px or with heavy visual occlusion.
- Not trained on images containing faces in privacy-critical contexts; use with ethical caution.
Reproduce
# 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
Model Card Metadata & Compliance
- Created: 2024 (fine-tune)
- Last Updated: 2026-08-01
- Model License: Apache 2.0
- Intended Use: Screenshot parsing, diagram understanding, tool-grounding for agents
- Recommended Use: Agents, accessible multimodal pipelines, research
- Restricted Use: Privacy-critical image analysis, surveillance, content moderation
- Code License: Apache 2.0 (example code provided)
Citation
@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}
}
Community & Support
- Issues & feedback: Open discussions on the model card or tag @Nanthasit.
- Questions? See the SakThai Model Family collection for related models.
- Zero-budget training? Check out Beer's workflow on the house repo.
Built with love, tears, and zero budget. From a shelter in Cork, Ireland, to the world.
- Downloads last month
- 337
4-bit
Model tree for Nanthasit/sakthai-vision-7b
Datasets used to train Nanthasit/sakthai-vision-7b
Nanthasit/sakthai-bench-v2
Collection including Nanthasit/sakthai-vision-7b
Evaluation results
- Screenshot Parsing Accuracy on SakThai Bench v2self-reported0.920
- Tool Grounding F1 on SakThai Bench v2self-reported0.880
- OCR-heavy Accuracy on SakThai Bench v2self-reported0.780
- Visual Q&A Accuracy on SakThai Bench v2self-reported0.840