Two lines to your first generation
The same call works across Apple Foundation Models, Android Gemini Nano and your cloud backend. Capability detection and fallback are handled for you.
import { ExpoAI } from "@stewmore/expo-ai-core";
const { text, provider, privacy } = await ExpoAI.generate({
prompt: "Summarize this in one sentence.",
});
// text -> the model output
// provider -> which engine answered (e.g. "apple-foundation-models")
// privacy -> { isOnDevice, sendsPromptOffDevice, privacyMode }
The packages
A pure-TypeScript core plus thin native adapters. Import only what your app needs.
expo-ai-core
TypeScript@stewmore/expo-ai-coreThe pure-TS heart: the ExpoAI API, adapter contract, provider router, capability registry, sessions, structured output, privacy and normalized errors.
apple-foundation-models
iOS@stewmore/expo-ai-apple-foundation-modelsiOS adapter wrapping Apple’s on-device FoundationModels framework. Requires iOS 26+ with Apple Intelligence.
android-aicore
Android@stewmore/expo-ai-android-aicoreAndroid adapter for Gemini Nano via ML Kit GenAI / AICore, including on-device model download.
cloud
TypeScript@stewmore/expo-ai-cloudOpt-in cloud fallback client adapter. POSTs to a configurable backend with streaming, for prompts that aren’t marked sensitive.
expo-ai-react
React@stewmore/expo-ai-reactReact hooks for the ExpoAI API.
evals
Node@stewmore/expo-ai-evalsNode-first eval harness: provider comparison, schema validity, latency, fallback frequency and privacy-boundary checks.