When NOT to Use AI: Identifying Bottlenecks Where Pure Code Still Wins
Not every technical problem should be solved with artificial intelligence. Learn where AIs fail and classic code remains irreplaceable.
The era of generative artificial intelligence has brought understandable excitement. LLMs (Large Language Models) can write functional code, structure blog post ideas, and translate complex technical terms while preserving the author’s original tone.
However, this excitement has generated a common side effect in engineering: the tendency to use the newest tool for absolutely any problem. If the only tool you have is an LLM, every problem looks like a prompt.
LLM fever in everything
Currently, we see complex software solutions that use AI API calls for extremely simple tasks, such as extracting a date from a string, validating an email format, or classifying a text into three fixed categories.
Although an LLM can do this reasonably well, using artificial intelligence for purely logical or mathematical tasks is the equivalent of hiring a senior consultant just to organize your download folder.
Where AI fails
Probabilistic language models operate by predicting the next most likely word based on statistical patterns. They do not have a real computational logic mechanism or awareness of strict mathematical rules.
- Subjectivity vs. Rigor: AI is excellent for subjective tasks (e.g., “improve the tone of this text” or “translate keeping the formality”). It fails when the answer needs to be binary and exact (e.g., “calculate if this trading transaction violates the 2% risk management rule”).
- Reproducibility: The same prompt run at different times can generate variations in the output structure. In systems that rely on rigid data contracts (APIs, bank integrations), this is a disaster.
- Structural Hallucinations: Even when forcing JSON output, there are times when the AI breaks the syntactic structure, invalidates the JSON, or invents keys that did not exist in the requested schema.
Costs and latency: The forgotten reality
Making an API call to OpenAI, Anthropic, or running a local model (like Llama 3) requires immense computational resources. This translates into two major enemies of efficient systems:
- Latency: A network call to a language model rarely takes less than a few hundred milliseconds, easily reaching seconds. A regex in Python executes locally in less than 1 millisecond.
- Financial Cost: While processing 1 million strings with regex costs imperceptible fractions of cents of energy on your VPS, doing the same via an AI API call can cost dozens of dollars monthly on a recurring basis.
The power of deterministic solutions
The true “Systems Builder” understands that AI should be a complement, not the foundation.
If a problem can be solved with a traditional deterministic algorithm (regex, decision structures, structured JSON parsing, relational databases), classic code will always win in performance, predictability, and cost.
In our content pipeline, for example, AI is used to generate the initial technical translation and suggest links. However, assembling the Markdown frontmatter, validating image paths, calculating reading time, and publishing via the GitHub API are controlled by traditional flows in n8n and JavaScript.
Do not try to probabilistically guess what can be deterministically calculated.