Coder Social home page Coder Social logo

brutalcoding / aub.ai Goto Github PK

View Code? Open in Web Editor NEW
144.0 9.0 11.0 122.2 MB

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

Home Page: https://pub.dev/packages/aub_ai

License: GNU Affero General Public License v3.0

Shell 7.51% Kotlin 0.05% Ruby 2.29% Swift 0.60% Objective-C 0.01% Dart 72.59% CMake 7.81% C++ 8.58% C 0.40% Objective-C++ 0.16%
android dart flutter gen-ai ios ipados linux llamacpp macos mistral-7b

aub.ai's Introduction

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

  • 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 [email protected] 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.

aub.ai's People

Contributors

brutalcoding avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aub.ai's Issues

Load GUFF from assets?

Hi,

Say I put my guff in assets and added in yaml like this

flutter:
  assets:
    - assets/bin/

Can or will it be possible to use it like talkAsync, without dump the file into App's files dir?

Android 8.0, better 7.0

Hello, can you make compatibility for lower androids? I havr tried your app on Xiaomi Redmi Note 8 Pro, but woild like to try it on my own phone.

Thank you for understanding and especially for your great job! It is awesome app!

Performance Issue On Android

Hello,

First I'll say, really impressed by this library and looking forward to TTS!

I ran the example project on my android pixel 7 (Same one you used) and I am not seeing the same performance that was presented in the video here https://www.youtube.com/watch?v=SBaSpwXRz94 . I am getting about 1 word every 20 seconds.

I used the tinyllama-1.1b-chat-v1.0.Q2_K.gguf model found here.
https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/tree/main

I tried on a few more models and got the same issue.

Was there a specific model needed to achieved this? Or any specific configuration?

Run command: flutter run -d 28301FDH200MY4 --release

Device Info:

[
  {
    "name": "Pixel 7",
    "id": "28301FDH200MY4",
    "isSupported": true,
    "targetPlatform": "android-arm64",
    "emulator": false,
    "sdk": "Android 14 (API 34)",
    "capabilities": {
      "hotReload": true,
      "hotRestart": true,
      "screenshot": true,
      "fastStart": true,
      "flutterExit": true,
      "hardwareRendering": false,
      "startPaused": true
    }
  }
]

Build Failures on Windows: CMake Version Conflicts and Missing prompt_template.dart When Running Example App

Hi there! This plugin looks really cool, seems like you've done a lot of work on this. Very impressive.

I'm trying to test out the example app on Android from my Windows 10 machine. I'm very inexperienced with flutter, but I've been able to test out previous flutter projects on my own devices before which worked fine, but when I try to run flutter run for the example app I get an error related to the cmake version installed.

flutter run
Launching lib\main.dart on Pixel 8 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':aub_ai:configureCMakeDebug[arm64-v8a]'.
> [CXX1405] error when building with cmake using [Project Path]\src\CMakeLists.txt: -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: [Android SDK Path]\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: [Android SDK Path]\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring incomplete, errors occurred!
  See also "[Project Path]\android\.cxx\Debug\[Build ID]\arm64-v8a\CMakeFiles\CMakeOutput.log".

  C++ build system [configure] failed while executing:
      @echo off
      "[Android SDK Path]\cmake\3.18.1\bin\cmake.exe" ^
        "-H[Project Path]\src" ^
        "-DCMAKE_SYSTEM_NAME=Android" ^
        "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
        "-DCMAKE_SYSTEM_VERSION=28" ^
        "-DANDROID_PLATFORM=android-28" ^
        "-DANDROID_ABI=arm64-v8a" ^
        "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^
        "-DANDROID_NDK=[Android SDK Path]\ndk\23.1.7779620" ^
        "-DCMAKE_ANDROID_NDK=[Android SDK Path]\ndk\23.1.7779620" ^
        "-DCMAKE_TOOLCHAIN_FILE=[Android SDK Path]\ndk\23.1.7779620\build\cmake\android.toolchain.cmake" ^
        "-DCMAKE_MAKE_PROGRAM=[Android SDK Path]\cmake\3.18.1\bin\ninja.exe" ^
        "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=[Project Path]\example\build\aub_ai\intermediates\cxx\Debug\[Build ID]\obj\arm64-v8a" ^
        "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=[Project Path]\example\build\aub_ai\intermediates\cxx\Debug\[Build ID]\obj\arm64-v8a" ^
        "-DCMAKE_BUILD_TYPE=Debug" ^
        "-B[Project Path]\android\.cxx\Debug\[Build ID]\arm64-v8a" ^
        -GNinja
    from [Project Path]\android
  CMake Warning at [Android SDK Path]\ndk\23.1.7779620\build\cmake\android-legacy.toolchain.cmake:416 (message):
    An old version of CMake is being used that cannot automatically detect
    compiler attributes.  Compiler identification is being bypassed.  Some
    values may be wrong or missing.  Update to CMake 3.19 or newer to use
    CMake's built-in compiler identification.
  Call Stack (most recent call first):
    [Android SDK Path]\ndk\23.1.7779620\build\cmake\android.toolchain.cmake:55 (include)
    [Android SDK Path]\cmake\3.18.1\share\cmake-3.18\Modules\CMakeDetermineSystem.cmake:93 (include)
    CMakeLists.txt:6 (project)


  CMake Error at CMakeLists.txt:9 (add_subdirectory):
    The source directory

      [Project Path]\src\llama.cpp

    does not contain a CMakeLists.txt file.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s
Running Gradle task 'assembleDebug'...                             15.5s
Error: Gradle task assembleDebug failed with exit code 1

I've tried installing a newer version of cmake from Android Studio's SDK Manager but even when I uninstall cmake v3.18.1 and installed 3.22.1 it always tries to use 3.18. I figured it's tied to the NDK version then so I tried installing NDK 26.1 and uninstalling 23.1 but then when I run flutter run it automatically installs 23.1 and runs into the same error as above.

I then tried pointing aub_ai in pubspec.yaml to the version of aub_ai to use rather than using the locally cloned repo aub_ai: ^1.0.3 instead of aub_ai \n path: ../ but this gets me to the following error, where it seems prompt_template.dart is missing

flutter run
Launching lib\main.dart on Pixel 8 in debug mode...
lib/main.dart:4:8: Error: Error when reading '[...]/AppData/Local/Pub/Cache/hosted/pub.dev/aub_ai-1.0.3/lib/data/prompt_template.dart': The system cannot find the path specified.

import 'package:aub_ai/data/prompt_template.dart';
       ^
lib/main.dart:41:3: Error: Type 'PromptTemplate' not found.
  PromptTemplate promptTemplate = PromptTemplate.chatML();
  ^^^^^^^^^^^^^^
lib/main.dart:41:3: Error: 'PromptTemplate' isn't a type.
  PromptTemplate promptTemplate = PromptTemplate.chatML();
  ^^^^^^^^^^^^^^
lib/main.dart:41:35: Error: Undefined name 'PromptTemplate'.
  PromptTemplate promptTemplate = PromptTemplate.chatML();
                                  ^^^^^^^^^^^^^^
lib/main.dart:313:5: Error: 'PromptTemplate' isn't a type.
    PromptTemplate? tmpPromptTemplate;
    ^^^^^^^^^^^^^^
lib/main.dart:322:27: Error: The method 'PromptTemplate' isn't defined for the class '_MyAppState'.
 - '_MyAppState' is from 'package:aub_ai_example/main.dart' ('lib/main.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PromptTemplate'.
      tmpPromptTemplate = PromptTemplate(
                          ^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '[Flutter SDK Path]\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 11s
Running Gradle task 'assembleDebug'...                             11.6s
Error: Gradle task assembleDebug failed with exit code 1

Not sure if this problem is related to my flutter setup, so here is the output of flutter doctor -v just in case

flutter doctor -v
[√] Flutter (Channel master, 3.17.0-9.0.pre.13, on Microsoft Windows [Version 10.0.19045.3803], locale en-NL)
    • Flutter version 3.17.0-9.0.pre.13 on channel master at C:\Users\KJW\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dfa694ec8f (5 weeks ago), 2023-11-14 16:10:17 -0500
    • Engine revision f15b259fe9
    • Dart version 3.3.0 (build 3.3.0-127.0.dev)
    • DevTools version 2.30.0-dev.4

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\KJW\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\KJW\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.30)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.34031.81
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.85.0)
    • VS Code at C:\Users\KJW\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.78.0

[√] Connected device (4 available)
    • Pixel 8 (mobile)  • 38031FDJH00MTA • android-arm64  • Android 14 (API 34)
    • Windows (desktop) • windows        • windows-x64    • Microsoft Windows [Version 10.0.19045.3803]
    • Chrome (web)      • chrome         • web-javascript • Google Chrome 119.0.6045.200
    • Edge (web)        • edge           • web-javascript • Microsoft Edge 120.0.2210.77

[√] Network resources
    • All expected network resources are available.

• No issues found!

Thanks for this plugin btw, I really hope I can get this working and can start playing around with it.

Groetjes uit het moederland 🇳🇱

Feedback

Hey I have officially run a 7b model on my Android using your app.

system
You are a helpful assistant. Be concise and helpful. If you don't know the answer to a question, please don't share false information.
user
What's up?
assistant
Not much, just here to assist you with any questions or information you may need. How can I help you today?

It is slower and has less functions (like sampling settings, changing picture, prompt templates) than https://github.com/Mobile-Artificial-Intelligence/maid however I like that you plan to release a standalone plugin that can be used in other projects. For now I will stick with maid but will have an eye on this project.

Fix support for Metal on macOS systems

By default, llama.cpp uses Metal GPU acceleration when running on macOS.

This works fine when I used llama.cpp on its own, but things get complicated when trying to bundle this in a native Mac app.

When bundling the native dynamic library for macOS, and leaving Metal support turned on, I would get the following error when compiling the macOS project:

"ggml_metal_init: found device: Apple M1 Pro
ggml_metal_init: picking default device: Apple M1 Pro
ggml_metal_init: default.metallib not found, loading from source
ggml_metal_init: error: could not use bundle path to find ggml-metal.metal, falling back to trying cwd
ggml_metal_init: loading 'ggml-metal.metal'
ggml_metal_init: error: Error Domain=NSCocoaErrorDomain Code=260 "The file “ggml-metal.metal” couldn’t be opened because there is no such file." UserInfo={NSFilePath=ggml-metal.metal, NSUnderlyingError=0x1572d8b70 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
llama_new_context_with_model: ggml_metal_init() failed"

I've tried bundling the .metal file within the native macOS project directory, in various locations, to no avail. I do think I can solve this, I just haven't gotten the time to spend more hours on this issue.

As for the time being, the current macOS library doesn't make use of Metal and instead relies on CPU entirely.

Support for Google Gemma models?

In the official LLama.cpp repo, the Gemma Models are supported. Can this be supported? It just needs the latest version of Llama.cpp.

Example app error

cloned repo and did pub get. flutter run

Lexical or Preprocessor Issue (Xcode): 'llama.cpp/llama.h' file not found

Is this something we need to download?

What's the equivalent of `create_chat_completion` in llama-cpp-python

Hi,

Some of the models in Hugeface shows the support of create_chat_completion, but now this plugin seems only support the Simple inference, will Chat Completion be supported in the future version?

https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF

from llama_cpp import Llama

# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
llm = Llama(
  model_path="./tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf",  # Download the model file first
  n_ctx=2048,  # The max sequence length to use - note that longer sequence lengths require much more resources
  n_threads=8,            # The number of CPU threads to use, tailor to your system and the resulting performance
  n_gpu_layers=35         # The number of layers to offload to GPU, if you have GPU acceleration available
)

# Simple inference example
output = llm(
  "<|system|>\n{system_message}</s>\n<|user|>\n{prompt}</s>\n<|assistant|>", # Prompt
  max_tokens=512,  # Generate up to 512 tokens
  stop=["</s>"],   # Example stop token - not necessarily correct for this specific model! Please check before using.
  echo=True        # Whether to echo the prompt
)

# Chat Completion API

llm = Llama(model_path="./tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf", chat_format="llama-2")  # Set chat_format according to the model you are using
llm.create_chat_completion(
    messages = [
        {"role": "system", "content": "You are a story writing assistant."},
        {
            "role": "user",
            "content": "Write a story about llamas."
        }
    ]
)

DartWorker (46): EXC_BAD_ACCESS

Hello, I've been trying to run the example app on my phone but I seem to be getting an error. I've tried 2 different models to ensure it's not an issue with the model and also attached a screenshot of the line of code that's resulting in an error.

iPhone details:
iPhone 13 Pro
iOS Version 17.2.1

Recordings:
https://github.com/BrutalCoding/aub.ai/assets/146910627/979e497e-fdf3-49fa-b4cb-c310a40044ae
https://github.com/BrutalCoding/aub.ai/assets/146910627/99a20707-3d50-402b-8c06-f5872d925325

Screenshot:

If you require any further information then please let know 🙂

Andoird libllama.so error

Ran the app on an android device. It seemed to cmake build the llama.cpp. Downloaded GGUF file and loaded it.

When I asked a question I got:

ArgumentError (Invalid argument(s): Failed to load dynamic library 'libllama.so': dlopen failed: library "libllama.so" not found)

Phi-2

App crash after third message on phi-2.Q5_K_M.gguf model on iPhone 15 Pro Max
App version: 1.2.0

Migrate from llama_eval to llama_decode (including llama_batch usage)

Related to #15 #17

I'm updating aub.ai to make use the latest version of llama.cpp. This update has deprecated the llama_eval function in favor of llama_decode, which now requires the use of llama_batch. While I was aware of this upcoming change a while ago, I hadn't had the time to migrate away yet.

This issue has my highest priority, please be patient while I work out some technical difficulties.

At the time of this writing, it's the start of the evening here on a Sunday. I will continue development but I honestly do not think I am able to finish migration, compile/test for each platform and package this up for a release on pub.dev (as the aub_ai package), neither as an app (e.g. TestFlight) etc. Each step is do-able, but all together always takes quite some time without a proper CI/CD setup (sorry, comes later!). Please wait while I go through these steps, you can follow some of this work here in this branch: https://github.com/BrutalCoding/aub.ai/tree/feature/sync-with-latest-llamacpp

Challenges:

  • I've updated my code to use llama_decode and llama_batch, but the AI model is now outputting strange Unicode characters. This indicates an incorrect implementation on my side.

Tasks:

  • Review example code utilizing llama_decode and llama_batch within the llama.cpp repository or related projects.
  • Carefully analyze the differences between how I used llama_eval previously and the expected input/output structures for llama_decode.
  • Debug and adjust my code to ensure correct tokenization, batching, and handling of model output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.