Instructions to use mustafaah/ScreenHighlighterRL-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mustafaah/ScreenHighlighterRL-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="mustafaah/ScreenHighlighterRL-2B") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("mustafaah/ScreenHighlighterRL-2B") model = AutoModelForMultimodalLM.from_pretrained("mustafaah/ScreenHighlighterRL-2B", device_map="auto") 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?"} ] }, ] inputs = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mustafaah/ScreenHighlighterRL-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mustafaah/ScreenHighlighterRL-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mustafaah/ScreenHighlighterRL-2B", "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/mustafaah/ScreenHighlighterRL-2B
- SGLang
How to use mustafaah/ScreenHighlighterRL-2B 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 "mustafaah/ScreenHighlighterRL-2B" \ --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": "mustafaah/ScreenHighlighterRL-2B", "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 "mustafaah/ScreenHighlighterRL-2B" \ --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": "mustafaah/ScreenHighlighterRL-2B", "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" } } ] } ] }' - Docker Model Runner
How to use mustafaah/ScreenHighlighterRL-2B with Docker Model Runner:
docker model run hf.co/mustafaah/ScreenHighlighterRL-2B
ScreenHighlighterRL 2B
A screenshot and a request in; coloured bounding boxes out. The model highlights relevant content while the person stays in control. No clicking, typing, external OCR or inspection tools.
Full merged BF16 weights: final SFT + GRPO optimizer update 200, ready to load without PEFT or a separate adapter.
Get started / Chrome extension · Research article and 300-case viewer
Use
Install the community repository and run python -m screenhighlighter.server --model 2b. It downloads this release and serves the Chrome extension over localhost. See the repository for CUDA setup, a standalone screenshot command, remote-GPU tunnelling and memory options.
For direct Transformers use, load AutoProcessor and Qwen3VLForConditionalGeneration from mustafaah/ScreenHighlighterRL-2B. Use the exact system_prompt.txt, send one image and the instruction, and decode one completion with do_sample=False, max_new_tokens=1024. Use min_pixels=262144, max_pixels=1048576 and preserve image aspect ratio.
Output is {"op":"highlight","targets":[["yellow",x0,y0,x1,y1]]}. Coordinates are normalized to 0–1000 relative to the full original screenshot. Colours: yellow, green, blue, pink, purple, orange, red, white. Empty targets means no matches. White is an opaque mask.
Training and evaluation
800 SFT screenshots, 2,000 GRPO screenshots, 150 validation and 300 test cases; frozen vision tower, rank-32 / alpha-64 LoRA; 200 optimizer updates, 40 requests × 8 candidates/update, four 96 GB RTX PRO 6000 GPUs. Reward is deterministic same-colour one-to-one matching with boundary-tolerant precision/recall F1. Source adapter test reward: 0.519322. This is a geometric reward, not accuracy. These scores precede BF16 merging; no claim of a fresh merged-model benchmark.
Provenance and limits
See release-provenance.json, merge-validation.json and SHA256SUMS.json. BF16 adapter merging can slightly change outputs. The 2B merge was previously validated and is copied from pinned revision 19ae0731432822da915b5992104a2e50fed6f823; 4B merge includes tensor and logit checks. The model can miss or misidentify content. It sees only visible pixels; verify selections before consequential decisions. On-screen content is untrusted input.
Base model weights are Apache-2.0; retain Qwen's attribution. Screenshot examples retain their respective source rights. Author: Mustafa Hussain.
- Downloads last month
- 40