The model call is the easy part. What decides whether an AI feature ships is everything around it: what the screen does when the photo is dark, when the response comes back malformed, when the request times out on a train, and what the whole thing costs per user once real people are using it every day.
We have built that loop for our own apps and we run it in production. Bite AI takes a photograph of a meal and returns calories and a macro breakdown, which means the pipeline meets real camera input — bad light, a half-eaten plate, a photograph of a menu instead of a meal — and still has to put a usable number on screen or say plainly that it cannot. The number then lands in a daily total and in Apple Health, so a wrong answer is not a cosmetic problem.
So we design the failure states first and the happy path second. A feature that degrades into something a person can still use beats one that is perfect right up until it is blank.