60% Fable cost cut by converting code to images and having the model OCR it
The pxpipe tool, created by developer teamchong and shared on GitHub, claims to cut AI inference costs by 60% by converting code into images and having the model perform OCR on those images. The approach is based on the observation that vision-language models can read code from screenshots more efficiently than processing raw text. The tool is designed to work with existing AI models that support image inputs, effectively treating code as a visual medium. The 60% cost reduction is attributed to the lower token count when processing images compared to raw code text, as models often charge per token. The project is open-source and available on GitHub, with the repository named teamchong/pxpipe. The exact models or APIs that benefit from this technique are not specified in the source text, but the concept applies to any vision-language model that can perform OCR on code screenshots.
Developers can reduce AI inference costs by converting code to images for OCR-based processing.