I wanted to handle natural language queries and voice dictation. In the year 2026, the default answer is to use some big cloud LLM. This is the current answer de jure, but it raises additional problems.
- Do I embed the API key in the code? Bad idea
- Do I let users bring their own key? Bad idea
- Do I proxy the request through a server? If I proxy the request through a server, now I have to run a server. Running a server includes costs. I should probably also have an in-app purchase subscription, user accounts for authentication, and rate-limiting.
This is overkill for a calculator app.
If the users are already suffering through iOS26 on their phones, then we should see if we can use Apple Intelligence (Foundation Models).
Why do we need Foundation Models at all? Can't we just use SFSpeechRecognizer?
We are going to use SFSpeechRecognizer for transcribing the user's voice and returning text. After we have the text, we need to go through LanguageModelSession in order to reduce it into a valid formula. I have a custom grammar with a range ('between') and special cases like 'percent tip'. This outputs a formula that the user can verify before running.
That's it. No need to get sent voice records off to a 3rd party or charge money for something your phone can already do.
I think you should try local AI and see if it works for your app. You probably don't need voice-dictated Monte Carlo simulations, but if you do, Guesstimate is free on the App Store.