Skip to content

ADK: make isAvailable() synchronous, with details in an async getModelInfo() #332

Closed as not planned

Description

@grabbou

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.

🤖 Generated with Claude Code

Activity

  1. added 2 commits that reference this issue on Oct 29, 2026
    76892c9
    e1cfb05
  2. grabbou commented on Oct 30, 2026

    @grabbou
    ContributorAuthor

    Closing with the ADK provider, which is being removed (#368). @react-native-ai/android (#367) has a synchronous isAvailable() with details in getModelInfo().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions