On-device AI for your mobile app. Every platform’s models, one API.

Run the models each platform provides, or your own, right on your users’ devices. Drop-in Vercel AI SDK providers for React Native: swap the model per platform and keep the rest of your code. No server, no API key.

Get started
npm install @react-native-ai/apple ai
React Native AIzsh
$ npm install @react-native-ai/apple ai
# the Apple provider and the AI SDK

Works with iOS, Android, Apple Foundation Models, Core AI, Gemini Nano, llama.rn, Vercel AI SDK, Expo.

[01] How it works

Swap the model. Keep the code.

  1. 01

    Install the providers

    Add the provider for each platform you ship to, next to the AI SDK.

    $ npm install @react-native-ai/apple ai
  2. 02

    Pick a model per platform

    Use apple() on iOS and adk() on Android, or a model you ship with Core AI or Llama.

    $ npm install @react-native-ai/adk
  3. 03

    Call the AI SDK

    Pass the model to generateText, streamText, embed or any other AI SDK function. The rest of your code stays the same, on iOS and Android.

    $ npx expo run:android
React Native AIapple.ts
import { apple } from '@react-native-ai/apple'
import { streamText } from 'ai'

const result = streamText({
  model: apple(),
  prompt: 'Summarize my notes',
})

@react-native-ai/appleFoundation Models, provided by the platform: native and fast.Set up Apple

[02] Runtimes

The fastest runtime on each platform. One API over all of them.

Apple, Core AI and ADK run on the AI stack the platform provides: native, hardware-accelerated and with its system models. Llama runs GGUF models sized for phones on iOS and Android through llama.rn, a third-party binding.

[03] Small context windows

Long chats, small models.

On-device models have a few thousand tokens of context. Wrap any model to keep a rolling window, summarize older turns and drop finished tool calls, without changing your chat state.

Conversation history
React Native AIchat.ts
import { apple } from '@react-native-ai/apple'
import { wrapLanguageModelWithHistory } from '@react-native-ai/utils'
import { streamText } from 'ai'

const model = wrapLanguageModelWithHistory(apple(), {
  rollingWindowMessages: 12,
  dropCompletedToolCalls: true,
})

const result = streamText({ model, messages })

[04] What you get

The AI SDK you know, on the device.

[05] Private by default

On the device. Off the network.

Data stays local

Inference runs on the device, so prompts and replies never reach a server.

Works offline

No network round trip and nothing to wait for. It works in airplane mode.

No keys, no bills

System models need no API key, and there is no per-token cost.

Cloud is opt-in

Private Cloud Compute and cloud Gemini run only when you ask for them.

[06] FAQ

Frequently asked questions

Do I have to download a model?
Not for Apple and Gemini Nano: they use models that ship with the operating system. The system downloads some assets, such as Apple’s embedding and transcription models, on first use. Core AI and Llama run models you ship or download.
Which devices does it run on?
Apple text generation needs iOS 26 on a device with Apple Intelligence turned on; embeddings and speech work on older versions. Gemini Nano needs a physical Android device with AICore support. Llama runs on iOS and Android.
Does anything leave the device?
No, unless you opt in. Inference runs locally. Apple’s Private Cloud Compute model and ADK’s cloud Gemini are cloud models you choose explicitly.
Which AI SDK version do I need?
React Native AI 0.13 and above works with AI SDK v7. Use 0.12 for v6 and 0.11 or below for v5. Every provider needs polyfills for streams and structuredClone.
Can I test in the iOS Simulator?
Yes for Apple: the Simulator uses your Mac’s Apple Intelligence once it is turned on in macOS. Core AI and Gemini Nano need a physical device.
Can I mix on-device and cloud models?
Yes. They are all AI SDK models, so you can pick one per call, and fall back to a cloud provider when apple.isAvailable() is false.
Get started