This is a continuation of my series from the “AI-Enhanced App” talk I gave at Swift Bharat. Previous posts:
Ok!! So this post brings together what my last two posts were about. We’ll start with the premise. How to add AI to your app in a way that actually enhances the user experience.
Well, the most obvious useful and cheapest thing you can do today is implement natural language search. In this post, I’ll be focusing on the simplest version. Searching through a set on-device list. Think: settings, faqs, emoji picker, a color picker. This is basically a limited list of choices that is set and doesn’t change.
The best example of an app that this would be the perfect fit for is Apple’s Settings app. It has a set list of settings that should be super easy to search through (but isn’t!).
The easiest solution is Typesafe AI’s Jev model, or any other copycat decision model (now gemini and openai both have these). There is also the Laya open source decision model if you want to host your own.
All you have to do is send the list of settings with the description of each setting, then send the user’s natural language query, and Jev will automatically rank the setting choices for you, which you show to the user. Very easy and simple!
But this comes with a few problems:
Cost: Although decision models are very very cheap, they still cost money. At scale, this can add up. The price may also increase in the future. Hosting your own Laya model is great, but comes with overhead.
Privacy: This one is the bigger issue. Every query you send to a hosted decision model is now data for that provider. We just had the OpenRouter incident, where a researcher found that those generous “free” inference providers were reading your prompts. So using these models means your user and app data is sent to those providers.
Unpredictability: Third-party providers have been known to immediately deprecate models as new ones are released. While this might be ok in general, this might create a regression for your own app’s data. Since there is no guarantee that a “better” “newer” model works well for your task specifically. While Jev has general instructions on it’s percentages, they still need to be calibrated to your task (e.g. for one of my tasks, a 40% cut off was better than the standard recommended 50%).
An API Call: Decision models are extremely fast, but they still require a network connection to work. This creates unnecessary overhead and add to the things that can go wrong in your app when network connectivity is weak. For a Settings app, it makes no sense to need to have a network connection to change your phone to Dark mode, for example.
Well, turns out, it’s now very very easy and cheap to train your own on-device decision model! To get almost the same results as Jev, it cost me $23 on Tinker (Thinking Machines) and 0.2 compute units in Google Colab. I am on the $11.99 Google Colab plan, which gives me a total of 100 compute units per month, so using 0.2 units for training cost me about 2.5 cents there. Total cost: $23.5. The total model is only 25 MB, a very easy add-on to any app!!! Here is the side-by-side search comparison to Jev to my own trained on-device search model for Apple’s Settings app:
I’ll now go into more detail on how I trained this model. If you’d like to get started right away without reading, I set up an On-Device Search Starter that you simply give to your Claude or Codex agent and it’ll walk you through the whole process. Paid subscribers will get it automatically.
Training The Model
The hardest part of training the model is setting up the data set.
The Choices
The first step is the same thing that you do when you use Jev - come up with a set of possible choices. In this case, 151 settings, with a short description of the setting. This part is easy.
The Synthetic Searches
A bigger model, in my case Qwen3.6-35B-A3B via Tinker, was then given each setting one-by-one, and it was tasked with outputting possible search queries that a user would use to find this setting. The result output was ~27,000 searches.
A script then wrote 20,000 more searches that could happen, like cut-off searches (e.g the user types “brigh” for “brightness”)
The Test Set
Claude then answered 1,006 searches with a list of settings that would fit the search (including none). This created the test set.
Training the Teacher
The same big model, Qwen3.6-35B-A3B, was then trained on 806 search queries + answers. And to test it, it had to answer the 200 withheld examples.
Note that I could have used a bigger model (397B) for better results, but that would have cost me $90 more. Since this is just a demo of what can be done, I didn’t go for it. But for my own app, the extra $90 would still be a steal.
The Synthetic Results
After the “teacher” was trained, it answered every generated search, ~ 47,000 over two rounds, with a percentage for each likely setting, such as “screen lights out” → Auto-Lock 70%, Brightness 14%.
Training the Smaller Model
The answers generated by the teacher were then used to train a small all-MiniLM-L6-v2 model on Google Colab, checked against the 200 test set.
Closing the Gap
The model alone put the right setting first for 93.4% of the test searches. Some of the mistakes were due to the “teacher” model getting a few settings wrong. The fix might have been using a bigger model for the original answers (again, the $90 result).
The second gap was that the model performed poorly on half-typed searches (e.g. blue → bluetooth). This was a simpler fix - just a simple name matching script pushed the total results to select the right setting first for 94.6% of queries, matching the original Jev model results.
Conclusion
So for only $23.5 and an addition of 25MB, Apple can implement natural language search in it’s Settings app that works as well as Jev’s decision model. For ~$100, it might work better than Jev!
The one advantage Jev has is that it is backed by the bigger Qwen model behind the scenes, so it allows for more languages by default. In contrast, this on-device model is English only. Of course, if your app supports multiple languages, you can train a model specific to the user’s language and just download the correct one from the cloud when the app loads for the first time.
The other issue is that this must be a static list. If Apple were to add another setting, the model would need to be retrained (only ~$25 more).
Anyway, there is absolutely NO EXCUSE to not have natural language search implemented in your app! At least use Jev! And if you want to build your own, but want more guidance, get my On-Device Search Starter and give it to your agent to train your model for you!
I will continue writing about the different ways to include AI in your apps in USEFUL ways that your users will thank you for!! Subscribe to follow along!

