LOCAL AI · NATIVE SPEED · PRIVATE BY DEFAULT

Build on-device AI into Expo apps.

Text generation, speech-to-text, embeddings, and RAG on the models your users' phones already ship with — Apple Foundation Models, ML Kit, SpeechAnalyzer — plus downloadable LiteRT-LM models when you need more. No API keys, no per-token bill, no cloud round-trip.

Current expo-ai-kit version on npmWeekly expo-ai-kit downloads on npmexpo-ai-kit stars on GitHubexpo-ai-kit continuous integration statusMIT license

Why expo-ai-kit

Most AI features don't need a server — phones ship with capable models of their own now. expo-ai-kit is a small, typed API over the best of them, so your app can generate text, transcribe speech, and search its own data while offline, in private, and at no cost per request.

No inference accountInstall the package and run models without provisioning a backend.
Cross-platform primitivesOne API for generation, tools, embeddings, RAG, and model lifecycle.
Zero runtime dependenciesA deliberately lean native module, not another application framework.

Use a development build

expo-ai-kit contains native code and does not run in Expo Go. Usenpx expo run:ios, npx expo run:android, or an EAS development build.

Choose the right model path

iOS 26+

Apple Foundation Models

Use Apple's OS-provided language model with no model bundled into your app.

Android API 26+

ML Kit

Prepare Google's OS-managed model on supported Android devices.

iOS + Android

LiteRT-LM

Download curated Gemma, Qwen, and Phi models—or register your own.

iOSAndroid

Quick start

Terminalbash
npx expo install expo-ai-kit
App.tsxtypescript
import {
  isAvailable,
  prepareBuiltInModel,
  sendMessage,
} from 'expo-ai-kit';

if (!(await isAvailable())) {
  throw new Error('On-device AI is unavailable');
}

await prepareBuiltInModel();

const { text } = await sendMessage([
  { role: 'user', content: 'Explain local AI in one sentence.' },
]);

console.log(text);

A practical local AI toolkit

Generate

Stream text, preserve conversation context, and cancel work in progress.

Structure

Turn model output into validated objects with JSON Schema repair loops.

Act

Give local models typed tools and keep human approval in the loop.

Retrieve

Create embeddings and build private, on-device semantic search and RAG.

Transcribe

Turn speech into text — live from the microphone or from audio files.

Switch

Move between OS-native and downloadable models at runtime.

Integrate

Use the same local engine through the Vercel AI SDK provider.

Go deeper