Coder Social home page Coder Social logo

brutalcoding / llama_dart Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 2.0 343 KB

Flutter / Dart bindings for llama.cpp

License: GNU Affero General Public License v3.0

Dart 97.01% Kotlin 0.07% Swift 0.92% Objective-C 0.02% HTML 1.01% C 0.98%
dart flutter llama-cpp shady-ai llama-dart

llama_dart's Introduction

llama_dart

Known Issues

If you encounter the error 'Couldn't resolve native function 'llama_context_default_params' on macOS ARM64, please refer to Issue #2 for details and updates. Contributions and insights are welcome.

Description

llama_dart is an experimental Flutter plugin designed to seamlessly integrate the capabilities of llama.cpp into your Flutter or Dart apps. Please note that this package is currently in development and may not be fully functional.

Steps to Run

Important: Native assets support in Flutter MacOS, iOS, and Linux is available on the master channel behind an experimental flag: flutter config --enable-native-assets and flutter create --template=package_ffi [package name]. See this comment for more details.

Here are the steps to run llama_dart:

  1. Switch to the master channel: flutter channel master
  2. Upgrade Flutter: flutter upgrade
  3. Enable native assets: flutter config --enable-native-assets
  4. Create a package using the ffi template: flutter create --template=package_ffi llama_dart
  5. Navigate to the project folder: cd llama_dart
  6. Get dependencies: flutter pub get
  7. Run the app: flutter run
  8. Generate bindings using Dart SDK (temporary workaround): dart --enable-experiment=native-assets run ffigen --config ffigen.yaml

Please note that step 8 currently requires using the Dart SDK instead of Flutter until the Flutter team completes implementing the feature in the Flutter SDK.

Supported Use Cases

llama_dart aims to support various use cases, including:

  • Running the app with flutter run
  • Debugging
  • Hot reload (1)
  • Hot restart (1)
  • Release/profile builds
  • Building debug/release/profile builds with flutter build
  • Running tests with flutter test or dart test
  • Adding to an app (e.g., flutter build macos-framework for MacOS)
  • Running with the Flutter tester: flutter run -dflutter-tester

Please note that the plugin is still under development, and not all use cases may be fully supported at this time.

Platform Support

  • MacOS
  • Windows
  • Linux
  • Android
  • iOS

Note: This list represents our intended platform support after addressing the initial issues on MacOS ARM64. Support for other platforms may be added in the future.

Coming Soon

Stay tuned for updates! llama_dart is meant to make it easier to incorporate llama.cpp capabilities into your Flutter or Dart apps, and we're actively working on improving its functionality.

If you encounter any issues or have additional information that could help, please feel free to contribute to the discussion. Your insights and experiences are valuable in addressing this problem effectively.

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.