@entro314labs/apple-intelligence-sdk
v0.2.2
Published
Apple Intelligence provider for the Vercel AI SDK with pluggable transports (Tauri, Node, etc.)
Maintainers
Readme
Apple Intelligence SDK (Transport-Agnostic)
This package provides a Vercel AI SDK v6 provider for Apple Intelligence using a pluggable transport. It does not ship any native binaries.
Companion Tauri bridge crate: https://github.com/entro314-labs/tauri-apple-intelligence
Why a transport?
Apple Intelligence runs on-device and requires macOS 26+ on Apple Silicon. Different runtimes (Tauri, Node, etc.) need different bridges. This SDK keeps the provider logic reusable while the transport does platform-specific work.
Install
pnpm add @entro314labs/apple-intelligence-sdkIf you're using the Tauri bridge, also add the Rust crate:
cargo add tauri-apple-intelligenceUsage
import { generateText } from "ai";
import {
createAppleIntelligenceProvider,
createTauriAppleIntelligenceTransport,
} from "@entro314labs/apple-intelligence-sdk";
const appleAI = createAppleIntelligenceProvider({
transport: createTauriAppleIntelligenceTransport(),
});
const { text } = await generateText({
model: appleAI("apple-on-device"),
prompt: "Summarize these notes.",
});Tauri setup (native bridge)
- Add the Rust commands to your Tauri builder:
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![
tauri_apple_intelligence::apple_ai_check_availability,
tauri_apple_intelligence::apple_ai_generate,
tauri_apple_intelligence::apple_ai_stream,
])Ensure your app links
libappleai.dyliband bundles it as a resource.Use the Tauri transport from your frontend:
import {
createAppleIntelligenceProvider,
createTauriAppleIntelligenceTransport,
} from "@entro314labs/apple-intelligence-sdk";
const appleAI = createAppleIntelligenceProvider({
transport: createTauriAppleIntelligenceTransport(),
});Supported features
- Streaming text generation
- Tool calling (multi-step orchestration via AI SDK)
- Structured output (JSON schema)
Platform constraints
- macOS 26+ (Apple Intelligence)
- Apple Silicon (M1+)
- Apple Intelligence enabled in system settings
Notes
- The Tauri transport uses
apple_ai_*commands by default. If you change the prefix on the Rust side, passcommandPrefixtocreateTauriAppleIntelligenceTransport. - The transport returns tool calls in AI SDK format, enabling multi-step tool workflows.
Transport interface
If you want a custom transport (e.g. a future Node bridge), implement AppleIntelligenceTransport from the package exports.
MIT License.
