搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.3

aub_ai

AubAI 為您帶來設備端的生成式 AI 功能,包含離線文字產生等,直接整合於您的應用程式中。

AndroidiOSmacOSWindowsLinux
近 30 天下載
71
喜歡數
35
Pub 分數
130

安裝套件

flutter pub add aub_ai

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

AubAI 在 Flutter 應用中實現了設備端生成式 AI 功能,可在無需依賴外部伺服器的情況下實現離線文字生成及其他 AI 特性。專為隱私與效能設計,AubAI 可在多個平台上直接在使用者裝置上執行大型語言模型。適用於需要即時、安全且低延遲 AI 互動的應用場景,AubAI 支援 Android、iOS、macOS、Windows 與 Linux。開發者可輕鬆將進階 AI 功能整合至應用中,設定簡單。

適用情境

  • 離線文字生成
  • 注重隱私的AI應用
  • 即時聊天介面
  • 設備端語言處理
  • 本地模型推理

主要特色

  • 設備端大語言模型執行
  • 對多個平台的支援
  • 離線操作
  • 最小伺服器依賴
  • 安全的本地處理

適合對象

  • 注重資料隱私的開發者
  • 需要離線AI功能的應用
  • 跨平台人工智慧整合
  • 低延遲AI回應
  • 以行動裝置為先的AI應用

使用建議

  • 更高的設備資源使用率
  • 僅限支援的型號
  • 需要仔細的記憶體管理
  • 模型大小影響應用包
  • 需要平台特定的優化

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

App icon of AubAI

AubAI

AubAI brings you on-device gen-AI capabilities, including offline text generation and more, directly within your app.

Pub GitHub stars

Intro

Greetings Flutteristas, AI enthusiasts, and forward-thinking developers! Ready to revolutionize your apps with on-device gen-AI, including advanced text generation capabilities? You've landed in the right place.

Meet AubAI: a Flutter/Dart package designed specifically for empowering your apps with on-device gen-AI models. Whether it's generating text, enhancing user interaction, or other AI-driven tasks, AubAI has got you covered.

This package is a game-changer for all major platforms. But don't just take my word for it; see AubAI in action in my YouTube tutorials at YouTube.com/@BrutalCoding.

AubAI is not only powerful and versatile but also user-friendly and open-source. It's time to unlock the full potential of your apps with the latest in gen-AI technology.

Features and Capabilities

Advanced Gen-AI Integration
  • Text Generation: Harness the power of cutting-edge language models with AubAI for smooth text generation, elevating the user experience through advanced natural language processing. Effortlessly download and try out any GGUF model from sources such as HuggingFace, bringing top-tier AI functionality into your app with ease.
Cross-Platform Compatibility
  • Universal Platform Support: AubAI is meticulously designed for Flutter, ensuring seamless operation across a multitude of platforms. This broad compatibility extends to various operating systems, catering to a diverse range of development needs:

    • macOS (ARM64, x86_64)
    • Windows (x86_64)
    • Linux (x86_64)
    • Android (ARM64, x86_64)
    • iOS (ARM64)
    • iPadOS (ARM64)
User-Friendly Design
  • Simplified Integration: At the heart of AubAI is a commitment to simplicity, making sophisticated AI features accessible to developers across all expertise levels.
  • Open Source Community: Embracing the spirit of collaborative development, AubAI is an open-source package. We encourage and welcome community contributions, driving innovation and fostering an environment of continuous advancement.
Demonstrations and Tutorials
  • Engaging Live Examples: Discover AubAI's practical applications and watch it in action on my YouTube channel at YouTube.com/@BrutalCoding. Providing clear, real-world examples of how AubAI can transform your apps with on-device gen-AI, learn how to integrate AubAI into your projects with ease.

Do You Like This Project?

Assuming you have checked out AubAI, and you like it, there are several ways to show your appreciation:

  • Star this project.
    • It's a great way to show your appreciation, and it helps this project get more exposure.
  • Become a sponsor.
  • Contribute.
    • If you're a developer, you can contribute to this project by fixing bugs, adding features, or improving the documentation. See the CONTRIBUTING.md file for more information.
  • Spread the word.
    • Tell your friends, family, and colleagues about this project. The more people know about this project, the closer we get to the goal of making AI accessible to everyone without having to rely on any third-party services.

Consider becoming a sponsor. While the idea of this project is to make AI accessible to everyone, it comes at a cost, in terms of spending a lot of time on this project. My landlord doesn't accept GitHub stars as a form of payment, not yet at least. If you can afford it, please consider becoming a sponsor. It could be as little as $1 one time, $1 per month, or any other amount. Every little bit helps, both mentally and financially.

If you're a wealthy individual that was about to purchase a big luxury yacht, consider one less gold-plated knob on the steering wheel and use that money to add your name to the list of sponsors.

Download the Example App

AI for Everyone

The goal is to make AI accessible to everyone, right? That's why I've spent quite some time on making sure that the example app is available to download on all major platforms. I want to make it as easy as possible for everyone to try out. Nothing better than a real-world example to see what AubAI is capable of.

No technical knowledge required. Just download the app, and you're good to go.

Download the Example App from the stores

Make sure to to hit the "Star" button on this project if you like it. Perhaps one day my landlord will accept GitHub stars as a form of payment!

Setup

  1. Add the following to your pubspec.yaml file:
dependencies:
  aub_ai: ^1.0.0
  1. Run flutter pub get to install the package.

  2. Import the package in your Dart code:

import 'package:aub_ai/aub_ai.dart';
  1. Talk to the AI:
/// The output of the AI will be stored in this variable.
/// Can be used in a Text() widget, for example.
String outputByAI = '';

/// Example of how to use AubAI to talk to the AI.
Future<void> example() async {
  // Make sure that the model file is in the GGUF format.
  const String filePath = 'path/to/model.gguf';

  // The prompt to start the conversation with.
  const String promptByUser = 'Why is the sky blue?';

  // Pre-defined prompt templates are available.
  final promptTemplate = PromptTemplate.chatML().copyWith(
    prompt: promptByUser,
  );

  // THe main function that does all the magic.
  await talkAsync(
      filePathToModel: filePath,
      promptTemplate: promptTemplate,
      onTokenGenerated: (String token) {
        // This callback is called for every token generated by the AI.
        // A token can be seen as a partial word such as "hel" and "lo!".
        setState(() {
          outputByAI += token;
        });
      },
    );
}

Technical Details

AubAI is leveraging the power of llama.cpp. It's a C++ library that allows you to run AI models on your device. It's fast, it's lightweight, and it's open source. It's the perfect fit for AubAI.

While llama.cpp is a great library, it's not trivial to integrate it into a Flutter project. That's where AubAI comes in. It's a Flutter/Dart package that makes it easy to use llama.cpp in your Flutter project.

The vision of AubAI is to make AI accessible to everyone, and AI is more than just generating text. That's why AubAI is designed to be modular. Over time, more AI capabilities will be added to AubAI such as image generation, voice generation, and more.

Supported Model File Formats

  • [x] GGUF
Resources

If you're looking for a model file, you can find a couple here: HuggingFace.co.

At the time of writing, there are over 2300 models available. Some of them might be very good with math, others with coding, and others with poetry and some are good at everything. It's up to you to find the model that suits your use case for your app, or let your users choose a model like I did in the example app.

Disclaimer

AubAI, myself, and anyone else involved in this project are not responsible for any damages caused by the use of this project. Use at your own risk.

Licensing

Open Source Licensing

See the LICENSE file. All files are licensed under the AGPL-3.0 license, unless explicitly stated otherwise.

Commercial Licensing

AubAI is licensed under the AGPL-3.0 license. However, we understand that the AGPL-3.0 license is not always suitable for commercial use. Therefore, we offer a commercial license for those who wish to use AubAI in a commercial setting, but do not want to comply with the AGPL-3.0 license.

Please contact [daniel@brutalcoding.com](mailto:daniel@brutalcoding.com) to enquire about a commercial license.

Contributing

Please read the CONTRIBUTING.md file.

YouTube

Curious about AubAI? Have a look at my channel where I make videos about AubAI: YouTube.com/@BrutalCoding.

Demo's, tutorials, and more.

For your convenience, I have listed some of the videos below:

Werkloos

A Dutch word that perfectly describes my current situation: unemployed. But using that word in English might've made you skip this section, yet here you are. I'm glad you're still reading.

Recently, last September, the fintech startup I was working for had to shut down due to the challenging market conditions. While I'm currently looking for a new job, It's not easy to find a company that combines my passion for AI and Flutter.

I've decided to take a leap of faith and work on this project untill I find a new job, or until I run out of money (Jan-Feb 2024). Whichever comes first. Perhaps I'll find a way to make this project sustainable, while keeping it open source. I'm just going with the flow.

Friends of AubAI

  • shady.ai - The consumer-facing app that uses AubAI to run AI models locally. This is the app that I'm building to showcase AubAI's capabilities, and to make AI accessible to the masses.
  • llama.cpp - C++ library for building and running AI models locally.
  • Flutter Perth - Perth's Flutter meetup group. I'm the organizer. Join my regular online meetups to learn more about Flutter and AI.

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。