Libraries are the Unsung Heros of AI

An image of an AI cartoon with hands, holding two folders labeled libraries. Surrounded by libraries.
Author: Leigh
Date: Monday, 31 August 2026
Time (GMT): 10:30:08 pm

A friend recently asked me: "Why are you still writing libraries when an AI can generate the code for you?"

Thats a good question, with the current AI hype many assume that "AI-generated" means "no more libraries." They believe the machine can be the sole architect.

We still use libraries for two reasons:

  1. Risk: Why reinvent the wheel? A community-vetted library has more eyes and fewer bugs than AI-generated code.
  2. Cost: Code costs money. Whether it's in human developer hours or AI token spend, generating logic from scratch is expensive. Reusing libraries cuts that cost significantly.

Let’s break down the costs of developing code using an AI agent, comparing the efficiency of utilizing libraries versus building them from scratch.

Full disclosure; I've used an AI to generate this data, so its probably not exact.

Cost without third-party libraries

Below is a table showing the cost of building apps with and without third-party libraries.

AppTokens spent using LibrariesCostTokens spent without librariesCost
Single Page Application~40M – 150M$100-$500600M – 2B+ tokens$2,500 – $10,000+
Mobile Application~50M – 180M tokens$125 – $5502.5B – 8B+ tokens$10,000 – $40,000+
Desktop Application~50M – 200M$120 – $6003B – 10B+ tokens$15,000 – $50,000+
Operating System~30M – 120M$70 – $400Infinite / Billions$100,000 to Incalculable

The LLM inadvertently revealed its own limitations when it generated these results, it stated it would likely not be able to build an OS without the support of libraries, It was simply too massive a task.

Let’s not forget the annual software maintenance cost to keep these apps running. A rough estimate should be about 25% of the original project build cost.

AppTokens spent using LibrariesYearly CostTokens spent without librariesYearly Cost
Single Page Application~10M – 37M tokens$25 – $125~150M – 500M tokens$625 – $2,500
Mobile Application~12M – 45M tokens$31 – $138~625M – 2B tokens$2,500 – $10,000
Desktop Application~12M – 50M tokens$30 – $150~750M – 2.5B tokens$3,750 – $12,500
Operating System~7M – 30M tokens$18 – $100~250M – Billions$25,000 – $50,000+

This assumes that the AI can keep "going" through the entire process. You would have to deal with context window limits and the deterioration of technical debt. Therefore the maintenance costs would likely be much higher than these figures suggest.

When an investor says companies will build their own software and not rely on third-party vendors (the "SaaS-pocalypse"), think of these tables! We will still rely on third-party libraries for a long time. That includes third-party platforms and services.

Internal Libraries

If you are a software house using AI, building your own internal libraries will save you on token spend.

For example: If you are a software vendor who builds web apps for commercial clients, building a simple UI library will cut the cost of each of your AI builds dramatically. The same would be true for mobile and desktop applications.

AppTokensCostYearly Cost
React App from scratch~40M – 150M tokens$100 – $500$25 – $125 / year
React library using a component library~10M – 35M tokens$20 – $80$5 – $20 / year

Conclusion

I always say this in every AI post: I am not badmouthing AI! LLMs are still much cheaper and faster than humans. However, people often believe that LLMs can build everything from scratch and that humans are redundant. The major reason why LLMs are better at coding than at almost any other task is because of the libraries humans built.

Lets not forget the post and pre training of models by humans, and all the information LLMs use for reasoning. LLMs need us, and LLMs cant evolve without us!