software-mansion/react-native-executorch
High-performance, privacy-first on-device AI inference library for React Native, powered by PyTorch's ExecuTorch runtime
React Native ExecuTorch – On‑device AI for React Native apps
What it is – A React Native library that wraps Meta’s ExecuTorch runtime, letting mobile apps run machine‑learning models directly on the phone. No network calls are needed, so inference is offline and user data never leaves the device.
Key capabilities
- Hardware acceleration: uses XNNPACK (CPU), Core ML/MLX on Apple Silicon, and Vulkan on Android GPUs.
- Two‑layer API:
- Ready‑made React hooks like
useLLMChatSession,useImageClassification, etc., for common tasks (LLMs, vision, speech, embeddings) with automatic model download, caching and lifecycle handling. - Low‑level TypeScript API exposing tensors, operators and worklet‑based threading for custom pipelines.
- Ready‑made React hooks like
- Model catalog: pre‑exported
.ptemodels (vision, language, TTS, transcription) hosted on a Software Mansion Hugging Face collection; you can also load your own exported models. - Full offline privacy – after the initial model download there is zero cloud dependency.
Getting started
- Install the package and its native peers (
react-native-worklets,react-native-blob-util). - Use a hook, e.g.
useLLMChatSession(models.llm.LFM2_5_1_2B.DEFAULT), then callsession.sendMessageto generate text. - The library requires React Native 0.83+ (or Expo SDK 55+ with development builds), New Architecture, iOS 17+/Android 13+, and the worklets Babel plugin.
Where to learn more – Full docs, guides and API reference at docs.swmansion.com/react-native-executorch. A demo gallery app shows the hooks in action.
Who’s behind it – Developed by Software Mansion, a long‑standing React Native consultancy that also ships the privacy‑first mobile AI app Private Mind using this library.
This summary is based solely on the repository’s README.
Related
- Project
- Project
- Dispatch
- Project
- Project