DocsQuestions and answers
Ask about images
Ask yes/no, choice and score questions about pictures, and find an object in one with a Box question, on a Gemma 4 server started with images on.
A picture goes in the request, and the answer is the one you already read for text. This script sends one photo as a data URL and asks whether the parcel in it is damaged:
import base64import jsonimport urllib.request
with open("photo.jpg", "rb") as f: image = "data:image/jpeg;base64," + base64.b64encode(f.read()).decode()
body = { "state": "A photo of a delivered parcel.", "images": [image], "questions": {"damaged": {"type": "noul", "instructions": "Is the parcel visibly damaged?"}},}request = urllib.request.Request( "http://127.0.0.1:8000/v1/systemone", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"},)with urllib.request.urlopen(request) as response: print("damaged:", json.load(response)["answers"]["damaged"]["noul"])A shape to fill in, not a command to run.
It prints the probability that the parcel is damaged. Choice and score questions work the same way, and a Box question finds where something is in the picture.
Start a server for images
Section titled “Start a server for images”A Gemma 4 base started with --images on reads the pictures with the engine that reads its text.
There is no second engine and no second copy of the weights:
pip install "decisio[serve]==0.60.0"python -m decisio.serve.vllm_engine --base gemma-4-12b --images onNeeds Linux with one NVIDIA card.
- Gemma 4 12B, including Decisio v3 and the FP8 repositories, and Gemma 4 31B take
--images on, on the vLLM server or on a Mac. - So do Qwen3.5-4B and Decisio-mini-4b-v1, which take
--image-budgettoo, at 1120 unless set: a picture costs one token per 32 by 32 pixels, up to the budget. --images ondoes not combine with--image-model,--one-engineor--mode packed.--max-imagesis the most images one request may carry, 16 unless set.
On a Mac, the same flag works with the MLX backend and the extra mlx-images:
uv sync --extra mlx-imagesuv run python -m decisio.serve.vllm_engine --backend mlx --base gemma-4-12b --model google/gemma-4-12B-it --images onNeeds an Apple silicon Mac with room for the model.
- Google’s bf16 checkpoint has the vision weights.
An MLX conversion made for text drops them and takes the base’s vision add-on, which
--vision-weightsnames. - Box questions are not served on a Mac with a Gemma base; Decisio-mini-4b-v1 answers them there.
On Ollama, the untrained Gemma listing aminroudaki/decisio-gemma reads images through Ollama’s own images field, on Ollama 0.40.4 or later.
Ollama puts the images before the state and has no Box question.
On a Mac or a laptop has the commands.
The Qwen base serves images through a second engine instead, started with --image-model:
python -m decisio.serve.vllm_engine --base qwen3.6-35b-a3b --image-model Qwen/Qwen3.6-35B-A3B-FP8Needs Linux with one NVIDIA card.
- Its two engines’ default shares of the card fit one card together, so no memory flag is needed.
--one-engineloads only the image engine and serves text on it too, for a card that cannot hold both.- With an image engine, the longest text stays at 32,768 tokens, and a request may carry up to 128 images.
Send the images
Section titled “Send the images”An image goes where its reference stands, inside the state or inside a question, and not all at the start. A photo in the state is read by every question of the request.
A photo in a question’s instructions or criteria is read by that question alone.
Figure · Images
A picture is read where its reference stands, and only by the questions that can see it.
The state's photos sit in the part of the prompt every question shares; a question's own photo sits in that question's part only.
Four ways to send one:
| How | What it looks like |
|---|---|
A data URL in images | the list; an image no text names opens the state, and [image N] in the text places the Nth |
A data:image/... URI inside the state | the image stands where the URI stands |
An assets placeholder | {"type": "image", "format": "png", "data_base64": "..."}, named in the text, as System One sends images |
A multipart/form-data request | the JSON in request, each file in its own part |
- The image route accepts only PNG, JPEG and WebP. An animated image is refused.
- Up to 20 MB and 20 megapixels each; a request body over 32 MiB is refused with 413.
- A multipart request needs an
X-Decisio-Clientheader, any value, or it is refused with 415. - TypeSafe’s Python SDK sends images as it does to System One, with nothing added.
Ask where something is
Section titled “Ask where something is”A Box question finds an object and answers with one box, as fractions of the image, with a confidence.
Say what to find in instructions, a short noun phrase:
Figure · Box questions
A Box question answers with one box and a confidence, or the whole image at confidence 0 when the target is absent.
The edges are fractions of the image you sent. A Box always has a box, so read the confidence, or ask a yes/no question beside it.
The request:
{"state": "The photo: PHOTO", "questions": {"mug": {"type": "box", "instructions": "the turquoise mug"}}, "assets": {"PHOTO": {"type": "image", "format": "png", "data_base64": "..."}}}Needs a Gemma server started with --images on, on one NVIDIA card, and a photo of your own.
The answer:
{"mug": {"type": "box", "box": {"top": 0.31, "bottom": 0.86, "left": 0.36, "right": 0.72}, "confidence": 0.93}}It is the shape of an answer from a Gemma server started with --images on, on one NVIDIA card.
- Multiply
leftandrightby the image’s width andtopandbottomby its height to crop. - When the model says the target is absent, the answer is the whole image at
confidence0. confidenceis the probability that the target is in the picture times how sure the model is of the edges. Use it to rank and compare, not as a probability of a correct box.- To decide in code whether something is there, ask a yes/no question beside the Box and use the Box only where it says yes.
- Ask one thing per question: to find three mugs, ask for the left, the middle and the right one.
A Box question needs a Gemma server or a Decisio-mini-4b-v1 server started with --images on, on vLLM; Decisio-mini-4b-v1 answers it on a Mac too.
It is not served on a Mac with a Gemma base or by the Ollama listings.
Choose the image budget
Section titled “Choose the image budget”--image-budget is the soft tokens one image may take: 70, 140, 280, 560 or 1120.
The picture is scaled to fill it, so a bigger budget gives small objects more tokens and costs more per image.
| Model | Default budget | What to know |
|---|---|---|
| Gemma 4 12B | 560 | 1120 is refused at start: the 12B’s window is 1,024 tokens, shorter than the block |
| Gemma 4 31B | 280 | 1120 is an opt-in; the 31B reads pictures through its own vision encoder |
Figure · Image budget
A bigger budget reads a picture in more tokens: finer detail for small things, and a slower first read.
The picture is scaled to fill the budget and cut to blocks of 48 by 48 pixels; each block is one token, and a begin and an end token wrap them.
At 560 an image costs about 1.8 times the tokens of 280, and Box answers read better. A small object in a large image is found better after you crop to its region and ask again, or at a higher budget.
A first read, with the image new to the server, was a median of this many milliseconds for one image, on one RTX PRO 6000 Blackwell at 600 W, with generated 512 by 512 pictures:
| Model and budget | One image (ms) | Four images (ms) | Sixteen images (ms) |
|---|---|---|---|
| Gemma 4 12B, 280 | 85 | 202 | 727 |
| Gemma 4 12B, 560 | 117 | 353 | 1,379 |
| Gemma 4 31B, 280 | 143 | 372 | 1,426 |
| Gemma 4 31B, 1120 | 504 | 1,955 | 8,728 |
| Decisio-mini-4b-v1, 256 tokens a picture | 59 | 107 | 333 |
A second question on the same pictures reads them from the cache.
/health reports the budget in use and the budgets the base allows.
Read the probabilities
Section titled “Read the probabilities”Probabilities for a request with images are read at a temperature fitted for images. Gemma 4 31B multiplies its text temperature by 1.376, fitted on images at budget 280. Gemma 4 12B reads images at its text temperatures.
The Qwen route reads at 0.80, fitted on its layout. An adapter keeps its own temperatures, and how well a tuned model reads pictures was measured for the previous tuned 12B only: Decisio v3 was trained on text, and its pictures are not measured.
Limits
Section titled “Limits”- The 31B’s text answers can shift with images on. The 31B then serves text requests through its multimodal class too. On 100 BANKING77 questions the right answers moved from 73 to 69 at budget 280, beyond the spread between two images-off starts. A deployment that serves mostly text on the 31B can keep images off, or serve images from a separate server.
- The 12B refuses budget 1120.
- No registered task applies to a request with images: no certificate, no intent head, no fast table and no thinking when unsure.
- Box needs a vLLM server, or Decisio-mini-4b-v1 on a Mac.
It is not answered on a Mac with a Gemma base, by the Ollama listings or on the
--image-modelroute. - The Qwen route’s figures were measured on its earlier layout.
--image-prompt legacykeeps that layout, is deprecated, and a later release removes it. - Generated scenes are easier than photographs. Measure your own pictures before you rely on a figure.
What next
Section titled “What next”- Server flags: every flag of the image engines.
- The HTTP API: the images field, the multipart form and the System One
assetsfield. - Requirements and limits: what was measured on what.
- Release notes: what changed in each release.
- Images on Gemma 4: how a request’s images reach the prompt, who sees them and where the cache ends, for anyone who wants the design.