On-device AI / ML
draftedconfidence: lowearly: 2/14 of this tier graded so far (0 overturned) — the public scorecard →
recommendation
Cross-platform on-device models → react-native-executorch; Apple-only → @react-native-ai/apple; local RAG → react-native-rag. Fast-moving (confidence: low) — validate on-device perf before committing.
- offline speech-to-text → expo-speech-recognition, or whisper.rn for whisper.cpp/Parakeet models
- private/offline LLM over local docs → react-native-rag, or roll it yourself with @react-native-ai/llama + nitro-sqlite/sqlite-vec; budget RAM for generator + embedder TOGETHER (see reading)
Low confidence — fast-moving or lightly-vetted domain: treat the pick as a vetted lead and prototype before committing.
Options & tradeoffs
| option | tradeoff | evidence |
|---|---|---|
| react-native-executorch | on-device models (Meta ExecuTorch); v0.8 adds VLM + runOnFrame worklet w/ Vision Camera; tool-calling/embeddings since 0.4, OCR since 0.3 | 14k/wk |
| @react-native-ai/apple | Apple on-device LLM + SpeechAnalyzer (iOS 26); zero cloud; RN 0.80+ (preview) | |
| @react-native-ai/adk | Google Gemini on ANDROID via the Agent Development Kit — on-device Gemini Nano + cloud models behind one Vercel-AI-SDK provider; tool calling + streaming; same react-native-ai family as the Apple provider (v0.12) | |
| react-native-nitro-mlx | Apple MLX on-device LLM + TTS/STT via Nitro Modules, with tool calling (ChatSession API); iOS 26+ ONLY; v0.5, ~100★ — niche/early | 60/wk |
| react-native-rag | on-device retrieval-augmented generation over ExecuTorchLLM; local vector store | 428/wk |
| @react-native-ai/llama | llama.cpp behind the Vercel AI SDK provider interface (v0.12.0, verified vs npm 2026-08-18) — runs GGUF chat AND embedding models on one engine/one dependency, which is what makes a hand-rolled local RAG pipeline (embed + generate) practical; pair with react-native-nitro-sqlite + sqlite-vec for the vector store (see reading) | |
| offline speech (expo-speech-recognition / whisper.rn) | speech-to-text without network; whisper.rn (0.7.2, ~800★, verified vs npm + repo 2026-07-28) is the concrete binding — whisper.cpp under the hood, and it now also carries NVIDIA Parakeet ASR alongside Whisper |
npm weekly downloads (from the corpus's last signals run): react-native-executorch 14k · @react-native-ai/apple 18k · @react-native-ai/adk 208 · react-native-rag 428 · react-native-nitro-mlx 60
Verified notes
Fast-moving area surfaced across multiple RN Rewind issues; recommend tentatively (confidence: low) and validate on-device before committing.
Canonical reading
Editorial annotations on why each piece matters — the articles themselves are the originals; read them there.
The build behind this entry's react-native-rag / local-RAG option rows, done by hand so every constraint is visible: a WhatsApp export chunked, embedded and searched entirely on a $100 Android phone in airplane mode. The stack is one engine and one store — @react-native-ai/llama (llama.cpp) runs BOTH the embedder and the generator, and react-native-nitro-sqlite statically links sqlite-vec so KNN is a vec0 virtual table queried with `WHERE embedding MATCH ? AND k = ?`, no second ML runtime and nothing fetched at runtime. What makes it durable is the failure list. MEMORY IS THE CEILING, not accuracy: ~900MB usable RAM holds Qwen2.5-0.5B-Instruct Q4 (469MB) beside the 119MB embedder, and Qwen2.5-1.5B (1.07GB) hard-crashed the process with an uncatchable native OOM that JS cannot trap. The context window is paid for in KV-cache RAM, so it is capped at 4,096 tokens and a 21,000-token export is REJECTED outright ('Context is full'), not truncated — which is the whole reason retrieval exists here. Query and documents must be embedded by the same model with the same normalization, or search returns noise (the author calls this the number-one RAG pitfall). The multilingual embedder (paraphrase-multilingual-MiniLM-L12-v2, 384 dims, ~119MB at Q4) is worth its size the moment chats aren't pure English — all-MiniLM-L6 collapsed non-English messages to nearly identical vectors. Chunk boundaries are part of the data model: strip the speaker or timestamp and the model hallucinates them back. And a small model needs an explicit 'say you don't know' escape plus replayed recent turns, or follow-up questions retrieve the wrong thing entirely.
A reasoned cost/latency/privacy case for on-device TTS (Kokoro via react-native-executorch), with the economics and the tradeoffs (voice/language coverage, a custom C++ phonemizer). A durable framing for the on-device-vs-cloud decision.
Survey evidence that on-device AI is production-proven, not experimental: Apple ships multimodal-embedding photo search + hybrid Siri; Meta runs ExecuTorch in WhatsApp (network prediction), Instagram (SqueezeSAM cutouts) and Messenger (transcription); Google ships scam detection + Gemini Nano; Snapchat runs 10MB AR models. Ends in RN ExecuTorch pointers (Gemma/Qwen, ~30MB quantized Whisper Tiny STT) — vendor self-promotion, they author the lib. The durable framing: 'fine-tuning is what makes a small model good enough.'
The end-to-end build this entry's option rows only imply: a fully on-device recognition pipeline — detection → tracking → alignment → embedding → matching → liveness — on VisionCamera 5 frame processors, with ONNX Runtime (CPU/XNNPACK) for inference and Reanimated shared values bridging worklet and JS. Two things make it durable knowledge rather than a tutorial. First, the architectural reason it can work at all: the frame processor gets each YUV frame synchronously on a dedicated native thread as a worklet, with no bridge serialization and no pixel copy into JS. Second, real numbers on a Galaxy S21 Ultra — YuNet detection (~230KB model) 3–6ms/frame at 128×128, SFace embedding (37MB, 19MB int8) ~29ms, ~39ms end-to-end per detection cycle, gallery matching in microseconds for 512 entries — plus the budget trick of running detection every 10th frame and letting tracking bridge the gaps. Uses ONNX Runtime rather than this entry's ExecuTorch default, which is itself a useful data point.
Sources
- github.com/software-mansion/react-native-exec…
- registry.npmjs.org/@react-native-ai/adk/latest
- github.com/software-mansion/react-native-exec…
- github.com/corasan/react-native-nitro-mlx
- github.com/mybigday/whisper.rn
- registry.npmjs.org/@react-native-ai/llama/latest
Related in ai: ai-ui · ai-devtools