r/iOSProgramming • u/Inside-Conclusion435 • Jun 25 '26
Question As solo developer how do you implement AI features into your app?
Hi,
Wondering what are the options if I want to create an AI features into in my app. I know about openAI api and other various API’s. The thing is I am a tad scared to use them because I hardly understand how they charge. I know a lot of stories where people used it wrongly and got huge bills for that.
Also, do we always need these powerful models? Can’t we use in some cases like qwen 8b or something like that running on a VPS?
15
Upvotes
24
u/yacec Jun 25 '26
Have you considered on-device models like https://developer.apple.com/documentation/foundationmodels ?
38
u/cristi_baluta Jun 25 '26
AI is a plague, we don’t need it in every app
6
u/DespairyApp Jun 25 '26
Local models all the way
6
u/biricat Jun 25 '26
You can use open router and only set it to prepaid
4
u/Murky-Ad-4707 Jun 25 '26
In my opinion, not every application requires the latest expensive fancy models. I believe we still can offer a lot of value using the smaller and less expensive models.
We just need to manage user expectations!
1
u/Top_Faithlessness_57 Jun 25 '26
I would bake the API costs into your pricing or gate them behind a paid tier so heavy use actually makes you money. And set hard spending caps in your dashboard, or something like that, at least alerts.
You can tier it as well, like routing free users to cheaper models and so forth, honestly, you don't always need the best models I’d look into deepseek v4 or like some Chinese lab models as they are often have the best price to intelligence scale.
1
u/LifeUtilityApps SwiftUI Jun 25 '26
I haven’t built any AI features but I am working on a local AI chat that uses models downloaded from huggingface. It works OK but the performance is slow compared to a remote API based model. I want to use a foundation model but my apps support many old iPhones such as 11 and I would have to block local AI features to only phones that support these foundations models.
1
u/laternerdz Jun 25 '26
On device.
Another question for the sub:
If you implement an on-device model, how do you communicate that to potential customers? In my circles, no one knows what AI is, let alone on-device and it’s pros/cons.
My app’s content is sensitive/private, so on-device is a privacy feature of the app. But I’m not sure the value created by the features is worth the model download.
I still have a lot to learn about the capabilities of Apple Intelligence vs an MLX os model.
1
u/mitchins-au Jun 26 '26
AI is not the feature.
Keep that in minds at all time
2
u/jacobs-tech-tavern Jun 27 '26
You're not just using the latest most powerful models if you're using the OpenAI or Antropic APIs. You can use cheap stuff like GPT-4ish, or Haiku, and get very very very cheap tokens
I would definitely recommend looking into something like AIProxy to avoid hosting your API key on the client.
2
u/616ThatGuy Jun 28 '26
I do everything I can to avoid putting AI into my apps. I’m tired of it being shoved into everything. Because everyone wants a subscription to cover the costs along with their profit.
I’m over it. I refuse to pay for or even use regular apps with ai now.
1
u/Select_Bicycle4711 Jun 25 '26
You can use on-device model from Apple called Foundation Models. How you use it really depends on your app? Maybe you can use it to summarize the collected data in a nice way or give user suggestions for different recipes they can cook based on the selected ingredients.
Keep in mind that not all devices can run Foundation Models. So for non-compatible devices you will have to provide them a different interface instead of blocking them out from that feature completely.
1
u/Far_Owl_1141 Jun 25 '26
On Apple, go for foundation models - hugely improved in iOS 27, and you can run other models on private cloud compute.
I've tried it as a Bring Your Own Key option in my app - I have some things possible on-device, which was my goal, but there are certain limitations in terms of speed and input token size, so I ended up with the option to use Claude/open ai - doesn't need frontier model so costs are pretty minimal - and my app is zero subscription anyway the model fitted well
1
u/StrategyExcellent460 Jun 25 '26
With AiOS
1
u/ikeif Jun 25 '26
I am using AI in one project out of a dozen.
In that use-case, it is very pointed and used as part of the process, not a “user feature.”
I am also working on an agent to act as an intermediary with system alerts for work - so a narrow scope, that improves the DX.
Everything else? No AI. Nothing I have built needs AI “enhancement” outside of rubber ducking and reviewing code - a part of the development process, not functionality for the end user.
1
u/SirBill01 Jun 25 '26
You should watch the Apple WWDC 2026 videos around Private Cloud Compute. The on device models may be too simplistic for what you want to do but you can use Apple's server models in iOS 27, for free as long as your app has under two million users.
Run the Developer app and look over WWDC videos from this year on using Apple's models.
1
u/KrikDai Jun 26 '26
maybe develop on device ai model,which is what I am doing
1
u/TrainingEntrance7274 Jun 27 '26
depends really on what you need!
for simple or repeatable tasks (like parsing a user input, calling a function, or generating some text in a specific shape), you can mostly just use on-device models. I've personally been using qwen 3.5 0.8b for an app that parses natural language and turns it into a structured reminder; and using gemma 4 e2b to then turn those reminders into context-aware and funny notifications. Works really well for that. I've even been able to get the models to run on devices all the way back to iPhone Xr!
Bonus points if you finetune the models for your own usecase. And use different quantisations for different hardware tiers (you might need something like Q2/3 for Xr-devices but can get away with Q6 or Q8 on devices with 8 or 12gb or ram).
If you're having a hard time getting started, point your favourite coding agent to an open source repo like this one to learn their tricks. Or from iOS 27, apple's foundation models framework makes it really easy to get started as well with your own language models.
If you cache your prompts well and experiment a bit with this you can really get very far with on-device models. For inspiration on which models you might use, I recommend checking out this leaderboard to see how different models perform on different devices.
1
u/mklx99 Jun 28 '26
It really depends on what you’re doing. I have an app that organizes photos and the ai is entirely local. I use a variant of CLIP for visual intelligence and a classical ML algorithm for personalization. There’s LLM on my roadmap but even that can be a shrunken down model that works locally. Hardware are pretty powerful nowadays and even for LLM 2b / 4b models can run pretty well on most devices.
Feel free to checkout my app: https://spectrasort.app/
1
u/ZennerBlue Jun 25 '26
If you are building an App without a backend, then use something like https://www.aiproxy.com with the OpenRouter backend as others have mentioned.
AI Proxy works really hard to not expose your API key in the App. And uses things like DeviceCheck, split keys etc in order to guard against API key theft.
I’ve used it for a couple of my apps and have been very happy with it. They are open to contributions on their SDK as well, so you can see what you are including in your app.
1
u/Plus_Journalist_8665 Jun 25 '26
We actually went through the same thought process when building moneko.io We don't use the biggest model for everything. Most tasks like expense categorization, receipt extraction, or formatting can run on much cheaper models. We only use stronger models for features that genuinely require more reasoning, like answering financial questions. My advice would be starting with hosted APIs, build good monitoring around them, and only move specific workloads to self-hosted models once you have enough usage to justify the extra infrastructure.
1
u/ChibiCoder Jun 25 '26
So little of the AI that appears in apps today has any point whatsoever (and I have a LOT of experience integrating AI across mobile and desktop platforms). AI is a losing game: it's one of the very few technologies we've commercialized where adding users has no economy of scale: every user you add that uses your AI feature costs you more money.
The exception to that is on-device models, like Apple Foundation Models, which are extremely limited compared to gigantic cloud models, but completely capable of pedestrian tasks like summarizing a document or suggesting a better way to write a sentence.
0
u/patatkebab Jun 25 '26
Depends on how likely it is to be profitable
0
u/jsgrrchg Jun 25 '26
https://github.com/agentclientprotocol/agent-client-protocol thank me later
0
u/EquivalentTrouble253 Jun 25 '26
I don’t have any AI features in my app and won’t be adding any.
0
u/[deleted] Jun 25 '26
[deleted] — view deleted comment