Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ keep the panel mounted without receiving telemetry.
| Provider | Built-in | Platforms | Runtime | Description |
| ------------------- | -------- | ------------ | ------------------------------------------------------------------- | ---------------------------------------------------------- |
| [Apple](#apple) | ✅ Yes | iOS | [Apple](https://developer.apple.com/documentation/FoundationModels) | Apple Foundation Models, embeddings, transcription, speech |
| [ADK](#google-adk) | ✅ Yes | Android | [Google ADK](https://developer.android.com/ai/adk) | On-device Gemini Nano, with optional cloud Gemini |
| [Android](#android) | ✅ Yes | Android | [ML Kit GenAI](https://developers.google.com/ml-kit/genai) | On-device Gemini Nano, transcription and embeddings |
| [Core AI](#core-ai) | ❌ No | iOS | [Core AI](https://github.com/apple/coreai-models) | Text, image, video, speech, embedding and vision models |
| [Llama](#llama) | ❌ No | iOS, Android | [llama.rn](https://github.com/mybigday/llama.rn) | Run GGUF models via llama.rn |

Expand Down Expand Up @@ -115,42 +115,41 @@ See the [Apple documentation](https://react-native-ai.dev/docs/apple/getting-sta

---

### Google ADK
### Android

Run Gemini Nano on-device on Android through Google's [Agent Development Kit](https://developer.android.com/ai/adk). **Built-in** - Gemini Nano is provisioned by the system via AICore, so there are no model files to bundle and no API key. Cloud Gemini is available as an option.
Run Gemini Nano on-device on Android through Google's [ML Kit GenAI](https://developers.google.com/ml-kit/genai) libraries. **Built-in** - Gemini Nano is provided by the system through AICore, so there are no model files to bundle and no API key.

- **Text Generation** - `generateText` and `streamText` with on-device Gemini Nano
- **Tool Calling** - Native ADK agent loop with JavaScript tool executors
- **Cloud Gemini** - Optional cloud inference via ADK `LlmAgent` when you need a larger model
- **Text Generation** - `generateText` and `streamText` with on-device Gemini Nano, with images and thinking
- **Tool Calling** - AI SDK tools with Gemini Nano 4's function calling
- **Transcription** - Speech to text with ML Kit speech recognition
- **Embeddings** - On-device text embeddings

#### Installation

```bash
npm install @react-native-ai/adk
npm install @react-native-ai/android
```

> [!IMPORTANT]
> Requires Android `minSdkVersion` 26 and a physical device with AICore support (Android 14+) for Gemini Nano. Your app also needs packaging excludes for duplicate `META-INF` files, see the [getting started guide](https://react-native-ai.dev/docs/adk/getting-started).
> Requires Android `minSdkVersion` 26, Kotlin 2.4 and a physical device with AICore support. See the [getting started guide](https://react-native-ai.dev/docs/android/getting-started).

#### Usage
Comment thread
grabbou marked this conversation as resolved.
Resolved

```typescript
import { adk } from '@react-native-ai/adk'
import { android } from '@react-native-ai/android'
import { generateText } from 'ai'

if (!(await adk.isAvailable())) {
throw new Error('Gemini Nano is not available on this device')
const { availability } = await android.getModelInfo()
// When downloadable, the first request downloads Gemini Nano on its own
if (availability === 'available' || availability === 'downloadable') {
const { text } = await generateText({
model: android(),
prompt: 'Explain quantum computing',
})
}

await adk.prepareNano()

const { text } = await generateText({
model: adk(),
prompt: 'Explain quantum computing',
})
```

See the [ADK documentation](https://react-native-ai.dev/docs/adk/getting-started) for device checks, cloud Gemini, and tool calling.
See the [Android documentation](https://react-native-ai.dev/docs/android/getting-started) for device checks, tool calling, transcription and embeddings.

---

Expand Down
16 changes: 0 additions & 16 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ the mark, then the wordmark `REACT NATIVE AI` (`on-accent` on an `accent` block)
Both fonts are free and self-hosted in `website/src/fonts/`. Headlines run in two beats with
the second in the accent: "On-device AI for your mobile app. *Every platform’s models, one API.*" That is the motto. Mono
is for labels only, never full sentences. Platforms are always in the order iOS, Android, and
runtimes in the order Apple, Core AI, ADK, Llama.
runtimes in the order Apple, Core AI, Android, Llama.

## Layout

Expand All @@ -95,7 +95,7 @@ type sizes scaled from the hero headline.
the steps. Inside: a mono status row (`9:41`, `✈ AIRPLANE MODE`), the user's bubble on an
accent fill, the reply in a hairline box, and an accent square marking `apple() · on device`.
- **Runtime cells:** one per runtime, labelled `NATIVE · BY CALLSTACK` (accent) for Apple, Core AI
and ADK, or `THIRD-PARTY BINDING` (muted) for Llama, which wraps llama.rn.
and Android, or `THIRD-PARTY BINDING` (muted) for Llama, which wraps llama.rn.
- **Closing:** a full-width accent CTA bar, the giant accent wordmark, then one footer row.

## Pixel imagery
Expand Down Expand Up @@ -127,7 +127,7 @@ about 12 fps for dither, and cuts rather than cross-fades.
## Words

Plain and specific. Say what becomes possible: on-device AI in a mobile app, using the models
each platform provides, through one drop-in AI SDK API, with no server and no API key. Keep API names out of headlines and ledes. Apple, Core AI and ADK are native (`NATIVE · BY CALLSTACK`): they run on the AI stack the
each platform provides, through one drop-in AI SDK API, with no server and no API key. Keep API names out of headlines and ledes. Apple, Core AI and Android are native (`NATIVE · BY CALLSTACK`): they run on the AI stack the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Nit · "Android" is now used as both a platform name and a runtime name, making the DESIGN.md copy self-referential

This change renames the ADK runtime to "Android" everywhere. docs/DESIGN.md now reads, two sentences apart, "Platforms are always in the order iOS, Android, and runtimes in the order Apple, Core AI, Android, Llama" (line 74) and "Apple, Core AI and Android are native (NATIVE · BY CALLSTACK): they run on the AI stack the platform provides" (line 130) — so the runtime that "runs on the AI stack the platform provides" is named after the platform itself, and the runtime cell labelled Android sits next to the platform Android. The same duplication lands in website/src/site/content.ts (id: 'android', name: 'Android', runtime: 'Gemini Nano via AICore'), where the other three runtime names (Apple, Core AI, Llama) name a runtime rather than an OS, so the landing page's runtime grid and DESIGN.md's label rule are now inconsistent in kind. "Android" is also not a unique package label: the same repo ships @react-native-ai/llama for Android too, so "Runtimes: Apple, Core AI, Android, Llama" no longer says which runtime is meant on Android.

Suggested change

Consider a runtime-specific label instead of the OS name for the fourth runtime — e.g. "Gemini Nano" or "ML Kit GenAI" (the README's own Runtime column already says "ML Kit GenAI") — in docs/DESIGN.md's runtime order/labels and in runtimes[].name, or state in DESIGN.md that the provider package name is intentionally the platform name.

Details

Also raised here

Also raised at this location by maintainability: Runtime name "Android" collides with the platform axis in the same list — Renaming this runtime from ADK to Android makes the runtime list read Apple, Core AI, Android, Llama, but Llama in that same list also runs on Android (platforms: 'iOS, Android' two entries below), and docs/DESIGN.md keeps "Platforms are always in the order iOS, Android" as a separate axis. The runtime card now says "Android … Platforms: Android 14+", and DESIGN.md's runtime order/label paragraphs were edited to match. The package name is fine as @react-native-ai/android; for the user-facing runtime label, something like "ML Kit GenAI" or "Gemini Nano" (the value already used in runtime:) says which Android runtime it is.

persona: jvm, maintainability

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if this is wrong — I will re-check the cited code.

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping "Android". Every runtime label matches its package name (apple, core-ai, llama), and this one is @react-native-ai/android. The runtime column (Gemini Nano via AICore) already says which Android runtime it is.

platform provides. Llama is a `THIRD-PARTY BINDING`: a provider over llama.rn. Page titles are `React Native AI: On-device AI for React Native apps` on
the home page and `Page title | React Native AI` elsewhere. Facts come only from the docs: no
invented benchmarks, adopters or testimonials. Mark JSON UI as experimental.
Expand Down
206 changes: 0 additions & 206 deletions packages/adk/README.md

This file was deleted.

Loading
Loading