How I Cut 90% of My AI Agent Costs
Running three agents 24/7 costs money. Here's how I reduced token burn from ~$50/month to near-zero while increasing output.
The trick isn't cheaper models — it's smarter routing and never repeating context.
Where the money goes
Agent costs break down into three buckets:
| Bucket | % of spend | What it is |
|---|---|---|
| LLM inference | 70% | Chat/completions calls (input + output tokens) |
| Web search | 20% | Exa, Brave, Tavily for research |
| Embeddings | 10% | GrayMatter vector indexing |
The 70% bucket is where you win. Smart routing cuts this by 90%.
9router fallback chain
Don't pay for premium models when free ones work. My config:
# Primary: quality model (rate-limited, paid)
primary: nous/tencent/hy3:free
# Fallback chain: free tiers in order of reliability
fallback:
- custom/openrouter/minimax/minimax-m3:free
- custom/meituan/longcat-2.0:free
- ollama/deepseek-v4-flash:0731-cloud # local, no API key needed
# Synthesis vs routing split
synthesis: openrouter/minimax/minimax-m3:free # long-form content
routing: ollama/glm-5:cloud # quick decisions Result: 95% of requests hit free tiers. The 5% that need quality use paid models only when it matters.
Local vs cloud tradeoffs
Local inference (Ollama on VPS) is "free" but has hidden costs:
- GPU RAM: 7B model needs 6GB VRAM. My Radeon 780M (512MB) can't run it
- Speed: CPU inference is 5-10x slower than API
- Quality: 7B models lose to cloud 70B+ on complex reasoning
My rule: Local for STT (whisper), embeddings (bge-m3), and quick classification. Cloud for synthesis, planning, and research.
Free-tier LLM tier list
Ranked by real-world reliability for agent workloads:
| Model | Provider | Reliability | Best for |
|---|---|---|---|
| minimax-m3:free | 9router/OpenRouter | ★★★★★ | Synthesis, content, planning |
| deepseek-v4-flash | 9router/Ollama | ★★★★☆ | Code, reasoning, research |
| longcat-2.0:free | Nous Portal | ★★★★☆ | General agent tasks |
| glm-5:cloud | 9router/Ollama | ★★★☆☆ | Quick decisions, classification |
| gpt-oss-120b | OpenRouter | ★★★☆☆ | Complex reasoning (rate-limited) |
Ollama quota resets Monday morning. Don't rely on a single free tier.
Monitoring token burn
Track these metrics weekly:
- Tokens/agent/day — if one agent spikes, it's looping
- Cache hit rate — prompt caching saves 70%+ on repeated prefixes
- Fallback frequency — high fallback = primary model rate-limited
- Context bloat — trim old context before it costs you
I log every agent run to journal.md with token counts. After 73 sessions, patterns emerge.
Next: How to Run a 3-Agent AI Fleet on One Laptop — the actual hardware and A2A config.