How do you build AI into an iOS app: Foundation Models, Core AI and cloud APIs
Essence
There are three ways to build AI into the iOS app itself:
- On device via Foundation Models — Apple Intelligence's system model: free, offline, data never leaves the iPhone.
- Your own models via Core AI / Core ML — when you need a specialized model: classification, recognition, your own small language model.
- Cloud models via your own backend — when you need flagship capabilities. The provider key lives only on the server.
The choice depends on the task, privacy requirements, supported devices and budget. They're often combined: simple things on device, hard ones in the cloud.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep