MLC LLM builds and optimizes an app for the models it will run, using techniques such as memory planning, operator fusion and hardware-specific optimizations. It can use GPU drivers such as OpenCL and Vulkan, or optimize for CPU instruction sets on devices without GPU support. MLC supports platforms including iOS, Android, desktop systems and the web.
MLC LLM + React Native: On-Device AI Without the Pain
Speaker
Artur Morys-Magiera, senior React Native developer on Callstack’s R&D open source team, explains the React Native AI/MLC runtime in the React Native AI Unpacked series.
MLC lets developers use third-party models, including models from Hugging Face, or bring their own converted models. Callstack’s React Native AI/MLC package supports the AI SDK, so developers can use a consistent API across MLC, Apple’s built-in models and other runtimes. That makes it easier to switch runtimes based on an app’s needs.
The demo app lists models bundled with the library and lets users choose one. The app fetches the available models, constructs a language model, downloads it and prepares it for use. The initial download can take a while; subsequent setup takes a few seconds.
The demo shows three modes: full text generation, streaming output as tokens arrive, and structured output parsed against a schema. For structured output, the example uses the AI SDK’s `generateObject` with a Zod schema for a name and description; smaller models may sometimes produce invalid JSON. The text example uses Llama 3 with 3 billion parameters.
The examples use Vercel’s AI SDK syntax, including `generateText`, `generateObject` and `streamText`, without extra API differences to manage. Morys-Magiera describes the integration as straightforward and directs users to the documentation or GitHub issues for help.
Takeaways
- Choose the model or models your app needs, then build with MLC optimizations targeted to them.
- Plan for an internet download when a model is first installed; later setup takes a few seconds in the demo.
- Use GPU acceleration where available and CPU instruction optimizations on devices without GPU support.
- Validate structured output against a schema, since models can return invalid JSON.
- The AI SDK API can make it easier to switch between Apple and MLC runtimes.
Mentioned in this talk
Search inside this talk
What was claimed 7
- role atArtur Morys-Magiera is senior React Native and AI engineer at
Callstack“I work as a senior React Native developer at Callstack”
YouTube Verified4 sources· Talk
- featureMLC LLM: Runs on-device inference and optimizes code for selected models and available device hardware
“a universal engine for running on-device inference”
YouTube Unverified1 source· Talk
- featureMLC LLM: Supports desktop operating systems, iOS, Android, and web
“supports multiple platforms, ranging from desktop operating systems through iOS and Android to the web”
YouTube Unverified1 source· Talk
- integrates withMLC LLM integrates with Vercel AI SDK
“package has first-class support for the AI SDK”
YouTube Unverified1 source· Talk
- usesMLC LLM uses
Hugging Face
“the models are pulled from Hugging Face”
YouTube Unverified1 source· Talk
- uses
“a pretty long response from Llama 3”
YouTube Unverified1 source· Talk
- usesVercel AI SDK uses Zod
“This is a Zod schema”
YouTube Unverified1 source· Talk









