Image-Text-to-Text
Transformers
Safetensors
gemma4
computer-use
gui-agent
gui-grounding
visual-grounding
slot-reading
conversational
Instructions to use infinitylogesh/GUI-Decisions-31B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use infinitylogesh/GUI-Decisions-31B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="infinitylogesh/GUI-Decisions-31B") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("infinitylogesh/GUI-Decisions-31B") model = AutoModelForMultimodalLM.from_pretrained("infinitylogesh/GUI-Decisions-31B", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use infinitylogesh/GUI-Decisions-31B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "infinitylogesh/GUI-Decisions-31B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "infinitylogesh/GUI-Decisions-31B", "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/infinitylogesh/GUI-Decisions-31B
- SGLang
How to use infinitylogesh/GUI-Decisions-31B 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 "infinitylogesh/GUI-Decisions-31B" \ --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": "infinitylogesh/GUI-Decisions-31B", "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 "infinitylogesh/GUI-Decisions-31B" \ --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": "infinitylogesh/GUI-Decisions-31B", "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 infinitylogesh/GUI-Decisions-31B with Docker Model Runner:
docker model run hf.co/infinitylogesh/GUI-Decisions-31B
Use: vLLM first
Browse files
README.md
CHANGED
|
@@ -32,23 +32,84 @@ real distribution over the screen.
|
|
| 32 |
|
| 33 |
## Use
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
```bash
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
```
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
```python
|
| 40 |
from PIL import Image
|
| 41 |
from slotread.local import LocalSlotModel
|
| 42 |
|
| 43 |
m = LocalSlotModel.from_pretrained("infinitylogesh/GUI-Decisions-31B")
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
box = m.box(Image.open("photo.jpg"), "the red frisbee") # [x1, y1, x2, y2] in [0, 1]
|
| 47 |
```
|
| 48 |
|
| 49 |
-
For speed, serve it on vLLM and read the slots with per-slot `logprob_token_ids` requests
|
| 50 |
-
(`slotread.client`, `serving/` in the code repository; vLLM serves this folder as a plain model): ~146 ms per step on one RTX PRO 6000 (NVFP4 base).
|
| 51 |
-
|
| 52 |
## Results
|
| 53 |
|
| 54 |
This merged model in bf16 with transformers (`slotread.local`), against the published evaluation of the
|
|
|
|
| 32 |
|
| 33 |
## Use
|
| 34 |
|
| 35 |
+
### With vLLM
|
| 36 |
+
|
| 37 |
+
Served in bf16 on one RTX PRO 6000 a computer-use step takes **190 ms** (median over 60 cold screenshots).
|
| 38 |
+
[The LoRA on the NVFP4 base](https://huggingface.co/infinitylogesh/GUI-Decisions-31B-LoRA) is faster
|
| 39 |
+
(152 ms) and keeps the base model for text steps; use this merged model when you want one plain
|
| 40 |
+
checkpoint.
|
| 41 |
+
|
| 42 |
+
**1. Install** vLLM 0.30 and the reader (`slotread`, from the code repository):
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
git clone https://github.com/infinitylogesh/gui-decisions && cd gui-decisions
|
| 46 |
+
pip install "vllm==0.30.*" -e .
|
| 47 |
+
bash serving/patch_vllm.sh # recommended: 256 label ids per request
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
**2. Serve** (bf16, 62 GB of weights: one 80–96 GB GPU):
|
| 51 |
+
|
| 52 |
```bash
|
| 53 |
+
vllm serve infinitylogesh/GUI-Decisions-31B --served-model-name gui-decisions --port 8001 \
|
| 54 |
+
--max-model-len 8192 --gpu-memory-utilization 0.85 --max-logprobs 300 --enable-prefix-caching \
|
| 55 |
+
--mm-processor-cache-gb 0 --api-server-count 8
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
**3. Read** steps and boxes:
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from PIL import Image
|
| 62 |
+
from slotread.client import SlotModel
|
| 63 |
+
|
| 64 |
+
m = SlotModel("gui-decisions", "infinitylogesh/GUI-Decisions-31B") # server: VLLM_URL, default http://127.0.0.1:8001
|
| 65 |
+
step = m.decide(Image.open("screenshot.png"), "turn on dark mode") # {'action': 'click', 'x': 0.928, 'y': 0.247, 'ms': 190.0}
|
| 66 |
+
box = m.box(Image.open("photo.jpg"), "the red frisbee") # {'box': [x1, y1, x2, y2], 'ms': ...}, in [0, 1]
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
`decide` reads `action`, `x` and `y` first, then only the slots the action needs (`key` for press, `sdir`
|
| 70 |
+
and `samt` for scroll, `x2` and `y2` for swipe). `x` and `y` are fractions of the screenshot's width and
|
| 71 |
+
height. For type / answer steps, serve the base model as well and pass its name as `text_model=` (the
|
| 72 |
+
merged weights only answer slots).
|
| 73 |
+
|
| 74 |
+
**What a read is.** For each slot, `SlotModel` sends one chat request whose assistant turn is prefilled up
|
| 75 |
+
to that slot, and asks vLLM for the log-probabilities of exactly that slot's labels; nothing is generated
|
| 76 |
+
beyond one token. The requests for one step run in parallel and share the image through vLLM's prefix cache:
|
| 77 |
+
|
| 78 |
+
```json
|
| 79 |
+
{"model": "gui-decisions",
|
| 80 |
+
"messages": [{"role": "system", "content": [{"type": "text", "text": "<the task's system prompt, from slotread_config.json>"}]},
|
| 81 |
+
{"role": "user", "content": [{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}},
|
| 82 |
+
{"type": "text", "text": "Please generate the next move according to the UI screenshot, instruction and previous actions.\n\nInstruction: turn on dark mode\n\nPrevious actions:\nNone"}]},
|
| 83 |
+
{"role": "assistant", "content": [{"type": "text", "text": "action: ___ x:"}]}],
|
| 84 |
+
"add_generation_prompt": false, "continue_final_message": true, "chat_template_kwargs": {"enable_thinking": false},
|
| 85 |
+
"max_tokens": 1, "temperature": 0, "logprobs": true, "top_logprobs": 1, "return_tokens_as_token_ids": true,
|
| 86 |
+
"logprob_token_ids": ["<the 256 label ids of slot x, from slotread_config.json>"]}
|
| 87 |
```
|
| 88 |
|
| 89 |
+
The slot's answer is the softmax over those labels: the argmax for `action`; for a coordinate, the argmax
|
| 90 |
+
bin refined by its ±2 neighbours (bin *k* of 256 is the value (*k* + 0.5) / 256 across the screen).
|
| 91 |
+
|
| 92 |
+
Notes:
|
| 93 |
+
|
| 94 |
+
- `patch_vllm.sh` raises vLLM's per-request `logprob_token_ids` cap from 128 to 256, so a 256-bin slot is
|
| 95 |
+
one request. Without it, set `MAX_LABEL_IDS=128` for the client (each coordinate then takes two requests).
|
| 96 |
+
- `--api-server-count 8`: a single API-server process serializes a step's parallel slot requests.
|
| 97 |
+
`--mm-processor-cache-gb 0`: vLLM 0.30's media cache raced on concurrent requests for the same image.
|
| 98 |
+
- Screenshots go as JPEG at the model's input size (896 × 896 pixels' worth), the fast path. For tiny
|
| 99 |
+
targets send lossless full-size images instead (`IMG_FMT=png IMG_MAX_PX=0`), as the evaluations did.
|
| 100 |
+
- `previous` takes the earlier steps as numbered lines, e.g. `"1. click(One way)\n2. click(From)"`.
|
| 101 |
+
|
| 102 |
+
### In-process with transformers (no server)
|
| 103 |
+
|
| 104 |
```python
|
| 105 |
from PIL import Image
|
| 106 |
from slotread.local import LocalSlotModel
|
| 107 |
|
| 108 |
m = LocalSlotModel.from_pretrained("infinitylogesh/GUI-Decisions-31B")
|
| 109 |
+
step = m.decide(Image.open("screenshot.png"), "turn on dark mode")
|
| 110 |
+
box = m.box(Image.open("photo.jpg"), "the red frisbee")
|
|
|
|
| 111 |
```
|
| 112 |
|
|
|
|
|
|
|
|
|
|
| 113 |
## Results
|
| 114 |
|
| 115 |
This merged model in bf16 with transformers (`slotread.local`), against the published evaluation of the
|