[![image](https://github.com/user-attachments/assets/027ccbc1-c6c4-46a0-aa62-7b89d4e62f24)](https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-ai) # React Native AI Run AI models on users' devices from React Native, with first-class [Vercel AI SDK](https://ai-sdk.dev) support. Each provider wraps an on-device runtime and exposes it as an AI SDK provider, so `generateText`, `streamText`, `embed` and the other AI SDK functions work with local models the same way they work with cloud ones. - ๐Ÿš€ **Instant AI** - Use the models built into iOS and Android, with nothing to bundle - ๐Ÿ”’ **Privacy-first** - Inference runs on-device, so data stays local. Cloud models are opt-in - ๐ŸŽฏ **Vercel AI SDK compatible** - Swap local and cloud models without changing your code - ๐ŸŽจ **Beyond text** - Embeddings, reranking, transcription, speech and image generation ## Providers | Provider | Package | Platforms | Models | App downloads the model | | ---------------------------------- | ------------------------------------------------ | ------------ | ------------------------------------------ | ----------------------- | | [Apple](#apple) | [`@react-native-ai/apple`](./packages/apple-llm) | iOS | Apple Intelligence and system models | No | | [Google ADK](#google-adk) | [`@react-native-ai/adk`](./packages/adk) | Android | Gemini Nano, optional cloud Gemini | No | | [Llama](#llama) | [`@react-native-ai/llama`](./packages/llama) | iOS, Android | llama.cpp-compatible GGUF models | Yes | | [Core AI](#core-ai) (not released) | [`@react-native-ai/core-ai`](./packages/core-ai) | iOS 27+ | Core AI bundles from `apple/coreai-models` | Yes | ### Apple Use the AI built into iOS: Apple Intelligence for text generation, NLContextualEmbedding for embeddings, SpeechAnalyzer for transcription and AVSpeechSynthesizer for speech. The models ship with the system, so your app has nothing to bundle, although iOS may download model assets the first time they are used. ```bash npm install @react-native-ai/apple ai ``` ```ts import { apple } from '@react-native-ai/apple' import { generateText } from 'ai' const { text } = await generateText({ model: apple(), prompt: 'Explain quantum computing', }) ``` | Feature | iOS | Additional requirements | | ---------------- | ------- | -------------------------- | | Text generation | iOS 26+ | Apple Intelligence device | | Embeddings | iOS 17+ | - | | Transcription | iOS 26+ | - | | Speech synthesis | iOS 13+ | iOS 17+ for Personal Voice | [Package README](./packages/apple-llm) ยท [Documentation](https://react-native-ai.dev/docs/apple/getting-started) ### Google ADK Use Gemini on Android through Google's [Agent Development Kit](https://developer.android.com/ai/adk). Gemini Nano runs on-device and is provided by the system through AICore, so there are no model files and no API key. Cloud Gemini is available when you need a larger model. ```bash npm install @react-native-ai/adk ai ``` > [!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). ```ts import { adk } from '@react-native-ai/adk' import { generateText } from 'ai' if (!(await adk.isAvailable())) { throw new Error('Gemini Nano is not available on this device') } await adk.prepareNano() const { text } = await generateText({ model: adk(), prompt: 'Explain quantum computing', }) ``` [Package README](./packages/adk) ยท [Documentation](https://react-native-ai.dev/docs/adk/getting-started) ### Llama Run llama.cpp-compatible GGUF models from Hugging Face on iOS and Android with [llama.rn](https://github.com/mybigday/llama.rn). Supports text generation, embeddings, reranking and speech. ```bash npm install @react-native-ai/llama llama.rn react-native-blob-util ai ``` ```ts import { downloadModel, llama } from '@react-native-ai/llama' import { generateText } from 'ai' // Model ID format: "owner/repo/filename.gguf" const modelPath = await downloadModel( 'bartowski/Qwen_Qwen3.5-2B-GGUF/Qwen_Qwen3.5-2B-Q4_K_M.gguf' ) const model = llama.languageModel(modelPath) await model.prepare() const { text } = await generateText({ model, prompt: 'Write a haiku about coding.', }) // Release the native context when you no longer need the model await model.unload() ``` [Package README](./packages/llama) ยท [Documentation](https://react-native-ai.dev/docs/llama/getting-started) ### Core AI > [!WARNING] > Work in progress. This package is not published to npm yet. Run model bundles exported with [`apple/coreai-models`](https://github.com/apple/coreai-models), such as Qwen3 or FLUX.2, on iOS 27 with Apple's Core AI framework. Supports text and image generation, transcription and embeddings through the AI SDK, plus native APIs for segmentation, object detection and other vision tasks. ```ts import { coreAI } from '@react-native-ai/core-ai' import { streamText } from 'ai' const result = streamText({ model: coreAI.languageModel({ source: qwen3ModelDirectory }), prompt: 'Explain Core AI in one sentence.', }) ``` [Package README](./packages/core-ai) ## Tools These work with any AI SDK provider, on-device or cloud. | Package | Description | | ---------------------------------------------------- | ------------------------------------------------------------------------- | | [`@react-native-ai/json-ui`](./packages/json-ui) | Let a tool-calling model build React Native UI from a JSON spec | | [`@react-native-ai/dev-tools`](./packages/dev-tools) | Inspect AI SDK calls in Rozenite DevTools | | [`@react-native-ai/utils`](./packages/utils) | Compact conversation history for small context windows (not released yet) | ### DevTools ![AI SDK Profiler preview](website/src/public/dev-tools-preview.png) The AI SDK Profiler plugin captures OpenTelemetry spans from Vercel AI SDK requests and surfaces them in Rozenite DevTools. ```bash npm install @react-native-ai/dev-tools @ai-sdk/otel ``` Register the profiler's tracer with `registerTelemetry` at app startup, see the [package README](./packages/dev-tools) for the setup. Rozenite must be installed and enabled in your app. See the [Rozenite getting started guide](https://www.rozenite.dev/docs/getting-started). The Expo demo app in [apps/expo-example](./apps/expo-example) includes native-development Rozenite wiring for this plugin. Run the example app, open React Native DevTools, and select `AI SDK Profiler` to inspect chat spans emitted by the Vercel AI SDK. If the `AI SDK Profiler` panel stays empty after you send a message, close the React Native DevTools window and open a new one. A stale debugger session can keep the panel mounted without receiving telemetry. ## AI SDK Compatibility | React Native AI | AI SDK | | --------------- | ------ | | 0.11 and below | v5 | | 0.12 | v6 | | 0.13 and above | v7 | ## Documentation Guides and API reference are available at [react-native-ai.dev](https://react-native-ai.dev). ## Contributing Read the [contribution guidelines](/CONTRIBUTING.md) before contributing. ## Agent skills This repository provides agent skills to help you integrate and use the packages. You can easily install them with: `npx skills add https://github.com/callstackincubator/react-native-ai --skill react-native-ai-skills` or manually by copying the `skills/` directory into your agent's skills directory (for example `.cursor/skills/`). ## Made with โค๏ธ at Callstack **react-native-ai** is an open source project and will always remain free to use. If you think it's cool, please star it ๐ŸŒŸ. [Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [hello@callstack.com](mailto:hello@callstack.com) if you need any help with these or just want to say hi! --- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob) [callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=react-native-ai&utm_term=readme-with-love