Choose where it runs.
Use a common provider interface for Apple’s on-device model and OpenAI-compatible endpoints. Make routing decisions in your app.
Connect your React Native app to Apple’s on-device model and your own cloud endpoint. Keep conversations within the model’s context window and control where each request runs.
v1.0.0 · Available on npm
Use a common provider interface for Apple’s on-device model and OpenAI-compatible endpoints. Make routing decisions in your app.
Fit conversations to Apple’s 4–8K token window, depending on the model variant. Choose a sliding window or rolling summary, and render current app state into each request.
Connect a router to useChat for context management and streaming. Use useAvailability and useGenerate for model status and one-shot requests.
Check the model before you ask it to work. Handle unavailable devices and generation errors in your interface.
API example. Requires the native module in a compatible app build.
Read the setup guide →import { createAppleProvider } from '@taaltreelabs/on-device-llm/apple';
const model = createAppleProvider();
const availability = await model.availability();
if (availability.available) {
try {
const result = await model.generate({
messages: [{ role: 'user', content: 'Explain why leaves change color.' }],
});
console.log(result.text);
} catch (error) {
// Availability does not guarantee generation will succeed.
console.error('Generation failed', error);
}
} else {
console.log('Model unavailable:', availability.reason);
}
Review the documented requirements and platform support, then follow a guide for your integration.
Compatibility & limitations →