A collection of on-device AI primitives for React Native with first-class Vercel AI SDK support. Run AI models directly on users' devices for privacy-preserving, low-latency inference without server costs.
- 🚀 Instant AI - Use built-in system models immediately without downloads
- 🔒 Privacy-first - Inference runs on-device, so data stays local. Cloud models are opt-in
- 🎯 Vercel AI SDK compatible - Use
generateText,streamText,embedand other AI SDK functions with local models - 🎨 Beyond text - Embeddings, transcription, speech synthesis and image generation
| React Native AI | AI SDK |
|---|---|
| 0.11 and below | v5 |
| 0.12 | v6 |
| 0.13 and above | v7 |
The AI SDK Profiler plugin captures OpenTelemetry spans from Vercel AI SDK requests and surfaces them in Rozenite DevTools. DevTools are runtime agnostic, so they work with on-device and remote runtimes.
npm install @react-native-ai/dev-toolsRozenite must be installed and enabled in your app. See the Rozenite getting started guide.
The Expo demo app in 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.
| Provider | Built-in | Platforms | Runtime | Description |
|---|---|---|---|---|
| Apple | ✅ Yes | iOS | Apple | Apple Foundation Models, embeddings, transcription, speech |
| Core AI | ❌ No | iOS | Core AI | Run app-provided Core AI model bundles |
| ADK | ✅ Yes | Android | Google ADK | On-device Gemini Nano, with optional cloud Gemini |
| Llama | ❌ No | iOS, Android | llama.rn | Run GGUF models via llama.rn |
| MLC | ❌ No | iOS, Android | MLC LLM | Run open-source LLMs via MLC runtime |
Native integration with Apple's on-device AI capabilities. Built-in - no model downloads required, uses system models.
- Text Generation - Apple Foundation Models for chat and completion
- Embeddings - NLContextualEmbedding for 512-dimensional semantic vectors
- Transcription - SpeechAnalyzer for fast, accurate speech-to-text
- Speech Synthesis - AVSpeechSynthesizer for natural text-to-speech with system voices
npm install @react-native-ai/appleNo additional linking needed, works immediately on iOS devices (autolinked).
import { apple } from '@react-native-ai/apple'
import {
generateText,
embed,
transcribe,
generateSpeech as speech,
} from 'ai'
// Text generation with Apple Intelligence
const { text } = await generateText({
model: apple(),
prompt: 'Explain quantum computing',
})
// Generate embeddings
const { embedding } = await embed({
model: apple.embeddingModel(),
value: 'Hello world',
})
// Transcribe audio
const { text: transcript } = await transcribe({
model: apple.transcriptionModel(),
audio: audioBuffer,
})
// Text-to-speech
const { audio } = await speech({
model: apple.speechModel(),
text: 'Hello from Apple!',
})| Feature | iOS Version | Additional Requirements |
|---|---|---|
| Text Generation | iOS 26+ | Apple Intelligence device |
| Embeddings | iOS 17+ | - |
| Transcription | iOS 26+ | - |
| Speech Synthesis | iOS 13+ | iOS 17+ for Personal Voice |
See the Apple documentation for detailed setup and usage guides.
Run your own Core AI model bundles (.aimodel) exported with apple/coreai-models. For Apple's built-in system models, use Apple instead.
- Text Generation -
generateTextandstreamText, plus persistent native sessions - Image Generation -
generateImagewith diffusion models such as FLUX.2 and Sana Sprint - Segmentation and Object Detection - Direct native APIs, since the AI SDK has no equivalent
Embeddings and transcription are not supported yet (#237).
npm install @react-native-ai/core-aiImportant
Apps need an iOS 27 deployment target and build for physical devices only, since the iOS Simulator SDK has no CoreAI framework.
import { coreAI } from '@react-native-ai/core-ai'
import { generateText } from 'ai'
const model = coreAI.languageModel({
id: 'qwen3-0.6b',
source: { type: 'file', uri: qwen3ModelDirectory },
variant: 'iOS',
})
const { text } = await generateText({
model,
prompt: 'Explain Core AI',
})See the Core AI documentation for setup, starter models, and direct native APIs.
Run Gemini Nano on-device on Android through Google's Agent Development Kit. 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.
- Text Generation -
generateTextandstreamTextwith on-device Gemini Nano - Tool Calling - Native ADK agent loop with JavaScript tool executors
- Cloud Gemini - Optional cloud inference via ADK
LlmAgentwhen you need a larger model
npm install @react-native-ai/adkImportant
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.
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',
})See the ADK documentation for device checks, cloud Gemini, and tool calling.
Run any GGUF model on-device using llama.rn. Requires download - models are downloaded from HuggingFace.
| Feature | Method | Description |
|---|---|---|
| Text Generation | llama.languageModel() |
Chat, completion, streaming, reasoning models |
| Embeddings | llama.embeddingModel() |
Text embeddings for RAG and similarity search |
| Speech | llama.speechModel() |
Text-to-speech with vocoder models |
npm install @react-native-ai/llama llama.rn react-native-blob-utilimport { downloadModel, llama } from '@react-native-ai/llama'
import { generateText } from 'ai'
// Download from HuggingFace (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',
(progress) => console.log(`Downloading: ${progress.percentage}%`)
)
// Create model instance
const model = llama.languageModel(modelPath)
// Initialize model (loads into memory)
await model.prepare()
// Generate text
const { text } = await generateText({
model,
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Write a haiku about coding.' },
],
})
// Cleanup when done
await model.unload()Any GGUF model from HuggingFace can be used. Use the format owner/repo/filename.gguf as the model ID. Popular choices include:
bartowski/Qwen_Qwen3.5-2B-GGUF/Qwen_Qwen3.5-2B-Q4_K_M.ggufbartowski/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.ggufQwen/Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q4_k_m.gguf
📚 View full Llama documentation →
Run popular open-source LLMs directly on-device using MLC LLM's optimized runtime. Requires download - models must be downloaded before use.
npm install @react-native-ai/mlcRequires the "Increased Memory Limit" capability in Xcode. See the getting started guide for setup instructions.
import { mlc } from '@react-native-ai/mlc'
import { generateText } from 'ai'
// Create model instance
const model = mlc.languageModel('Llama-3.2-3B-Instruct')
// Download and prepare model (one-time setup)
await model.download()
await model.prepare()
// Generate response with Llama via MLC engine
const { text } = await generateText({
model,
prompt: 'Explain quantum computing',
})| Model ID | Size |
|---|---|
Llama-3.2-3B-Instruct |
~2GB |
Phi-3-mini-4k-instruct |
~2.5GB |
Mistral-7B-Instruct |
~4.5GB |
Qwen2.5-1.5B-Instruct |
~1GB |
Note
MLC requires iOS devices with sufficient memory (1-8GB depending on model). The prebuilt runtime supports the models listed above. For other models or custom configurations, you'll need to recompile the MLC runtime from source.
@react-native-ai/json-ui lets a tool-calling model build React Native UI. The model calls tools that add, update, and delete nodes in a JSON spec, and GenerativeUIView renders it. It's designed for small on-device models with limited context.
npm install @react-native-ai/json-uiSee the JSON UI documentation.
Guides and API reference are available at react-native-ai.dev.
Read the contribution guidelines before contributing.
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/).
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 is a group of React and React Native geeks, contact us at hello@callstack.com if you need any help with these or just want to say hi!
Made with create-react-native-library

