Skip to main content

optimal_send_dimensions

Function optimal_send_dimensions 

Source
pub fn optimal_send_dimensions(
    width: u32,
    height: u32,
    model: VisionModel,
) -> (u32, u32)
Expand description

Compute the optimal dimensions to send to a given model to minimize tiles.

For models that pre-scale images (GPT-4o, Gemini), we simulate their scaling, snap the scaled result to tile boundaries, then invert back to input space. For Claude (no pre-scaling), we snap the input directly.