You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ADK: make isAvailable() synchronous, with details in an async getModelInfo() #332
The Apple provider settled on one availability pattern:
isAvailable() is synchronous: a quick device check that UI can call directly (apple.isAvailable(), apple.transcriptionModel().isAvailable()).
getModelInfo() is asynchronous: availability reasons, locale support, assets and feature flags (apple.getModelInfo(), transcriptionModel().getModelInfo()).
ADK doesn't follow it. adk.isAvailable(modelType) and the model's isAvailable() return Promise<boolean>, so ADK is the only provider whose isAvailable has to be awaited. Code written against the shared pattern, e.g. if (provider.isAvailable()), silently treats ADK as always available, because a promise is truthy. The example app already special-cases it (providerStore.ts awaits adk.isAvailable('genai-nano') separately from the other adapters).
Proposal
Make adk.isAvailable() and the model's isAvailable() synchronous: a quick check of what the device can tell without async work (Android version, Play services / AICore presence, cached state).
Move everything that needs async work to getModelInfo(), which #290 adds (availability such as available / downloadable / downloading / unavailable, plus model details).
Because changing the return type from Promise<boolean> to boolean is breaking, ship it in the next major, or add the sync check under a new name first and deprecate the async one.
Update the example app to treat every adapter's isAvailable() the same way.
Context
Apple transcription went through the same change in #319: its isAvailable() stayed synchronous, and locale support moved to an async getModelInfo(), instead of blocking a thread to answer an async question synchronously.
The naming across packages is also converging on getModelInfo. Apple embeddings' getInfo gets aligned in a follow-up.
Closing with the ADK provider, which is being removed (#368). @react-native-ai/android (#367) has a synchronous isAvailable() with details in getModelInfo().
Activity
feat(adk)!: make isAvailable synchronous, like apple
feat(adk)!: make isAvailable synchronous, like apple
grabbou commentedon Oct 30, 2026
Closing with the ADK provider, which is being removed (#368).
@react-native-ai/android(#367) has a synchronousisAvailable()with details ingetModelInfo().