The Production Checklist: What You Need Before Scaling
Before you push the button from "demo" to "production," you need these things in place.
1. Cost Controls
You need:
- A hard cap on API spending (kill requests if you hit it)
- Request batching (fewer API calls = lower cost)
- Response caching (same question? Don't call the API again)
- Rate limits per user (prevent one customer from bankrupting you)
Real example:
- Your MVP: Every user request = 1 API call
- Optimized version: 80% of requests are cached, 20% are batched, 5% hit the API
Cost drops from $10,000/month to $500/month.
Same product. Different economics.
2. Model Strategy
Pick one:
Option A: API-Only (Simple, Expensive)
- Use ChatGPT, Claude, Gemini (whatever works)
- Pros: Simple, no ops, model improvements free
- Cons: Expensive, no control, rate-limited
- Use this if: Latency doesn't matter, cost is negotiable, feature set is simple
Option B: Hybrid (Balanced)
- Use cheaper models (Mistral, LLaMA) for easy stuff
- Use expensive models (GPT-4) only for hard problems
- Example: 80% of requests go to Mistral ($0.01 each), 20% go to GPT-4 ($0.05 each)
- Pros: 3x cheaper, still good quality, more control
- Cons: More complex, worse average latency
- Use this if: You have budget constraints and some requests are simpler
Option C: Self-Hosted (Most Control, Most Ops)
- Run LLaMA 7B or Mixtral on your own GPUs
- Pros: Full control, zero API costs at scale, no rate limits
- Cons: Ops complexity, worse latency, model quality is lower
- Use this if: You have a ML team, tight latency requirements, or need privacy
Pro tip: Start with hybrid. Use an API-based model (GPT-4/Claude) for 90% of requests. You'll hit scale problems when they matter, not when they kill you.
3. Latency Budget
Before you scale, define: "How long is acceptable?"
Typical targets:
- Chatbot: 3-5 seconds (users tolerate waiting for AI)
- Real-time agent: 500ms (feels instant)
- Batch processing: 30 seconds (async is fine)
Work backwards:
- Total latency = Network latency + Queue wait + Model latency + Database latency
- Model latency: GPT-4 = 2-3s, Mistral = 0.5-1s, LLaMA = 1-2s
- If your target is 5 seconds and model takes 3s, you have 2s for everything else
This changes your architecture.
If model takes 3s and you have 2s left:
- No time for complex database queries
- No time for batch requests
- Network must be sub-100ms
- Database calls must be cached or pre-computed
If you ignore this upfront, you'll architect yourself into a corner.
4. Monitoring & Observability
Add these before launch:
- Latency percentiles (p50, p95, p99) not averages
- Token usage (you need to predict cost)
- Model accuracy (log when AI seems wrong)
- Error rates (API failures, timeouts, hallucinations)
- User satisfaction (thumbs up/down on responses)
- Resource utilization (CPU, GPU, memory, disk)
Why percentiles? Average latency lying: "Average is 3s" but p99 is 45s. Users experience the p99.
Why token usage? You can't control cost without it.
Why accuracy? Hallucinations are silent failures. You need to know when they happen.
5. Failover & Graceful Degradation
When something breaks (and it will), what happens?
Option A: Circuit breaker
- If API is slow, queue the request, return immediately, process async
- User gets response in 100ms instead of 5s
- Trade-off: Slightly stale or delayed results
Option B: Fallback model
- If GPT-4 is down, use Claude
- If API is unreachable, use cached response
- Trade-off: Lower quality, but always available
Option C: Tell the user
- "I'm thinking... this might take longer than usual"
- "I'm not sure about this one, let me ask a human"
- Trade-off: User expectation reset, but honest
Pick your strategy. Build it. Test it. Your production reliability depends on what happens when things break, not when they work.