Skip to main content

Capability detection

Every app-facing feature should check capabilities at runtime before it's shown. A device may not support a provider at all, or may support generation but not streaming or structured output.

What works where​

CapabilityApple Foundation ModelsiOS 26+on-deviceGemini NanoAndroid · AICoreon-devicePrivate Cloud ComputeiOS 27+ · opt-inoff-deviceCloud fallbackYour backend · opt-inoff-device
Text generation✓✓✓✓
Streaming✓✓✓✓
Sessions✓✓✓✓
Structured output✓✓✓✓
streamObject✓✓✓✓
Summarize / rewrite / proofread✓✓✓✓
Core features (structured output, streamObject, task helpers) are provider-agnostic — they work wherever text generation does. On-device engines still gate at runtime; always check getCapabilities().

The core features — structured output, streamObject, and the task helpers — are provider-agnostic, so they work wherever text generation does. On-device engines still gate at runtime; always check getCapabilities() before showing a feature.

export type ExpoAICapabilities = {
available: boolean;
provider: ExpoAIProvider;

isOnDevice: boolean;
isSystemManagedModel: boolean;
sendsPromptOffDevice: boolean;

supportsTextGeneration: boolean;
supportsStreaming: boolean;
supportsSessions: boolean;
supportsStructuredOutput: boolean;
supportsTools: boolean;
supportsImageInput: boolean;
supportsSpeechInput: boolean;

supportsSummarization: boolean;
supportsRewrite: boolean;
supportsProofreading: boolean;

supportsBringYourOwnModel: boolean;
supportsModelDownload: boolean;

contextWindow?: number;

reasonUnavailable?: ExpoAIUnavailableReason;
};

When a provider isn't available, reasonUnavailable explains why — so the app can guide the user (enable Apple Intelligence, download the model, update the OS) or fall back.

export type ExpoAIUnavailableReason =
| 'unsupported_os_version'
| 'unsupported_device'
| 'model_not_downloaded'
| 'model_initializing'
| 'apple_intelligence_disabled'
| 'aicore_unavailable'
| 'aicore_initializing'
| 'unsupported_bootloader_state'
| 'missing_dependency'
| 'provider_not_configured'
| 'unsupported_locale' // the device language isn't supported by the model
| 'quota_exhausted' // Apple Private Cloud Compute usage limit reached
| 'entitlement_missing' // Apple Private Cloud Compute not configured for the app
| 'unknown';

Use ExpoAI.getCapabilities() for the active provider, or ExpoAI.listProviders() to inspect every registered provider and its capabilities. getAvailability() and getCapabilities() skip providers the privacy policy disallows.

  • contextWindow comes from the OS when the provider reports it. Apple Foundation Models reports the model's real context size (4096 tokens below iOS 27), but only in apps built with the iOS 27 SDK (Xcode 27+).
  • supportedLanguages on ExpoAIAvailability lists the BCP-47 tags the provider's model supports, when it reports them.

Reacting to changes​

Availability changes when the user enables Apple Intelligence, a model finishes downloading, or the app returns to the foreground. Subscribe instead of polling:

const sub = ExpoAI.onAvailabilityChange((availability) => {
console.log(availability.provider, availability.available);
});
// later
sub.remove();

Provider packages call notifyAvailabilityChange(provider) when the app returns to the foreground and after a model download. The useCapabilities hook refreshes on these events automatically.