In my last post, I mentioned
Gemma 4 supports multiple visual token budgets:
- 70
- 140
- 280
- 560
- 1120
Use them like this:
- 70 / 140: classification, captioning, fast video understanding
- 280 / 560: general multimodal chat, charts, screens, UI reasoning
- 1120: OCR, document parsing, handwriting, small text
So our max is actually 1120 here. So for my case, Im going to want to set the --image-min-tokens and --image-max-tokens both 1120, and then I'll buffer up the batch and ubatch to 2048.
./llama-server -ngl 200 --ctx-size 65535 --models-dir /Users/socg/models --models-max 1 --port 5001 --host 0.0.0.0 --jinja --image-min-tokens 1120 --image-max-tokens 1120 --ubatch-size 2048 --batch-size 2048
SOCIAL SHARE CARD GENERATOR