On‑Device AI in React Native: What Actually Works in 2026
Biju Dey··7 min readFor the last couple of years, "add AI to the app" has meant one thing for most of us. Send the user's text to an API, wait, show the answer.
That still works. But in 2026 there's a second option that has become practical for React Native developers, and I think a lot of teams are sleeping on it. You can run the model on the phone itself.
No server. No per-request bill. Works on a plane. The user's messages never leave their device.
I've been reading up on this and taking notes for a while, mostly with chat-style features in mind, since that's the kind of app I build at work. This post is everything I wish I'd had in one place: the options that actually exist today, what each one costs you, and the numbers that tell you where on-device AI stops making sense.
Why bother running AI on the phone?
Four reasons, and they're all pretty concrete:
- Privacy. Health notes, private chats, financial details. If the model runs locally, that data never touches your server, which also makes your privacy policy a lot shorter.
- Offline. Field apps, travel apps, anything used in places with bad signal.
- Cost. Cloud tokens add up fast once you have real users. On-device inference costs you nothing per request.
- Latency. There's no network round trip, so short responses can feel instant.
The trade-off is that phone models are small. They're great at focused jobs like summarising a message, suggesting a reply, pulling structured data out of text or classifying something. They're not going to replace a frontier cloud model for long, complex reasoning.
Two ways to do it
Everything in this space falls into one of two buckets.
1. Use the model that's already on the phone. Apple and Google now ship their own models inside the operating system. You don't download anything, and the OS handles memory and updates.
2. Bring your own model. You pick an open model (Llama, Qwen, Gemma, Phi and so on), download it to the device, and run it with a library.
Most real apps will end up using a bit of both.
Option 1: Apple Foundation Models
Apple's on-device model is about 3 billion parameters, trained with 2-bit quantization so it fits comfortably on a phone. That's from Apple's own 2025 technical report.
At WWDC in June 2026, Apple expanded it a lot for iOS 27:
- the on-device model now accepts image input
- eligible small developers (App Store Small Business Program, under 2 million first-time downloads) can use Apple's larger server model on Private Cloud Compute at no cloud API cost
- the same Swift API can now be backed by other providers, like Claude or Gemini, through a new language model protocol
- a separate new framework, Core AI, is for running your own custom models on device
From React Native, the easiest way in is Callstack's @react-native-ai/apple package, which plugs Apple's model into the Vercel AI SDK:
import { apple } from "@react-native-ai/apple";
import { generateText } from "ai";
const { text } = await generateText({
model: apple(),
prompt: "Summarise this message in one sentence: ...",
});
That's it. There's no model to download because it's already part of iOS. The catch is the requirements: text generation needs iOS 26 or newer and a device that supports Apple Intelligence. So you'll always need a fallback for older iPhones. I'd also check the package's changelog before relying on the new iOS 27 features from React Native, since native APIs usually land in wrappers a little later.
Option 1, Android side: Gemini Nano
On Android, Google's equivalent is Gemini Nano, available through ML Kit's GenAI Prompt API. It takes text, or an image plus text, and returns text or structured output. The model is managed by the system through AICore, so you don't ship it yourself.
Two honest caveats. First, Google labels the Prompt API as beta, with no SLA or deprecation policy, and structured output is still alpha. Second, it isn't on every Android phone. When Google launched it, they said it performed best on the Pixel 10 series. Plan for it to be missing on a lot of your users' devices.
I couldn't find an official React Native wrapper for the Prompt API, so in practice you'd write a small native module or use a community package. If you're comfortable with Expo Modules, it isn't a huge job.
Option 2: Bring your own model
This is where React Native has really caught up. Three libraries are worth knowing.
| Library | Runs | Good for | Things to know |
|---|---|---|---|
| react-native-executorch (Software Mansion) | Meta's ExecuTorch | LLMs, vision, speech-to-text, text-to-speech, OCR, embeddings | Needs New Architecture, React Native 0.83+ or Expo SDK 55+ with a development build, iOS 17+ and Android 13+ |
| llama.rn | llama.cpp | Any GGUF model | Huge model choice, low-level control |
| MLC (through Callstack's React Native AI packages) | MLC LLM | Open LLMs with GPU acceleration | Needs the "Increased Memory Limit" capability on iOS. Memory needs range from 1 to 8 GB depending on the model |
If I were starting today, I'd try react-native-executorch first. It covers much more than text, it ships pre-exported models from Software Mansion's Hugging Face collection, and its hooks handle downloading, caching and cleanup for you. Based on the README's chat example, which uses the LFM2.5 1.2B model:
import { useLLMChatSession, models } from "react-native-executorch";
const session = useLLMChatSession(models.llm.LFM2_5_1_2B.DEFAULT);
// session.isReady becomes true once the model has downloaded and loaded
I'd pick llama.rn if I needed one specific GGUF model, since most popular open models get a GGUF version quickly.
Callstack's ai packages are worth a look either way. They put Apple's model, llama.rn and MLC behind the same Vercel AI SDK interface, which makes it easy to swap engines later.
How big is a model, really?
This is the first question your users will feel, because they have to download it. There's a simple rule of thumb: parameters × bits per weight ÷ 8.
Approximate size of model weights at 4-bit quantization
In gigabytes (GB). Weights only: real downloads are a bit larger, and apps need extra memory while running.
1B parameters
1.5B parameters
3B parameters
8B parameters
Calculated as parameters × 4 bits ÷ 8. For comparison, Apple's ~3B on-device model uses 2-bit quantization, which by the same maths is roughly 0.75 GB of weights.
View data as a table
| Measure | Size of weights (GB) |
|---|---|
| 1B parameters | 0.5 GB |
| 1.5B parameters | 0.75 GB |
| 3B parameters | 1.5 GB |
| 8B parameters | 4 GB |
Source: Apple Intelligence Foundation Language Models Tech Report 2025
So a 1 to 3 billion parameter model is a few hundred MB to about 1.5 GB. That's fine for an app where AI is the main feature. It's a lot to force on someone who just wants to send a message.
What I'd do in practice: don't bundle the model in the app binary. Download it the first time someone uses the feature, on Wi-Fi if possible, with a progress bar and a clear explanation of why. react-native-executorch's hooks already expose download progress, which helps.
The part nobody puts in the demo: heat
Short benchmarks make phones look fast. Long sessions tell a different story.
A 2026 study ran the same 4-bit Qwen 2.5 1.5B model on phones for 20 back-to-back iterations and measured what happened as they warmed up:
Phones slow down as they heat up
Decode speed in tokens per second · Qwen 2.5 1.5B (4-bit), 20 back-to-back runs
- Peak
- Sustained
iPhone 16 Pro (MLX, GPU)
Galaxy S24 Ultra (MLC, GPU)
The two phones used different runtimes, so this is not a fair phone-versus-phone comparison. The point is the drop: about 41% on the iPhone and about 15% on the Galaxy as they reached a steady temperature.
View data as a table
| Measure | Peak | Sustained |
|---|---|---|
| iPhone 16 Pro (MLX, GPU) | 40.5 tok/s | 23.7 tok/s |
| Galaxy S24 Ultra (MLC, GPU) | 12.2 tok/s | 10.4 tok/s |
Source: Tummalapalli et al., LLM Inference at the Edge (2026)
The iPhone lost about 41% of its speed as it warmed up. The Galaxy dropped about 15% to a steady plateau. The researchers' conclusion was blunt: on phones, "thermal management supersedes peak compute as the primary constraint."
For app design, this means a few things:
- Keep prompts and outputs short. On-device models are best for quick jobs, not essays.
- Stream tokens to the screen so the wait feels shorter.
- Don't run inference in a tight loop in the background. You'll drain the battery and heat the phone.
- Test on a mid-range Android phone, not just your new iPhone.
When on-device AI makes sense
After all of this, my rule of thumb is pretty simple.
Good fits:
- smart reply suggestions in a chat app
- summarising a long message or note
- turning messy text into structured data (a date, an amount, a category)
- tagging or classifying content
- features that must work offline or must not send data to a server
Better in the cloud:
- long conversations and complex reasoning
- anything that needs current knowledge from the internet
- features that must work the same on every phone, including old ones
And the most realistic answer for most apps is both. Try the on-device model first, and fall back to the cloud when it isn't available or the task is too big. Because the Vercel AI SDK treats models as swappable, the code stays small:
import { generateText } from "ai";
import { apple } from "@react-native-ai/apple";
// cloudModel is any AI SDK model you already use on the server side
const model = deviceSupportsOnDeviceAI ? apple() : cloudModel;
const { text } = await generateText({ model, prompt });
You'd want to check availability properly and handle errors, but that's the shape of it.
Where I'd start
If you want to try this on a real project this week, here's what I'd do:
- Pick one small, contained feature. Smart replies or message summaries are perfect.
- Build it with Apple's model through
@react-native-ai/applefirst, since there's nothing to download. - Add react-native-executorch with a small model (around 1B parameters) for Android and older iPhones.
- Keep a cloud fallback for everything else.
- Test it for ten minutes straight on a mid-range Android phone and watch what happens to speed and temperature.
On-device AI isn't going to replace cloud models anytime soon. But for the right features it's faster, cheaper and kinder to your users' privacy, and in 2026 it's finally something a React Native developer can ship without a research team.
If you've shipped something with on-device AI in React Native, I'd love to hear what worked and what didn't. Find me on LinkedIn or send me a message through the contact page.
FAQ
Can you run an LLM on a phone with React Native?
+
Yes. You can call the phone's built-in model (Apple Foundation Models on iOS, Gemini Nano on supported Android phones) or ship your own small model with a library like react-native-executorch, llama.rn or MLC. Small models in the 1 to 3 billion parameter range are the practical sweet spot today.
Does on-device AI work in Expo Go?
+
Usually not. Libraries like react-native-executorch need native code and the New Architecture, so you need an Expo development build (Expo SDK 55 or newer for react-native-executorch), not Expo Go.
How big is an on-device AI model?
+
Roughly the number of parameters times the bits per weight, divided by eight. A 1 billion parameter model at 4-bit is about 0.5 GB of weights, and a 3 billion parameter model is about 1.5 GB. Real downloads are a little bigger, and the app needs extra memory while running.
Is on-device AI faster than cloud AI?
+
It has no network round trip, so the first word can appear quickly, but phones slow down as they heat up. In a 2026 study, an iPhone 16 Pro dropped from about 40 to about 24 tokens per second under sustained load. For long or heavy tasks, cloud models are still faster and smarter.
Which is better for React Native: ExecuTorch or llama.rn?
+
react-native-executorch covers more than text (vision, speech, OCR and embeddings) and ships pre-exported models. llama.rn runs GGUF models through llama.cpp, which gives you a huge choice of models and fine control. Pick ExecuTorch for breadth and convenience, llama.rn if you want a specific GGUF model.
Sources
- Apple: Apple aids app development with new intelligence frameworks and advanced tools (June 2026)
- Apple Intelligence Foundation Language Models Tech Report 2025
- Google: Send custom requests to Gemini Nano with the GenAI Prompt API
- Android Developers Blog: ML Kit's Prompt API alpha release (October 2025)
- Software Mansion: react-native-executorch on GitHub
- Callstack: React Native AI (ai) on GitHub
- Tummalapalli et al.: LLM Inference at the Edge, Mobile, NPU, and GPU Performance Efficiency Trade-offs Under Sustained Load (2026)