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

Building a Software Factory: Write Specs an Agent Can Build From — cover

Nov 6Article

Building a Software Factory: Write Specs an Agent Can Build From

Learn how to research requirements, resolve open decisions, and write testable specs that AI coding agents can implement without the planning conversation.

 Large-Scale Migrations With Coding Agents: Planning, Verification, and Rollback — cover

Nov 4Article

Large-Scale Migrations With Coding Agents: Planning, Verification, and Rollback

Plan codebase migrations with coding agents using reviewable requirements, verification checks, staged rollouts, and defined rollback criteria.

Conversational Banking: From Customer Questions to Authorized Actions — cover

Nov 2Article

Conversational Banking: From Customer Questions to Authorized Actions

Explore conversational banking architecture through a card-dispute example, covering tool access, authorization, execution, observability, and human handoff.

How AI Agents Can Cut Manual QA by 30% — cover

Oct 30Article

How AI Agents Can Cut Manual QA by 30%

Explore an agentic QA workflow targeting 30% less manual effort across mobile, web, and TV, with test selection, failure triage, and validation.

Building a Software Factory: The Night My Agents Waited for Me — cover

Oct 28Article

Building a Software Factory: The Night My Agents Waited for Me

Learn how permissions, review limits, and missing product decisions stalled two overnight coding agent runs, and how their maintainer revised the workflow.

Your AI Coding Agent Still Needs an Architecture — cover

Oct 22Article

Your AI Coding Agent Still Needs an Architecture

Use explicit contracts, behavior tests, and dependency checks to guide AI coding agents and review their changes through a TypeScript favorites example.

cover

Oct 15Live Stream

Who Left the Agents Running? React Native Software Factories

Join Kewin Wereszczyński and Szymon Chmal to explore what can go wrong in a React Native software factory overnight and the controls that keep agents on track.

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

Oct 12Podcast

State Machines for AI Agents With David Khourshid

David Khourshid explains state machines for AI agents, human approval steps, tracing, and handling invalid model outputs in agent workflows.

cover

Oct 7Talk

Automating Mobile QA with Cloud Agents

Michał Pierzchała shows how cloud-based QA agents can test real iOS and Android user flows and bring screenshots, recordings, and logs into pull requests.

cover

Oct 1Live Stream

Can Jev Make AI Agent Decisions Faster?

Explore Jev with Kewin Wereszczyński and Szymon Chmal: how it works, its approach to faster agent decisions, and possible local alternatives.

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.

cover

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.