WhoBuilt

LLM Inference On-Device in React Native: The Practical Aspects

Feb 18, 2026· 31 min· 275 views·Watch on YouTube

Speaker

Artur Morys-Magiera, senior React Native engineer at Callstack and PhD candidate at AGH University, discusses practical choices for on-device LLM inference at the React Universe meetup with Zalando.

Why run models on-device

Artur identifies reliability, privacy, and latency as reasons to run inference on a device. Offline operation avoids dependence on a service provider or network, while local processing keeps data from being sent to a third party. It can also avoid cloud queues and provider downtime.

Balance model size and performance

Models can consume several gigabytes of storage; Artur gives unquantized Llama as an example at roughly five to six gigabytes. OS-provisioned models such as Apple Foundation Models avoid separate app downloads, while GPU and NPU acceleration can improve performance. A case study showed initialization taking about a second on one device but 47 seconds on another, traced to inefficient transpose operations in an OpenCL backend.

Compare React Native inference libraries

Artur compares React Native Fast TFLite, ONNX Runtime React Native, ExecuTorch, and providers in the React Native AI ecosystem. They differ in model formats, hardware backends, platform and OS support, and whether they include tokenization and sampling. React Native AI providers share an interface compatible with the Vercel AI SDK, while Apple Foundation Models require iOS 26 or later for text generation and transcription.

Plan for devices and models

For developers, model compatibility and device capability shape the choice of runtime. Artur recommends considering smaller models for lower-end devices and describes quantization as a way to reduce memory use, with some loss of precision. Compile-time techniques such as operator fusion and memory layout optimization can also improve inference.

Use shared APIs and tracing

The React Native AI providers let developers replace a cloud provider with a local model through a shared AI SDK interface. Custom providers may require downloading and preparing a model first, after which the SDK can handle text generation. Artur also describes OpenTelemetry traces routed through React Native DevTools tooling to inspect generation, streaming, tool calls, and metrics.

Takeaways

  • Choose on-device inference when offline access, local data handling, or avoiding cloud latency matters to users.
  • Include model downloads and storage in the product decision, especially when users may install multiple apps with separate model copies.
  • Benchmark initialization and token generation across representative devices; hardware acceleration can behave very differently across chips.
  • Check each runtime's model formats, tokenizer support, platform requirements, and accelerator backends before committing to it.
  • Use smaller or quantized models for constrained devices, and trace inference to find performance bottlenecks.

Mentioned in this talk

Search inside this talk

What was claimed 18

Related talks