Optimizing Jupyter Notebooks for LLMs

The author shares their experience with LLM-assisted coding using ContinueDev + OpenRouter setup, emphasizing the importance of tracking expenses and analyzing call costs. They discovered that Jupyter notebooks, due to their verbose nature with base64-encoded images and rich metadata, significantly increased expenses when fed into the AI system. By converting notebooks to Python scripts and removing base64 encodings, costs were reduced by 94% and latencies improved. The key takeaways include being aware of what data is inputted into LLM, monitoring spending, and being cautious with Jupyter notebooks. The author highlights the effectiveness of a simple bash script in resolving the issue.

https://www.alexmolas.com/2025/01/15/ipynb-for-llm.html

To top