ai_edge_sdk 1.0.0 copy "ai_edge_sdk: ^1.0.0" to clipboard
ai_edge_sdk: ^1.0.0 copied to clipboard

PlatformAndroid

Flutter plugin for Google's AI Edge SDK, enabling on-device generative AI with Gemini Nano on Android devices.

AI Edge SDK for Flutter #

Flutter plugin for Google's AI Edge SDK - brings Gemini Nano on-device AI to your Flutter apps.

Tests Coverage Platform

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.

Requirements #

Why So Restrictive? #

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.

Installation #

dependencies:
  ai_edge_sdk: ^1.0.0

Quick Start #

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');
}

Features #

  • 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

Testing #

Cannot test with emulator. You need a physical Pixel 9.

Run unit tests:

flutter test --coverage

Example App #

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

Contributing #

See SECURITY.md for security practices and reporting vulnerabilities.

References #

License #

MIT - Copyright Stefano Amorelli 2025 - see LICENSE.md

0
likes
140
points
25
downloads

Publisher

verified publisheramorelli.tech

Weekly Downloads

Flutter plugin for Google's AI Edge SDK, enabling on-device generative AI with Gemini Nano on Android devices.

Repository (GitHub)
View/report issues

Topics

#artificial-intelligence #machine-learning #gemini #on-device-ai #text-generation

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on ai_edge_sdk

Packages that implement ai_edge_sdk