Providers & routing
A provider is a single engine the runtime can call. The router picks the best available one and, when allowed, falls back through the rest.
export type ExpoAIProvider =
| 'system-preferred'
| 'apple-foundation-models'
| 'apple-private-cloud-compute'
| 'android-aicore-gemini-nano'
| 'litert-lm'
| 'cloud'
| 'none';
Default priority
export const defaultProviderPriority: ExpoAIProvider[] = [
'apple-foundation-models',
'apple-private-cloud-compute',
'android-aicore-gemini-nano',
'litert-lm',
'cloud',
];
| Category | Provider | Purpose |
|---|---|---|
| System model | Apple Foundation Models | Preferred iOS native model path |
| System model | Android AICore / Gemini Nano | Preferred Android native model path |
| Private cloud | Apple Private Cloud Compute | Apple-managed larger model path |
| Local BYOM | LiteRT-LM | Downloaded or bundled local models |
| Cloud | Private backend | Reliable fallback and advanced reasoning |
Routing rules
- Try the requested provider.
- If it's unavailable and fallback is allowed, try the next provider in priority order.
- If the prompt is sensitive and cloud fallback is disabled, fail locally rather than send it off-device.
- Return provider metadata with every result.
await ExpoAI.generate({
prompt: 'Extract the risks from this proposal.',
fallback: 'cloud', // "none" | "cloud" | "any"
});
See the privacy model for how the sensitivity gate interacts with cloud fallback, and cloud fallback for configuring the backend.