Compatibility & limitations
Requirements and capabilities for the Android 2.0.0 release.
Requirements
| Requirement | Current package setup |
|---|---|
| Shared peer package | @taaltreelabs/on-device-llm ^1.0.0 |
| App runtime | React Native with Expo native modules; a native development or production build |
| Example app | Expo SDK 57, React Native 0.86.3; not a certified compatibility range |
| ML Kit SDK | Explicit app dependency on com.google.mlkit:genai-prompt:1.0.0-beta4 |
| Minimum Android SDK | API 26 or higher for the app when including ML Kit |
| App Kotlin compilation | The documented toolchain requires -Xskip-metadata-version-check on app compile tasks |
| Expo config plugin | Included |
| Device | An eligible physical Android device with AICore and model availability |
| Native module | OnDeviceLlmAndroid |
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:
| Capability | Android provider |
|---|---|
| Text generation and streaming | Text generation and streamed deltas |
| Token counting | Reports exact, counting the request including its role framing |
| Context window | Read from the model; do not assume Apple's 4K/8K limits |
| Structured output | Not supported; schema requests are rejected as invalidRequest |
| Tool calling | Not supported; requests carrying tools are rejected as invalidRequest |
| Locales | UNKNOWN; no locale enumeration or locale configuration option |
| Safety refusal error | No 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.