Flutter plugin for Google's AI Edge SDK - brings Gemini Nano on-device AI to your Flutter apps.
Gemini Nano brings Google's most efficient AI model directly to your device, enabling private, fast AI inference without internet connectivity. On-device AI represents the future of mobile computing, providing instant responses while keeping your data completely private.
Important
This is an experimental open-source project. The underlying Google AI Edge SDK is in beta and APIs may change. Use at your own risk.
- Physical Pixel 9 series device (Pixel 9, Pixel 9 Pro, Pixel 9 Pro XL, or Pixel 9 Pro Fold)
- Android with AICore system module installed
- Flutter 3.0.0+
Gemini Nano requires specialized NPU hardware only available in Pixel 9 devices. This case is part of Google's experimental AI program - broader device support may come later.
dependencies:
ai_edge_sdk: ^1.0.0
import 'package:ai_edge_sdk/ai_edge_sdk.dart';
final sdk = AiEdgeSdk();
// Check if your device is supported
if (await sdk.isSupported()) {
await sdk.initialize();
final result = await sdk.generateContent('Rewrite this professionally: hey whats up');
print(result.content);
} else {
print('Sorry, requires Pixel 9 series device');
}
- Device validation - Automatic Pixel 9 series detection
- Content generation - Text completion and creative writing
- Streaming responses - Real-time token generation
- Error handling - Comprehensive exception management
- Privacy-first - All processing happens on-device
Cannot test with emulator. You need a physical Pixel 9.
Run unit tests:
flutter test --coverage
The /example
folder contains a complete demo app that shows device compatibility checking and error handling.
cd example
flutter run
# Shows device info and compatibility status
See SECURITY.md for security practices and reporting vulnerabilities.
- Google AI Edge SDK Documentation
- Gemini Nano Experimental Access
- Android AI Samples - Gemini Nano
- Flutter Plugin Development Guide
- Android AICore Documentation
MIT - Copyright Stefano Amorelli 2025 - see LICENSE.md