chapter nine

9 Economics of vibe engineering: cost optimization at scale

 

This chapter covers

  • Why your API bill is the least interesting number on your invoice
  • The hidden costs that dwarf token spend
  • How the pricing war between models reshapes the optimization problem
  • Token economics fundamentals
  • When cost optimization is actively harmful
  • The philosophical shift from "code author" to "trust engineer"
"We saved 70% on API costs. Then our customers started complaining about quality, and nobody knew when it started."

Every chapter so far has dealt with getting AI to produce correct, trustworthy, well-structured code. We've covered context engineering, continuous development, evaluation hierarchies, and trust debt. All of which assumes a world where you can call whatever model you want, as many times as you need, with as much context as the task demands. That world exists - for about a week after your proof-of-concept impresses leadership and before finance gets the first real invoice.

9.1 The true cost of AI in production

9.1.1 Token economics 101

9.1.2 The pricing war timeline

9.1.3 When NOT to optimize

9.2 The optimization ladder

9.2.1 The starting point: maximum settings, zero awareness

9.2.2 The behavioral problem: wrong tool for the job

9.2.3 The context problem: paying for noise

9.2.4 The model problem: one size doesn't fit all

9.2.5 Output problem: paying for explanations nobody reads

9.2.6 Timing: not everything needs an instant answer

9.2.7 Structural: one tool can't serve every workflow

9.2.8 The diminishing returns, and where to stop

9.3 Running models locally

9.3.1 When local makes sense for developers

9.3.2 The developer hardware landscape

9.3.3 Setup: Ollama + OpenCode, the free Copilot

9.3.4 Which model for which coding task

9.3.5 Quantization: which download to pick

9.3.6 The local model's honest niche

9.4 Measuring the investment

9.4.1 The real cost of a development team's AI stack

9.4.2 Measuring AI coding ROI

9.4.3 When quality degrades, the silent erosion

9.4.4 The monthly health check

9.5 Advanced strategies

9.5.1 MCP vs. CLI, the hidden context tax

9.5.2 Taming agentic costs

9.5.3 Multi-agent patterns and their economics