AI features sell apps — smart search, photo scanning, a helpful assistant. They can also produce a cloud bill that grows faster than revenue. These are the patterns we use to keep both in check.
Do the cheap work on the phone
Text recognition, barcode scanning, face detection, language identification and basic image labelling all run on-device with ML Kit or TensorFlow Lite. They cost nothing per request, work offline and keep personal data on the phone.
Route by difficulty
Not every request needs the largest model. We send simple classification and short answers to a small, fast model and only escalate complex questions. In most apps, the bulk of traffic never needs the expensive tier.
Cache aggressively
Users ask the same things. Caching answers to common questions — and the embeddings for common searches — removes a surprising share of model calls.
Stream the response
Streaming does not reduce cost, but it changes how fast the feature feels. A reply that starts in half a second feels instant even if it finishes in four.
Put limits in from day one
Per-user daily limits, maximum input length and a server-side kill switch protect you from abuse and from a single bug that loops a request all night.
Watch cost per active user
Track AI cost per daily active user next to revenue per user. If the first is creeping toward the second, you will see it weeks before the invoice arrives.
Building or upgrading an app? See how we work on mobile.