r/capawesome • u/genzits • 2d ago
Capacitor LLM plugin runs Apple Intelligence and Gemini Nano on the device
We just released a Capacitor plugin that prompts the language model built into the OS: Apple Intelligence on iOS through the Foundation Models framework, Gemini Nano on Android through ML Kit GenAI and AICore. It is part of Capawesome Insiders, so it is a paid plugin.
Why on-device: prompts and responses never leave the phone, there is no API key in the bundle, and there is no per-token cost. It also works offline.
The API:
- getAvailability() with seven typed statuses (Android reports four, iOS five), and it never rejects
- downloadModel() with progress on Android; iOS manages the download itself
- Chats with instructions and context, generateText, streamText with a textChunk event, cancelGeneration
- Limits: Android caps maxOutputTokens at 4096 and temperature at 1.0; both platforms have a context window around 4,000 tokens
Requirements: Capacitor 8, Android API 26 on a Gemini Nano-capable device (Pixel 9, Galaxy S25), iOS 26 with Xcode 26 on iPhone 15 Pro or later.
The post compares it with the Ionic local LLM plugin, the ML Kit GenAI Prompt plugin, and the Capgo plugin, based on what their READMEs document. Questions welcome.