MLC LLM + React Native: On-Device AI Without the Pain

Teachers
Artur Morys-Magiera
Software Engineer
@
Callstack

On-device AI does not have to be limited to models shipped with the operating system. In this episode of React Native AI Unpacked, we focus on the MLC runtime and show how React Native apps can run third-party large language models directly on the device without giving up performance, portability, or developer experience.

This episode explains how MLC LLM works as a universal inference engine and why it enables a different level of flexibility compared to built-in models. Instead of adapting your app to a single vendor or hardware target, you can choose the models you want, bundle them with your app, and rely on MLC to optimize execution for each device.

Using React Native AI with the MLC runtime, you can build applications that run fully on-device across iOS and Android while keeping the same JavaScript API you already use with the Vercel AI SDK.

Running third-party models on-device

The episode starts by introducing MLC LLM as a general-purpose engine for on-device inference. Rather than shipping a fixed model with the operating system, MLC allows you to decide which models your app uses and compile them into the application in an optimized form.

This approach gives you control over model size, capabilities, and behavior. You are not restricted to system-provided models and can instead use open-source models or your own fine-tuned variants, including models distributed through platforms like Hugging Face.

Performance across hardware and platforms

A core part of this episode is understanding how MLC achieves high performance across a wide range of devices. MLC applies advanced optimization techniques such as memory planning, operator fusion, hardware-specific tuning, and library offloading to ensure inference runs efficiently.

The same generated code can take advantage of GPUs on capable devices using drivers like OpenCL or Vulkan, while still running efficiently on lower-end hardware by relying on optimized CPU instruction sets. This makes it possible to deploy the same AI-powered features across phones, tablets, desktops, and even the web.

A consistent developer experience with the AI SDK

React Native AI’s MLC package integrates directly with the Vercel AI SDK, which means you do not need to learn a new API to work with third-party on-device models. The JavaScript interface stays the same whether you are using Apple’s built-in models or MLC-powered models.

Because the API remains consistent, switching runtimes becomes a configuration choice rather than a rewrite. This makes it easier to adapt your app to different platforms, devices, or future runtimes without changing application logic.

Model selection and lifecycle management

The episode demonstrates how model selection works in practice. Available models are declared ahead of time and can be downloaded, prepared, and instantiated at runtime. Once a model is downloaded and prepared, it can be reused across sessions with minimal startup cost.

You can dynamically choose which model to run, prepare it once, and then interact with it using the same APIs for text generation, streaming output, and structured results.

Text generation, streaming, and structured output

Beyond basic text generation, this episode shows how MLC models can be used with streaming output and structured responses. Streaming allows tokens to appear as they are generated, while structured output enforces a predefined schema for model responses.

Structured output makes it possible to integrate model responses directly into application logic, enabling features like typed data extraction, form generation, and custom workflows driven by AI-generated data.

Building flexible on-device AI features

By combining MLC LLM with React Native AI and the AI SDK, you can build on-device AI features that are portable, configurable, and performant. This episode shows how third-party models fit into the same architecture as built-in ones, allowing you to choose the right runtime for each use case without changing how your app is written.

If you need flexibility in model choice while keeping a stable API and strong performance across platforms, this episode provides the foundation for building those capabilities into your React Native applications.

‍

Insights

Learn more about AI

To React or Not to React? Expo Exact vs. NitroUI

Dec 3Live Stream

To React or Not to React? Expo Exact vs. NitroUI

NitroUI puts React on the UI thread. See how it compares with Expo Exact through a 2,000-row list test, native rendering trade-offs, and AI coding workflows.

NitroUI Puts React on the UI Thread

Dec 2Article

NitroUI Puts React on the UI Thread

NitroUI lets your React team build native iOS and Android apps with lists that scroll without blank rows and text inputs that stay in sync. We explain how running React on the UI thread makes this possible, why we built a new framework, and how your team can adopt it one screen at a time while keeping existing React logic and native code.

Re.Pack Cut Expensify's Warm Production Bundling by 82%

Dec 2Article

Re.Pack Cut Expensify's Warm Production Bundling by 82%

Expensify's move from Metro to Re.Pack cut warm production bundling from 11 seconds to 2 and brought web and native onto shared Rspack and React Compiler tooling. See how the team handled compatibility and rolled out the change.

When to Build a Custom AI Model? RAG vs. Fine-Tuning

Nov 27Article

When to Build a Custom AI Model? RAG vs. Fine-Tuning

Start with a base model. Add RAG when answers depend on current information, and test fine-tuning when a specific failure persists even with the right context. A React Native chatbot that picks up a policy update in SQLite and a support assistant that mishandles a customer’s change of request show when to use each approach or combine them.

How an AI-SDLC Audit Helps You Decide What to Automate First

Nov 26Article

How an AI-SDLC Audit Helps You Decide What to Automate First

An AI-SDLC audit will help your team decide where automation is worth the investment before you commit to a build. Follow a deployment lookup that starts with a testing ticket, from a specific problem statement to an agent design and a proposed pilot. See what the three audit deliverables give your team and how to evaluate the workflow afterward.

Maestro vs e2e: Who Wins Mobile Testing in 2026

Nov 23Article

Maestro vs e2e: Who Wins Mobile Testing in 2026

Cristian Ceban ports two React Native test suites from Maestro to e2e and compares execution on GitHub Actions, Expo Services Workflows, and a local Mac. The results separate framework performance from host effects and examine migration effort and reliability limits.

Building a Software Factory: AI Reviewers That Don’t Share the Writer’s Blind Spots

Nov 19Article

Building a Software Factory: AI Reviewers That Don’t Share the Writer’s Blind Spots

A reviewer produced 155 confirmed findings and five rounds of work. Szymon Chmal explains how that experience shaped Simlock’s review process, from specialist agents and verified findings to targeted rechecks and historical replays.

Nov 12Live Stream

Mobile Development, Plugins & AI-Powered Workflows

Join Kewin Wereszczyński and Hanno Gödecke on November 12 for live demos and a discussion of the Mobile Dev plugin and AI-powered mobile workflows.

Building the React Native Software Factory — cover

Nov 11Talk

Building the React Native Software Factory

Join us at React Foundation Meetup London on November 11 to explore how AI agents build and debug React Native apps, from one terminal to the cloud.

Harness Engineering: Context, Skills, and Reliable AI Workflows

Nov 10Podcast

From Prompts to Harnesses: Building Reliable AI Workflows

Amazon’s Anisha Malde joins Łukasz Chludziński to discuss harness engineering, agent skills, and how AI is changing cross-platform development.

cover

Oct 14Podcast

When Coding Gets Faster, What Breaks Next?

Matt Hargett explains how AI moves bottlenecks across testing, deployment, infrastructure, support, and the rest of software delivery.

cover

Oct 12Podcast

AI Coding Agents and Hermes With Tzvetan Mikov

Tzvetan Mikov discusses AI coding agents, context switching, low-level engine optimization, reviewing specs and tests, and his plans for Hermes X.

cover

Mar 19Tutorial

The Hard Way vs. The React Native AI SDK Way: Stop Writing Custom Modules for Every Model

Learn how React Native AI uses a unified provider model to switch between cloud and on-device LLMs without rewriting application logic, enabling reliable AI experiences online and offline.

cover

Mar 12Tutorial

Build Smarter Apps: Tool Calling & AI Orchestration Explained

Learn how on-device models in React Native can call tools, interact with external APIs, and return structured outputs you can use directly in application logic.

cover

Mar 5Tutorial

MLC LLM + React Native: On-Device AI Without the Pain

Learn how to run third-party on-device LLMs in React Native using MLC LLM. Choose your models, run them efficiently across platforms, and keep a unified JavaScript API with React Native AI.

cover

Feb 24Tutorial

Intelligent Fallbacks with Apple Intelligence in React Native

Learn how to use Apple’s built-in Foundation Models in React Native apps, reduce memory usage, and enable fast, fully on-device AI with React Native AI Apple.

cover

Feb 10Tutorial

What Is the React Native AI SDK? A Complete Intro & Quickstart

Learn why on-device AI matters for React Native apps, how local LLMs behave offline, and what problems React Native AI is designed to solve from day one.

cover

Jan 29Tutorial

Implementing an Android TurboModule with Kotlin

Learn how to implement a React Native TurboModule on Android, from the TypeScript spec and Codegen to the Kotlin implementation and package registration.

cover

Jan 19Tutorial

Working with Different Threads in Swift TurboModules

Learn how JavaScript, native module, background, and main threads interact in React Native TurboModules, and how to use GCD queues to run async work safely in Swift.

cover

Jan 9Tutorial

How to Add Type-Safe Constants to Swift TurboModules

Learn how to expose typed, immutable constants from a Swift TurboModule using Codegen, and get full end-to-end type safety between native and JavaScript.

cover

Dec 30Tutorial

Adding Event Emitters to Your TurboModule in Swift

Learn how to emit native events from a Swift TurboModule and subscribe to them in JavaScript, including proper memory management and Codegen integration.

Writing a Swift TurboModule in React Native

Dec 22Tutorial

Writing Your First TurboModule in Swift

Learn how to build a fully working TurboModule in Swift, integrate it with Codegen, and bridge it through Objective‑C inside an Expo app.