[{"data":1,"prerenderedAt":547},["ShallowReactive",2],{"navigation":3,"\u002Fguides\u002Ftoken-budget":113,"\u002Fguides\u002Ftoken-budget-surround":544},[4,23,44,87],{"title":5,"path":6,"stem":7,"children":8,"icon":22},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Install VisionSqueezer (npm, cargo, pip)","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"MCP Setup","\u002Fgetting-started\u002Fmcp-setup","1.getting-started\u002F3.mcp-setup","i-lucide-plug","i-lucide-rocket",{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":43},"CLI","i-lucide-terminal","\u002Fcli","2.cli",[29,33,38],{"title":30,"path":31,"stem":32,"icon":25},"CLI Usage — Optimize Images for Vision LLMs","\u002Fcli\u002Fusage","2.cli\u002F1.usage",{"title":34,"path":35,"stem":36,"icon":37},"CLI Options Reference","\u002Fcli\u002Foptions","2.cli\u002F2.options","i-lucide-sliders-horizontal",{"title":39,"path":40,"stem":41,"icon":42},"Batch Mode and JSON Output","\u002Fcli\u002Fbatch-json","2.cli\u002F3.batch-json","i-lucide-package",false,{"title":45,"icon":46,"path":47,"stem":48,"children":49,"page":43},"Providers","i-lucide-cpu","\u002Fproviders","3.providers",[50,55,60,65,70,74,78,83],{"title":51,"path":52,"stem":53,"icon":54},"Claude (Patch-Based)","\u002Fproviders\u002Fclaude","3.providers\u002F1.claude","i-lucide-square",{"title":56,"path":57,"stem":58,"icon":59},"OpenAI GPT-6 \u002F GPT-5.6","\u002Fproviders\u002Fgpt","3.providers\u002F2.gpt","i-lucide-grid-2x2",{"title":61,"path":62,"stem":63,"icon":64},"Gemini (Large Tiles)","\u002Fproviders\u002Fgemini","3.providers\u002F3.gemini","i-lucide-grid-3x3",{"title":66,"path":67,"stem":68,"icon":69},"Llama Vision (Tiles)","\u002Fproviders\u002Fllama","3.providers\u002F4.llama","i-simple-icons-meta",{"title":71,"path":72,"stem":73,"icon":64},"Qwen-VL (Patch Grid)","\u002Fproviders\u002Fqwen","3.providers\u002F5.qwen",{"title":75,"path":76,"stem":77,"icon":59},"DeepSeek Flash + DeepSeek-VL2","\u002Fproviders\u002Fdeepseek","3.providers\u002F6.deepseek",{"title":79,"path":80,"stem":81,"icon":82},"Kimi Vision","\u002Fproviders\u002Fkimi","3.providers\u002F7.kimi","i-lucide-sparkles",{"title":84,"path":85,"stem":86},"Popular multimodal model catalog","\u002Fproviders\u002Fcatalog","3.providers\u002F8.catalog",{"title":88,"icon":89,"path":90,"stem":91,"children":92,"page":43},"Guides","i-lucide-book-open","\u002Fguides","4.guides",[93,98,103,108],{"title":94,"path":95,"stem":96,"icon":97},"Python Bindings","\u002Fguides\u002Fpython-bindings","4.guides\u002F1.python-bindings","i-lucide-file-code",{"title":99,"path":100,"stem":101,"icon":102},"Sandbox (Think in Code)","\u002Fguides\u002Fsandbox","4.guides\u002F2.sandbox","i-lucide-flask-conical",{"title":104,"path":105,"stem":106,"icon":107},"Crawler Integration","\u002Fguides\u002Fcrawler-integration","4.guides\u002F3.crawler-integration","i-lucide-globe",{"title":109,"path":110,"stem":111,"icon":112},"Token Budget for Vision LLM Images","\u002Fguides\u002Ftoken-budget","4.guides\u002F4.token-budget","i-lucide-gauge",{"id":114,"title":109,"body":115,"description":537,"extension":538,"links":539,"meta":540,"navigation":541,"path":110,"seo":542,"stem":111,"__hash__":543},"docs\u002F4.guides\u002F4.token-budget.md",{"type":116,"value":117,"toc":531},"minimark",[118,136,141,219,226,237,285,289,296,443,446,450,478,482,527],[119,120,121,122,126,127,131,132,135],"p",{},"Providers bill images by ",[123,124,125],"strong",{},"pixel dimensions",", not file size. A 12 MP photo and its 1 MB JPEG cost the same tokens unless the pixels change. The token budget is the knob that changes them: ",[128,129,130],"code",{},"--max-tokens N"," downscales the image until the target model's token estimate fits inside ",[128,133,134],{},"N",".",[137,138,140],"h2",{"id":139},"defaults","Defaults",[142,143,144,160],"table",{},[145,146,147],"thead",{},[148,149,150,154,157],"tr",{},[151,152,153],"th",{},"Surface",[151,155,156],{},"Default",[151,158,159],{},"Disable",[161,162,163,187,200],"tbody",{},[148,164,165,177,182],{},[166,167,168,169,172,173,176],"td",{},"MCP server (",[128,170,171],{},"optimize_image",", ",[128,174,175],{},"optimize_image_batch",")",[166,178,179],{},[128,180,181],{},"1600",[166,183,184],{},[128,185,186],{},"max_tokens: 0",[148,188,189,191,194],{},[166,190,24],{},[166,192,193],{},"no cap",[166,195,196,197],{},"omit ",[128,198,199],{},"--max-tokens",[148,201,202,208,210],{},[166,203,204,205,176],{},"Rust crate (",[128,206,207],{},"ProcessConfig::max_tokens",[166,209,193],{},[166,211,212,215,216],{},[128,213,214],{},"None"," or ",[128,217,218],{},"0",[119,220,221,222,225],{},"The Python bindings do not expose ",[128,223,224],{},"max_tokens"," yet.",[119,227,228,229,232,233,236],{},"The budget is measured with ",[128,230,231],{},"--model"," (",[128,234,235],{},"target_model"," in MCP). With no target it uses Claude's 28px patch estimate.",[238,239,244],"pre",{"className":240,"code":241,"language":242,"meta":243,"style":243},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","vision-squeezer screenshot.png --max-tokens 1600\nvision-squeezer photo.jpg --max-tokens 1000 --model gpt6\n","bash","",[128,245,246,266],{"__ignoreMap":243},[247,248,251,255,259,262],"span",{"class":249,"line":250},"line",1,[247,252,254],{"class":253},"sBMFI","vision-squeezer",[247,256,258],{"class":257},"sfazB"," screenshot.png",[247,260,261],{"class":257}," --max-tokens",[247,263,265],{"class":264},"sbssI"," 1600\n",[247,267,269,271,274,276,279,282],{"class":249,"line":268},2,[247,270,254],{"class":253},[247,272,273],{"class":257}," photo.jpg",[247,275,261],{"class":257},[247,277,278],{"class":264}," 1000",[247,280,281],{"class":257}," --model",[247,283,284],{"class":257}," gpt6\n",[137,286,288],{"id":287},"what-it-saves","What it saves",[119,290,291,292,295],{},"Measured with ",[128,293,294],{},"vision-squeezer \u003Cimage> --dry-run --json",". Token counts are the tool's estimates from each provider's documented rules, not live API invoices.",[142,297,298,320],{},[145,299,300],{},[148,301,302,305,308,311,314,317],{},[151,303,304],{},"Image",[151,306,307],{},"Run",[151,309,310],{},"Claude 4.7+ tokens",[151,312,313],{},"GPT-6 tokens",[151,315,316],{},"Gemini tokens",[151,318,319],{},"File size",[161,321,322,342,363,384,403,423],{},[148,323,324,327,330,333,336,339],{},[166,325,326],{},"2400×1670 photo",[166,328,329],{},"no budget",[166,331,332],{},"4,674 → 4,070 (−13%)",[166,334,335],{},"2,903 → 2,942",[166,337,338],{},"3,096 → 1,548 (−50%)",[166,340,341],{},"−29%",[148,343,344,346,351,354,357,360],{},[166,345,326],{},[166,347,348],{},[128,349,350],{},"--max-tokens 1600",[166,352,353],{},"4,674 → 1,584 (−66%)",[166,355,356],{},"2,903 → 1,462 (−50%)",[166,358,359],{},"3,096 → 1,032 (−67%)",[166,361,362],{},"−67%",[148,364,365,367,372,375,378,381],{},[166,366,326],{},[166,368,369],{},[128,370,371],{},"--max-tokens 1000",[166,373,374],{},"4,674 → 988 (−79%)",[166,376,377],{},"2,903 → 939 (−68%)",[166,379,380],{},"3,096 → 516 (−83%)",[166,382,383],{},"−79%",[148,385,386,389,391,394,397,400],{},[166,387,388],{},"4096×3072 photo",[166,390,329],{},[166,392,393],{},"4,661 → 4,698",[166,395,396],{},"2,942 → 2,924 (−1%)",[166,398,399],{},"6,192 → 5,160 (−17%)",[166,401,402],{},"−40%",[148,404,405,407,411,414,417,420],{},[166,406,388],{},[166,408,409],{},[128,410,350],{},[166,412,413],{},"4,661 → 1,564 (−66%)",[166,415,416],{},"2,942 → 1,476 (−50%)",[166,418,419],{},"6,192 → 1,032 (−83%)",[166,421,422],{},"−88%",[148,424,425,427,431,434,437,440],{},[166,426,388],{},[166,428,429],{},[128,430,371],{},[166,432,433],{},"4,661 → 999 (−79%)",[166,435,436],{},"2,942 → 951 (−68%)",[166,438,439],{},"6,192 → 516 (−92%)",[166,441,442],{},"−92%",[119,444,445],{},"Without a budget, tokens barely move: providers already downscale oversized images themselves, so a squeezed file is smaller but the bill is the same. File size is a side effect, not the goal.",[137,447,449],{"id":448},"choosing-a-budget","Choosing a budget",[451,452,453,460,466,472],"ul",{},[454,455,456,459],"li",{},[123,457,458],{},"1600 (default)."," Keeps composition, colour, and large text. In testing, a 2880×1800 code-and-error screenshot stayed fully legible at 1600, including red error highlights.",[454,461,462,465],{},[123,463,464],{},"1000."," Body text stayed readable in the same screenshot. Distant signs and small print start to blur.",[454,467,468,471],{},[123,469,470],{},"Around 600."," Small text breaks up. Use it only for images where layout matters more than text.",[454,473,474,477],{},[123,475,476],{},"Fine detail goes first."," Distant windows, crowds, and thin lines are lost before large shapes and colours.",[137,479,481],{"id":480},"things-to-know","Things to know",[451,483,484,494,510,516],{},[454,485,486,489,490,493],{},[123,487,488],{},"The budget follows the target model's own grid."," ",[128,491,492],{},"--model gemini --max-tokens 1600"," lands on Gemini's 768px tile grid (1,548 tokens), which is large for Claude. Match the budget model to the model that will read the image.",[454,495,496,489,499,502,503,506,507,135],{},[123,497,498],{},"Colour is preserved.",[128,500,501],{},"auto"," mode behaves like ",[128,504,505],{},"standard",". Black-and-white output only happens with an explicit ",[128,508,509],{},"mode: ocr",[454,511,512,515],{},[123,513,514],{},"Aspect ratio is preserved."," The image is scaled uniformly and the few leftover pixels are cropped evenly from the edges. Coarse tile grids (for example Llama's 560px) can still stretch.",[454,517,518,524,525,135],{},[123,519,520,523],{},[128,521,522],{},"--max-tiles"," is a different unit."," It counts the target model's own tiles or patches. Prefer ",[128,526,199],{},[528,529,530],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":243,"searchDepth":250,"depth":268,"links":532},[533,534,535,536],{"id":139,"depth":268,"text":140},{"id":287,"depth":268,"text":288},{"id":448,"depth":268,"text":449},{"id":480,"depth":268,"text":481},"Cut vision token cost with --max-tokens. Downscale images until the target model's estimate fits, with measured Claude, GPT-6, and Gemini savings.","md",null,{},{"icon":112},{"title":109,"description":537},"7gv3VZwbdKilNID0CAr1gQoB0QqihkIX45k-bfPCFlg",[545,539],{"title":104,"path":105,"stem":106,"description":546,"icon":107,"children":-1},"Automate token optimization for high-scale web scraping with Firecrawl, Crawl4AI, and Playwright.",1790809357363]