![App icon of AubAI](https://github.com/BrutalCoding/aub.ai/raw/main/example/assets/appicon_rounded.png?raw=true)
This is the included example app that makes use of AubAI, a Flutter/Dart package that allows you to supercharge apps with on-device AI capabilities.
This example app is bundled with the AubAI package and demonstrates how to use it to add on-device AI capabilities to your Flutter app.
- Getting Started
- Requirements
- Installation
- Usage
- Features Demonstrated
- Troubleshooting
- Feedback
- License
To get started with this example, clone the AubAI repository and navigate to the example
directory. This example is designed to provide a hands-on experience with the key features of AubAI, demonstrating its ease of use and versatility.
Ensure you have the following prerequisites installed:
- Flutter SDK (latest stable version)
- Dart SDK (compatible with the Flutter SDK)
- A suitable IDE (like Visual Studio Code)
- Depending on the platform you're targeting, you may need to install additional tools. See the Flutter documentation for more information.
- Clone the AubAI repository.
- Navigate to the
example
directory. - Run
flutter pub get
in your terminal to fetch the necessary dependencies.
Open the project in your preferred IDE and run the app on a supported platform. The example app is designed to be very simplistic, with a minimal UI and a single screen. It allows you to send a message to the AI and receive a response.
- File picker: The example app allows you to select a model file from your device's storage. This is done using the file_picker package.
- Sending messages to the AI: The example app allows you to send a message (prompt) to the AI. This is done using the
AubAI
's exposedtalkAsync
method. - Receiving responses from the AI in real-time: After sending a message to the AI, the example app displays the response it received from the AI in real-time. This is done using the
AubAI
's exposedonTokenGenerated
callback which is invoked every time the AI generates a token (word). - Isolates out of the box: The example app uses isolates out of the box. This is done by default, and you don't have to do anything to enable it. Without isolates, the UI would freeze while the AI is generating a response. This is because the AI is computationally expensive and would block the main thread (UI thread) while generating a response. Isolates allow the AI to run in the background, without blocking the main thread. This ensures a smooth user experience.
If you encounter any issues while using this example, please refer to the project's main README.md file and the Troubleshooting Guide for common problems and their solutions.
Your feedback is invaluable in improving this example app. For suggestions, bug reports, or contributions, please open an issue or a pull request in the main AubAI repository.
This example app is part of the AubAI project and is distributed under the same AGPL-3.0 license.