A React Native package that runs TensorFlow Lite models via Nitro Modules, with zero-copy ArrayBuffers and optional CoreML or Android GPU delegates. Models can be loaded from the bundle or URLs and swapped at runtime.
Overview
react-native-fast-tflite brings TensorFlow Lite inference into React Native apps using Nitro Modules and the native TFLite C/C++ API. Inputs and outputs use ArrayBuffer tensors; you inspect shapes externally (for example in Netron) and pass raw buffers that match each model.
You install the npm package, register `.tflite` as a Metro asset extension so models can ship in the app and change without rebuilding, then load models asynchronously from `require`, file URLs, or remote URIs. VisionCamera frame processors can resize frames to the model’s expected dimensions before inference.
Optional GPU delegates include CoreML on iOS (Podfile and Xcode setup) and GPU or NNAPI paths on Android, including Expo config plugins and manifest entries for OpenCL libraries where needed. The library documents migration from older major versions and integration with react-native-worklets in VisionCamera v5.
Key features
- Nitro Modules native bridge
- Zero-copy ArrayBuffer tensors
- Runtime model swap from assets
- Bundle or URL model loading
- CoreML delegate on iOS
- Android GPU and NNAPI delegates
- Expo config plugin support
- VisionCamera frame processor usage
Use cases
- On-device object detection in RN
- Camera frame ML inference
- Facial recognition prototypes
- Replaceable TFLite models in apps