AI features in mobile apps: what runs on the phone and what runs on a server
What runs on the server and what runs on the phone
A typical AI feature has three parts: the app screen where the user types or speaks, a backend that holds your logic and secrets, and a model provider that generates the answer. The app never talks to the model directly. It sends the user's request to your backend, which adds instructions, checks the user's rights, calls the model and returns the result.
Some work can run on the device instead. Speech recognition, simple text classification and image tagging are possible with models built into the operating system or shipped inside the app. A phone model is smaller and less capable, but it can work without a connection and keeps data on the device.
- Server: long answers, large or private knowledge bases, anything that needs current data, and any step that must be logged for review.
- Device: wake words, quick text suggestions, local search over the user's own photos or notes, and fallback behaviour when the network is down.
- Check the current on-device options in Apple's and Google's developer documentation, because the list of built-in models changes with each operating system release.
Keeping API keys and prompts off the phone
Any key stored in an app can be extracted by someone who downloads it. If your model key sits in the app bundle, anyone can copy it and run up your bill. Put the key on the server only, and give the app a short-lived session token that proves the user is signed in.
Prompts are also your business. The instructions that shape the answer, the tone you set and the rules you enforce belong on the server, where you can change them without shipping a new app version. This also lets you stop abuse, such as a user who tries to make your assistant produce something outside its purpose.
Streaming answers and handling slow responses
A model can take many seconds to finish a long answer. Users will wait for a few words that appear quickly, but they will leave a blank screen. Streaming sends the answer in small pieces as the model writes it, so the first words appear almost at once.
Your backend has to pass the stream through to the app, and the app has to display partial text cleanly. Plan for an answer that stops halfway because the connection dropped. Show what arrived, offer a retry button, and avoid saving half an answer as if it were complete.
Offline behaviour and cost per user
AI features depend on a connection, so decide in advance what the user sees without one. Some features can queue a request and send it later. Others, such as a live translation, should show a clear message and offer the parts that still work, rather than failing silently.
Cost grows with usage, so work out the cost per active user before launch. It depends on the model you choose, how much text each request sends, and how often users ask. Limit free use per user per day, cache answers that repeat, and read each provider's current pricing page before you set plan prices.
- Estimate the typical request size, both what you send and what comes back.
- Multiply by the number of requests an active user makes in a month.
- Add a margin for retries, failed calls and users who push the limit.
App Store and Google Play review notes for AI features
Apple and Google review AI features like any other feature, and they expect you to explain them. Describe what the AI does, what data it sends off the device, and whether users can turn it off. If the app shows AI-generated content to people, have a way to report harmful output and a way to block it.
Your privacy labels and data safety answers must match what the app sends. If prompts or user content leave the phone, say so, and name the provider in your privacy policy. Review guidelines change, so read the current App Store Review Guidelines and Google Play policy pages before each submission.
Common mistakes in AI mobile features
The most expensive mistake is a key in the app. The second is no limit per user, so one heavy user or a script can drain the budget in a day. Teams also forget error states, so a failed call looks like a frozen screen.
Test the feature on a slow connection, on an old phone and with the network switched off. Keep a log of the requests and the responses for review, with personal data removed, so you can explain what the assistant did when a user complains.
How Hundred Seas helps
Hundred Seas is a product studio in Taipei that builds native iOS and Android apps, Apple Watch apps and AI agents. We build AI features on Claude and OpenAI models, keep the keys and prompts on the server, and choose the model for each feature on cost, speed, quality and where the user data has to stay.
We start with a scope step, about one week at a fixed price, ending in a written plan, a clickable prototype and a firm quote. Software then ships in weekly releases, and a monthly run plan keeps the app, its backend and its AI features working after launch.
Questions
- Can my mobile app call an AI model directly?
- It can, but it is risky. A key stored in the app can be extracted, and the app cannot enforce your limits or rules. Route calls through your own backend, which holds the key, checks the user and applies your prompts. The app then only talks to your server.
- Should AI run on the phone or on a server?
- Most features run on a server because they need larger models and current data. Use the device for fast, simple tasks, or for work that must stay private or work offline. Many good apps combine both, with a small on-device model and a server model for harder requests.
- Will Apple or Google reject an app with AI features?
- Not for having AI alone. Reviewers check that the feature is explained, that users can report harmful output, and that the privacy label and data safety answers match what the app sends. Read the current review guidelines and policies before each submission.
- How do I stop AI costs from running out of control?
- Set a daily or monthly limit per user, cache repeated answers, and keep requests short. Watch the usage and cost on your provider's dashboard, and alert your team when spending rises faster than active users. Choose a smaller model for simple tasks and reserve the larger one for hard ones.
- What should the app show when the AI fails?
- Show a short, plain message that the answer could not be produced, keep what the user already typed, and offer a retry. If the feature has a fallback, such as a standard search or a saved draft, offer that too. Never leave a blank screen or a spinner that never stops.