Recently, my wife joined a church choir and needed to practice new songs. The music came in booklets printed on yellow paper. She scanned them as a PDF to remove the color and reprint them larger on standard paper. However, raw black-and-white printing wasted ink and created a gray background that confused her sheet music playback app, PlayScore 2.
Initially, I suggested using Photoshop to remove the background, but the process was too tedious as each image required distinct slider adjustments. We then tried prompting ChatGPT Plus directly to replace the background. While it worked, the output was low-resolution, and we worried about the Non-deterministic nature of LLMs silently altering notes or lyrics.
Algorithmic programming, unlike AI, is deeply Deterministic. To leverage AI's speed without its unpredictability, I decided on a different approach: instead of having ChatGPT edit the file directly, I had it build a local Python command-line tool.
Using libraries like pdf2image and Pillow, the generated script successfully converted PDF pages to images, filtered out the yellow pixels using strict RGB thresholds, and compiled them back into a crisp, high-resolution PDF. The entire workflow ran locally, ensuring complete privacy and absolute fidelity of the musical data.
[AgentUpdate Depth Analysis] This article highlights a crucial shift in the AI Agent paradigm: moving from "LLM-as-a-Processor" to "LLM-as-a-Toolmaker." In the evolving AI Agent ecosystem, the inherent non-determinism of LLMs remains a major barrier for enterprise adoption. By generating deterministic code (such as Python scripts) to perform exact tasks, Agents can bridge the gap between human intent and reliable execution. This pattern—pioneered by tools like OpenAI's Code Interpreter—ensures data privacy, eliminates hallucination risks, and guarantees 100% consistency. Moving forward, the most powerful AI Agents will not just output direct answers, but will dynamically compile, test, and execute customized micro-tools in secure local sandboxes to solve highly specific user problems.