Skip to main content

Compatibility & limitations

Requirements and capabilities for the Android 2.0.0 release.

Requirements​

RequirementCurrent package setup
Shared peer package@taaltreelabs/on-device-llm ^1.0.0
App runtimeReact Native with Expo native modules; a native development or production build
Example appExpo SDK 57, React Native 0.86.3; not a certified compatibility range
ML Kit SDKExplicit app dependency on com.google.mlkit:genai-prompt:1.0.0-beta4
Minimum Android SDKAPI 26 or higher for the app when including ML Kit
App Kotlin compilationThe documented toolchain requires -Xskip-metadata-version-check on app compile tasks
Expo config pluginIncluded
DeviceAn eligible physical Android device with AICore and model availability
Native moduleOnDeviceLlmAndroid

Device eligibility is determined by AICore support, not RAM or chipset alone. Check Google's current Prompt API documentation and call availability() on the actual device. Use an eligible physical device for model inference; emulators can exercise unavailable-provider behavior.

Provider capabilities​

The Android provider exposes the following capabilities:

CapabilityAndroid provider
Text generation and streamingText generation and streamed deltas
Token countingReports exact, counting the request including its role framing
Context windowRead from the model; do not assume Apple's 4K/8K limits
Structured outputNot supported; schema requests are rejected as invalidRequest
Tool callingNot supported; requests carrying tools are rejected as invalidRequest
LocalesUNKNOWN; no locale enumeration or locale configuration option
Safety refusal errorNo native error maps to the shared guardrail code

Capabilities exposed by the underlying Google API are not automatically capabilities of this TypeScript bridge. In particular, its typed Kotlin structured-output path is not exposed as runtime JSON Schema support here.

Availability and troubleshooting​

  • unsupportedPlatform: check that the app contains the native module, the ML Kit Gradle dependency, and a supported Android environment. iOS, Node, and web also report this state.
  • deviceNotEligible: the device or feature is unsupported. A generic hardware specification does not establish eligibility.
  • modelNotReady: model preparation or a transient native-status failure may be involved; offer a later check.

Inspect diagnostic details during development, but don't display raw native details directly to users. Rebuild the native app after changing dependencies; reloading JavaScript cannot add missing native classes.

Release shrinking​

The package includes and registers the consumer R8/ProGuard rules that preserve reflective class loading. No manual copying is needed. Validate a minified release build on eligible hardware as well as your debug build.