Skip to main content

Module optimize

Module optimize 

Source
Expand description

Shared image optimization logic for provider route handlers.

Extracted to avoid duplication between Anthropic and OpenAI routes. The optimization runs on a blocking thread to avoid starving the tokio event loop during CPU-intensive image operations.

Functions§

optimize_payload
Run the SHIFT pipeline on a JSON payload.