On-device Core ML vs a remote LLM in an iOS app: when the local model earns its keep for a single feature
We had a specific feature in an iOS app: classify the free-text the user types into a field and route it to one of several categories in the app's flow. It's not text generation, it's not a chat, it's classification - input text, one output label from a closed set of options. For that particular feature we weighed two opposite paths: running a small model on-device with Core ML, or calling a remote LLM for every classification. We ended up with Core ML, but the interesting part isn't the conclusion - it's that the same question, asked about a different feature in the same app, gave us the opposite answer.
Why the question was worth asking for this specific case
A remote LLM is the default choice when you need to classify natural-language text, and for good reason: there's nothing to train, the prompt can be tweaked in minutes, and quality on ambiguous inputs usually beats a small model trained from scratch for the task. If the job were open-ended generation, summarization, or reasoning over long context, the discussion would stop right there, because an on-device model sized to run comfortably on an iPhone doesn't compete with that.
But classification into a closed, relatively stable set of categories is a different kind of problem. It's exactly the kind of task a small model, trained or fine-tuned for that specific domain, handles well without needing the general-purpose capability of a large LLM. The question wasn't "can Core ML match a remote LLM in general?" - it was "does this particular task need a large LLM's general capability, or is a small classifier enough?"
The three factors that actually decided it, not the one we expected
We went into this evaluation expecting classification quality to be the deciding factor. It wasn't: for this set of categories, a well-tuned small model and a remote LLM with a reasonable prompt landed at an accuracy level that, in our manual spot-checks reviewing results case by case, didn't show a difference that mattered for the product. What actually decided it was the combination of the other three factors.
Latency. A remote LLM call involves, at minimum, a network round trip, the provider's queue, and server-side inference time. A Core ML model running on-device with the Neural Engine executes in the same process, without ever leaving the device. For a feature the user expects to react while they're still typing - think a field that suggests the category as the text fills in, not a button pressed once - the gap between "instant" and "with a network hop in the middle" isn't a nuance, it's the difference between the feature feeling like part of the UI and feeling like a spinner.
Cost per request. A remote LLM charges per token, per call, or both, depending on the provider. If classification fires once per user action - say, when a form is saved - volume is low and cost is marginal. If it fires on every keystroke to give real-time feedback, volume multiplies by active users and typing frequency, and it stops being marginal. An on-device model has no per-inference cost: the cost was already paid once, when the model was trained and packaged with the app.
Offline availability. This is what ultimately tipped the decision for this particular feature. The app gets used in scenarios where connectivity isn't reliable - the user filling out the form somewhere with spotty signal - and classification is part of a flow the user expects to complete without the app asking them to wait for signal to come back. A remote model turns that optional dependency (a nicer experience with a network) into a hard one (the feature doesn't work without a network), and that wasn't acceptable for this specific flow.
What Core ML cost us that a remote LLM wouldn't have
None of this is free in the other direction. Converting a model to Core ML - whether trained from scratch or fine-tuned from a larger base model and then converted with coremltools - is ML engineering work that a prompt to a remote LLM simply doesn't demand. You need labeled training data for this feature's specific categories, you need to validate that the converted model behaves the same as it did before conversion (quantization that shrinks the model's size can introduce subtle behavior differences that have to be checked, not assumed), and you need a pipeline to retrain and repackage the model whenever the categories change or a new one appears.
let config = MLModelConfiguration()
config.computeUnits = .all // CPU, GPU, and Neural Engine depending on availability
let model = try TextClassifier(configuration: config)
let input = TextClassifierInput(text: userInput)
let prediction = try model.prediction(input: input)
let category = prediction.label
The inference code itself is simple, but that runtime simplicity hides the cost paid earlier: training, converting, validating, and packaging the model inside the app bundle, which also grows its download size. With a remote LLM that cost doesn't exist: you change the prompt, you deploy, you're done. If this feature's categories changed often - several times a week, say - that on-device retraining cycle could outweigh the latency and cost benefits, and the balance would have tipped toward the remote LLM despite everything above.
Why the same question, for a different feature in the same app, came out the opposite way
The same app has another feature that generates a natural-language summary of the user's activity, with a conversational tone and free-form structure. We ran the same evaluation there and landed on the opposite side: remote LLM, no on-device model. The reason isn't that we changed our criteria - it's that the same three factors came out differently. The task is open-ended generation, not classification into a closed set, so a small on-device model simply can't produce comparable output quality. Call volume is low - the summary is generated once per session, not on every keystroke - so cost per request doesn't weigh the same. And the feature isn't critical to a flow the user needs to complete offline: if there's no network, the summary just doesn't show up that time, without blocking anything else.
What we check before choosing on-device for a new feature
Before deciding whether a text classification or processing feature goes on-device with Core ML or remote with an LLM, we first look at whether the task is a closed, relatively stable set of outputs or open-ended generation, because that alone rules out one of the two options before cost or latency even enter the picture. If the set is closed, we look at expected call frequency - once per user action isn't the same as once per keystroke - and whether the feature needs to work without connectivity as part of its purpose, not just as a nice-to-have. And we honestly weigh, separately, whether the team can sustain an on-device training and repackaging pipeline given how often the categories are likely to change, because that maintenance cost is real and it doesn't show up until weeks after launch, the first time the model needs to be touched. None of these factors decides things alone; the answer comes from how they combine for the specific feature in front of you, not from a general preference for on-device or for a remote LLM.