When AI Is Overkill (And What to Use Instead)
I get it. AI is exciting. ChatGPT can do amazing things. But I've watched companies burn months and tens of thousands of dollars building AI features that could have been solved with 50 lines of code.
Let me save you from that fate.
The "AI Tax" Nobody Talks About
Every AI feature comes with hidden costs:
- Latency: API calls take 1-30 seconds. Users notice.
- Reliability: APIs go down. Models hallucinate. Outputs vary.
- Cost: Every request costs money. It adds up.
- Debugging: When something goes wrong, good luck figuring out why.
- Testing: Non-deterministic outputs make QA a nightmare.
Traditional code has none of these problems. It's fast, predictable, and free to run.
Problems That Don't Need AI
Pattern Matching
Need to extract phone numbers from text? Email addresses? Dates in a specific format? That's regex territory.
/\b\d{3}[-.]?\d{3}[-.]?\d{4}\b/ will find phone numbers instantly, deterministically, for free. An LLM will take 2 seconds, cost money, and occasionally miss one.
Use AI when: Patterns are fuzzy, varied, or context-dependent. "Find mentions of competitors" is an AI problem. "Find phone numbers" isn't.
Categorization with Known Categories
If you have a fixed list of categories and clear rules, use a decision tree or lookup table.
Example: categorizing support tickets into "billing", "technical", "account", "other". If 80% of tickets contain obvious keywords ("invoice", "can't login", "password reset"), handle those with keyword matching. Only send the ambiguous 20% to AI.
This hybrid approach is faster, cheaper, and often more accurate than pure AI.
Data Transformation
Converting formats, parsing structured data, transforming schemas. These are deterministic operations. Write a parser.
I've seen people use GPT-4 to convert CSV to JSON. A one-liner does this. Don't pay per-token for string manipulation.
Simple Search
Before you build a "semantic search" feature, ask: would keyword search work?
Elasticsearch with proper tokenization handles most search use cases beautifully. It's fast, cheap, and predictable. Save vector search for when you actually need to find conceptually similar things, not just matching words.
Calculations and Logic
LLMs are terrible at math. They'll confidently tell you 47 times 89 is 4183 (it's actually 4183, but they'll get plenty wrong). Any business logic, calculations, or rule-based decisions should be code.
Use AI to understand intent ("what's my total?"), then hand off to deterministic code for the actual calculation.
The Right Tool Checklist
Before reaching for AI, ask:
Is the output deterministic? If the same input should always produce the same output, you probably don't need AI.
Are the rules clear? If you can explain the logic in an if/else tree, write it as code.
Is speed critical? AI adds seconds of latency. If you need millisecond responses, look elsewhere.
Is the data structured? AI shines with unstructured text. For structured data, traditional programming is usually better.
Do you need 100% reliability? AI will fail sometimes. If that's unacceptable, don't use it.
Hybrid Architectures
The best systems combine approaches:
Tier 1: Rules and keywords - Handle the obvious cases instantly
Tier 2: Traditional ML - Classification models for well-defined problems
Tier 3: LLMs - Only for genuinely ambiguous or creative tasks
A customer support system might work like this:
- Keyword match: "password reset" → send reset link automatically (no AI)
- Simple classifier: Detect sentiment to prioritize angry customers (small ML model)
- LLM: Draft personalized response for complex issues (GPT)
This system handles 70% of tickets without touching an expensive API.
When AI IS the Right Answer
Don't get me wrong, AI is incredibly powerful for the right problems:
- Natural language understanding: Parsing human intent from messy text
- Content generation: Writing, summarizing, explaining
- Fuzzy matching: Finding similar things without exact keywords
- Complex reasoning: Multi-step analysis with judgment calls
- Personalization: Adapting tone, style, or content to context
If your problem genuinely requires understanding language or generating creative output, AI is probably worth the tradeoffs.
The Cost-Benefit Reality
Here's a real example. A client wanted to "use AI" to validate email addresses. We could have called GPT-4 for each email at $0.01 per validation.
Instead, we wrote a validation function: check format with regex, verify MX records, check against a disposable email list. Total cost: $0. Speed: 50ms instead of 3 seconds. Accuracy: higher than GPT-4 for this specific task.
AI is a tool, not a magic wand. Use it when it's the best tool for the job, not because it's trendy.
The goal isn't to use AI. The goal is to solve problems. Sometimes the best solution is a regex.