expo-local-llm
An Expo module that wraps Apple's on-device Foundation Models on iOS and Google's Gemini Nano through ML Kit on Android behind one on-device LLM inference API for React Native apps.
expo-local-llm is an Expo module for on-device large language model inference, wrapping Apple Foundation Models (iOS 26+, with Apple Intelligence enabled) and Gemini Nano through ML Kit on Android devices that support it, such as Pixel 8+ and Galaxy S25+.
On iOS 26 and later it supports tool calling and structured output using Apple's constrained decoding, guaranteeing a response that matches a given JSON schema; Android falls back to instruction-based guidance for structured output. A generate() function handles one-shot structured calls such as classification or extraction without accumulating conversation history, alongside streaming with progressively filled JSON snapshots.
It requires Expo SDK 52 or later (tested against SDK 56 and 57) and a minimum iOS deployment target of 16.4, configurable through expo-build-properties; on older iOS versions or unsupported Android devices, calls return a notEligible status instead of crashing.