Skip to content

divy-sh/breve

Repository files navigation

Breve

Breve is a cross-platform application built using Tauri, Vue 3, and TypeScript. It provides a conversational interface that allows users to create, manage, and continue conversations, storing all data locally using SQLite through a Rust backend.

Features

  • Run LLMs locally on any device, without internet connection
  • Calculate maximum context length and query length based on Device memory
  • Cross-platform application using Tauri and Vue 3
  • Create, update, and delete conversations
  • Persist conversations locally in SQLite
  • Rust backend for secure, high-performance operations
  • Hot-reloading and easy development experience

Screenshots

alt text alt text alt text alt text alt text alt text

Architecture

  • Frontend: Vue 3, TypeScript, Vite
  • Backend: Tauri (Rust), SQLite for local data storage
  • Data Model: Conversations are stored and managed using a local SQLite database, with Rust providing data access and business logic.
  • Communication: Frontend and backend interact via Tauri commands.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/divy-sh/breve.git
    cd breve
  2. Install frontend dependencies:

    yarn install
    # or
    npm install
  3. You can choose and add any new models to infrastructure/config.rs and it would show up on the download page.

    config.rs
  4. You will get the download model page on first start.

  5. Run the development server:

    yarn tauri dev
    # or
    npm run tauri dev

Build

To build the app for production:

yarn tauri build
# or
npm run tauri build

Packaging

Setup

  • Intall android sdk, and export its path - export ANDROID_HOME "android/"
  • Intall android ndk, and export its path - export NDK_HOME "android/ndk/ndk-version"
  • Run npm run tauri android init

To package for android:

Add the following to src-tauri/gen/android/app/build.gradle.kts:

defaultConfig {
   ...
}

signingConfigs {
   create("release") {
      val keystorePropertiesFile = rootProject.file("keystore.properties")
      val keystoreProperties = Properties()
      if (keystorePropertiesFile.exists()) {
            keystoreProperties.load(FileInputStream(keystorePropertiesFile))
      }

      keyAlias = keystoreProperties["keyAlias"] as String
      keyPassword = keystoreProperties["password"] as String
      storeFile = file(keystoreProperties["storeFile"] as String)
      storePassword = keystoreProperties["password"] as String
   }
}
buildTypes {
   ...
}

Add the following to src-tauri/gen/android/app/src/main/AndroidManifest.xml

<activity
   # this line
   android:windowSoftInputMode="adjustResize"
   ...>
      <intent-filter>
      ...
      </intent-filter>
</activity>

Add File keystorre.properties to src-tauri/gen/android/

password=you key alias password
keyAlias=your key alias
storeFile=your google play keystore file path

apk file

npm run tauri android build -- --apk

aab file

npm run tauri android build -- --aab
--relese // add this for release

If you want to set build type debug:

--debug // add this for debug

To sign the android package, go through the following link: Tauri android App Signing

Recommended IDE Setup

Type Support For .vue Imports in TS

Since TypeScript cannot handle type information for .vue imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue imports (for example to get props validation when using manual h(...) calls), you can enable Volar's Take Over mode by following these steps:

  1. Run Extensions: Show Built-in Extensions from VS Code's command palette, look for TypeScript and JavaScript Language Features, then right click and select Disable (Workspace). By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
  2. Reload the VS Code window by running Developer: Reload Window from the command palette.

Learn more about Take Over mode here.

Contributing

Contributions are welcome! Please open issues and pull requests to help improve Breve.

TODO

  1. Fix the model switching issue on model configuration change.

About

Run LLMs on your device

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors