Skip to main content

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',
];
CategoryProviderPurpose
System modelApple Foundation ModelsPreferred iOS native model path
System modelAndroid AICore / Gemini NanoPreferred Android native model path
Private cloudApple Private Cloud ComputeApple-managed larger model path
Local BYOMLiteRT-LMDownloaded or bundled local models
CloudPrivate backendReliable fallback and advanced reasoning

Routing rules

  1. Try the requested provider.
  2. If it's unavailable and fallback is allowed, try the next provider in priority order.
  3. If the prompt is sensitive and cloud fallback is disabled, fail locally rather than send it off-device.
  4. 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.