Want to Run LLMs on Your Device? Meet MLC

Running ChatGPT or any other large language model locally on your device is a dream for many. But before that dream becomes reality, there are quite a few hurdles to clear. Some, like hardware limitations or the quality of available models, are out of our hands. Others, like how the model is prepared, delivered, and executed on the device, are problems we can tackle.

And if local LLMs are your goal, I’ve got good news—MLC might be exactly what you need.

What is MLC?

MLC stands for Machine Learning Compilation. At first glance, you might think it just compiles the model—but it actually goes further. It also compiles the runtime, which caught me off guard. I assumed it was just the model getting optimized, but when you think about it, it wouldn’t make sense to also ship every utility function along with it.

And since we’re talking about mobile and edge devices, every bit of optimization counts. But MLC doesn’t stop at mobile—it targets any environment that can run C++.

How does it work?

MLC analyzes your model’s architecture, figures out which functions are needed to run it, and then compiles both an optimized version of the model and a custom runtime. Since that runtime uses C++, it can run in just about any environment.

In layman’s terms, imagine following a cooking recipe. Before you start cooking, you grab the ingredients from the fridge. Now imagine the “fridge” is a massive library of functions, and the “recipe” is your model’s architecture.

And let’s be honest—sometimes recipes call for super complex ingredients, fancy techniques, or rare tools. But we don’t always need those. We just want the end result. That’s what MLC does—it finds all the “we don’t need that” parts and simplifies them.

In the end, we’re left with clean ingredients and a streamlined recipe, and we’re ready to cook (aka: run inference). And the best part? Now that recipe works in any kitchen.

What does this look like in practice?

Let’s say you want to run a quantized 3B LLM on your Android phone.

With MLC, you would:

  • Convert the model (e.g., LLaMA or Mistral) into the correct format using MLC’s model converter,
  • Compile the runtime for your target platform (e.g., Android, Web, macOS),
  • Bundle both into your app and use MLC’s C++ or JavaScript bindings to call it.

In the end, you get something like this in your mobile code when using our react-native-ai library, integrated with ai-sdk:

const { textStream } = streamText({
      model: getModel(modelId),
      temperature: 0.6,
      messages: messages
});
Cooking a meal for an army... or AI for mobile

Can it run on your device?

One of the most common questions I’ve seen on social media (and from my colleagues): “Will this library let me run an LLM on my low-end device?”

Short answer: it’s not really about the library—it’s about the model.

Let’s jump back into the kitchen for a second.

You’re at home, cooking a meal. Suddenly, someone asks you to feed an army. No matter how good your tools or prep are, there’s a hard limit to what your kitchen can handle. It’s the same with LLMs.

When you see a “3B” model, “7B”, or “70B”, think of cooking for a small party (3B), a packed club (7B), or an entire stadium (70B).

MLC helps create the best conditions—smart practices, runtime optimization—to run a model on your device. But some models are just too big. They’ll run slow, stutter, or even crash your device. That’s reality.

Still, if you stay within your limits… your kitchen can start to feel Michelin-star-worthy.

MLC helps create the best conditions, but sometimes models are just too big

Why do we like MLC?

There are other frameworks that aim to bring machine learning to edge devices—like TensorFlow Lite, ONNX Runtime, or Core ML (on Apple devices). These solutions also offer optimizations, and they often come with strong backing from big tech companies.

However, MLC stands out in a few key ways:

  • It compiles not just the model, but also the runtime, making the result more lightweight and optimized for your specific target.
  • It’s designed to work cross-platform, not just Android or iOS. If it supports C++, it supports MLC.
  • It’s completely open-source, meaning you can dig into the internals or customize it however you want.

While the ecosystem around MLC is still growing, it brings a unique blend of portability, performance, and flexibility that’s hard to find in other tools.

Right now, it’s focused on LLMs. But at the end of the day, all models—whether vision, audio, or analysis—are just math ops stacked into layers. So maybe, in the future, this same framework could power every kind of model.

And that’s something worth getting excited about.

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.

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 9Article

How to Maximize AI SDLC? Measure the Outer Business Loop, Not the Inner Developer Loop

Connect AI-assisted development to measurable business outcomes. Matt Hargett shares a checklist for assessing user exposure, results, and delivery costs.

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.