Getting Started

The Apple provider enables you to use Apple's on-device AI capabilities with the Vercel AI SDK in React Native applications. This includes language models, text embeddings, and other Apple-provided AI features that run entirely on-device for privacy and performance.

Installation

Install the Apple provider:

npm install @react-native-ai/apple

While you can use the Apple provider standalone, we recommend using it with the Vercel AI SDK for a much better developer experience. The AI SDK provides unified APIs, streaming support, and advanced features. To use with the AI SDK, you'll need v5 and required polyfills:

npm install ai@beta

Requirements

  • React Native New Architecture - Required for native module functionality
NOTE

Different Apple AI features have varying iOS version requirements. Check the specific API documentation for compatibility details.

Basic Usage

Import the Apple provider and use it with the AI SDK:

import { apple } from '@react-native-ai/apple';
import { generateText } from 'ai';

const result = await generateText({
  model: apple(),
  prompt: 'Explain quantum computing in simple terms'
});
Need to boost your app's performance?
We help React Native teams enhance speed, responsiveness, and efficiency.