On-Device AI for React Native: Bringing Intelligence to the Phone

For the past few years, adding AI to a mobile app meant sending data somewhere else. The app collected what the user typed, sent it to a server, waited, and showed the reply. This works, but it comes with real costs. There is the delay of the network trip. There is the running bill for every request. There is the privacy question of user data leaving the phone. The feature also stops working the moment the network drops.

Things have changed recently. AI models have become small enough to run on a phone, and the mobile platforms have added the tools to run them. So a new option has opened up for React Native teams. You can now run the model on the device itself. This post explains what that means and what your choices are.

What On-Device AI Means

On-device AI simply means the model runs on the user’s phone instead of on a remote server. The data stays on the device. The reply is generated locally. No information needs to travel over the network for the AI task to work.

Two developments made this practical. The first is smaller models. Modern models can be compressed, or quantized, so they fit inside the memory a phone can spare. A useful rule is that a 4 bit quantized model needs a little over half its parameter count in gigabytes of memory, plus some room for the conversation. That puts a 1 billion parameter model well within reach of today’s phones. The second is that the phone platforms now ship the runtimes, and in Apple’s case an actual built in model, to make this work.

It helps to be clear about the trade off. On-device models are smaller and less capable than the large cloud models, and they can only hold a short amount of text at a time. So this is not a full replacement for the cloud. It is a useful layer that sits alongside it.

Why It Is Worth Doing

Running the model on the phone gives you a few clear benefits. Privacy improves, because sensitive user data never leaves the device. This makes it easier to meet rules like GDPR and HIPAA. Speed improves, because there is no server trip, so replies feel instant. Cost drops, because there are no fees for each request. And the feature keeps working offline, which matters in a factory, on a plane, or anywhere the signal is weak.

Option 1: React Native First Libraries

If your team works mainly in JavaScript and TypeScript, the simplest path is a library made for React Native.

The leading choice is React Native ExecuTorch, built by Software Mansion, the team behind Reanimated and Gesture Handler. It offers a declarative way to run AI models on the device in React Native, and it is powered by ExecuTorch, a framework from Meta that lets AI models run on devices like phones. The setup is friendly. A ready made text generation hook takes care of loading the model, streaming the reply, and managing memory, and a separate hook handles speech to text on the device. There are also hooks for image classification, object detection, and text recognition. The optimized models are published on Hugging Face, so there is no conversion step to worry about. One point to plan for is that the library works only with React Native’s New Architecture.

A second option is Callstack’s react-native-ai, which is built around the Vercel AI SDK. If your project already uses that SDK, or you want to switch between a cloud provider and a local model, it gives you the same text generation and streaming functions you already use. It offers three providers to pick from: a Llama provider for GGUF models on iOS and Android, an Apple provider for iOS 26 and above, and an MLC provider for compiled models on both platforms. This makes it easy to keep one way of calling the model while deciding, feature by feature, whether it runs locally or in the cloud.

If you want the model to answer using your own documents, Software Mansion also offers on-device retrieval support that runs on top of ExecuTorch and can store the search index locally on the device.

Option 2: Native Platform Frameworks

The phone makers now offer their own on-device features, which you reach from React Native through a small native module.

On Apple’s side, the Foundation Models framework is the big one. It is a native Swift API that gives your app direct access to the same on-device model that powers Apple Intelligence. The key point is that it uses Apple’s own built in model of about 3 billion parameters, so you do not download a model file, but you also cannot bring your own. For app teams this is attractive, since the model is private, offline, and free to use. At its 2026 developer conference Apple went further and added the ability to send images along with text, plus on-device tools like text recognition and barcode reading that the model can call directly. One caveat to plan around is availability. At launch, parts of Apple Intelligence are not available on iPhone and iPad in the EU, and the feature set is unavailable in mainland China while regulatory approval is pending.

For Android and cross platform work, Google’s tools are built on LiteRT, the runtime once called TensorFlow Lite, together with MediaPipe. Google’s AI Edge Gallery is an open source demo app for both iOS and Android that shows what this stack can do, running the open weight Gemma family of models. It is meant as a place for developers to experiment rather than a finished product, but the runtime underneath is what you would build real features on.

Option 3: The Established ML Runtimes

Not every feature needs a language model. For everyday machine learning tasks, older and well tested runtimes have supported React Native for a while. TensorFlow.js and ONNX Runtime Mobile both have React Native bindings, and small models for tasks like classification, text recognition, object detection, and keyword spotting run on the device without any network trip. For a field app, this means a worker can scan a code or check sensor data even where the signal is poor.

Conclusion

On-device AI is no longer just an idea for React Native. The runtimes are ready, the libraries are simple to use, and the models are small enough to fit. The practical way forward is a mix rather than a single choice. Use the on-device model for the fast, free, offline tasks, and fall back to a cloud model when the job is too hard for a small model. React Native ExecuTorch is a solid starting point for most teams, Callstack’s react-native-ai suits those already using the Vercel AI SDK, and Apple’s Foundation Models framework is worth using on capable iPhones as long as you plan for its regional gaps. The interesting question has shifted from whether we can run AI on the phone to where each piece of intelligence should live.

Author Details

Subramaniam Balasubramaniam

Technology Architect with 15+ years’ experience driving application architecture and digital experiences using React Native, Xamarin, and .NET

Leave a Comment

Your email address will not be published. Required fields are marked *