Jupyter Notebooks and LLMs: An Unexpected Cost Optimization

2025-01-21

The author used LLMs for coding assistance, initially with a ContinueDev + OpenRouter setup. Costs unexpectedly soared. Investigation revealed that Jupyter Notebook (.ipynb) files contain significant hidden content (code outputs, metadata, base64-encoded images), leading to a large token count and increased LLM call costs. The solution was converting .ipynb files to .py files and removing base64-encoded images. This reduced costs by 94% and latency as well. The post highlights the importance of mindful input when using LLMs and recommends regularly checking costs.

Development Cost Optimization