The Vercel AI SDK provides a unified API for working with various language models. You can use it with Apple LLM to generate text and stream responses.
import { streamText } from 'ai';import { apple } from '@react-native-ai/apple';const { textStream } = await streamText({ model: apple(), system: 'You are a helpful assistant', prompt: 'Write a short story about AI',});for await (const delta of textStream) { process.stdout.write(delta);}
Need to boost your app's performance?
We help React Native teams enhance speed, responsiveness, and efficiency.