ItsPi3141 / alpaca-electron

The simplest way to run Alpaca (and other LLaMA-based local LLMs) on your own computer
MIT License
1.28k stars 141 forks source link
ai alpaca alpaca-electron app chat chatgpt dalai docker electron electron-app linux llama macos ui webui windows


Alpaca Electron


Alpaca Electron is built from the ground-up to be the easiest way to chat with the alpaca AI models. No command line or compiling needed!


Important:

Only windows is current supported for now. The new llama.cpp binaries that support GGUF have not been built for other platforms yet.
If you would like to help, please makea pull request and update the binaries in ./bin

πŸ“ƒ Features + to-do

🎞 Demo

Demonstration

πŸš€ Quick Start Guide

  1. Download an Alpaca model (7B native is recommended) and place it somewhere on your computer where it's easy to find.

    Note
    Download links will not be provided in this repository.

  2. Download the latest installer from the releases page section.

  3. Open the installer and wait for it to install.

  4. Once done installing, it'll ask for a valid path to a model. Now, go to where you placed the model, hold shift, right click on the file, and then click on "Copy as Path". Then, paste this into that dialog box and click Confirm.

  5. The program will automatically restart. Now you can begin chatting!

Note
The program will also accept any other 4 bit quantized .bin model files. If you can find other .bin Alpaca model files, you can use them instead of the one recommended in the Quick Start Guide to experiment with different models. As always, be careful about what you download from the internet.

πŸ”§ Troubleshooting

General

Windows

MacOS

Linux

Docker Compose

Clone the repository:

git clone https://github.com/ItsPi3141/alpaca-electron.git

Change your current directory to alpaca-electron:

cd alpaca-electron

Build the container image:

docker compose build

Run the application container:

docker compose up -d

βš’οΈ Building

Prerequisites

(OPTIONAL) Building llama.cpp from source

  1. Clone llama.cpp's GitHub repo

    git clone https://github.com/ggerganov/llama.cpp
    cd llama.cpp
  2. Build llama.cpp On Windows:

    mkdir build
    cd build
    cmake ..
    cmake . --config Release

On Linux and MacOS:

make

Running the project from source

  1. Clone the GitHub repo

    git clone https://github.com/ItsPi3141/alpaca-electron
    cd alpaca-electron
  2. Install node packages

    npm install
    npm run rebuild

    Info If you are on Linux, replace npm run rebuild with npm run rebuild-linux

  3. (OPTIONAL) Use your own llama.cpp build

    Warning
    This step is not required. Only do it if you had built llama.cpp yourself and you want to use that build. Otherwise, skip to step 4 If you had built llama.cpp in the previous section, copy the main executable file into the bin folder inside the alpaca-electron folder.

Make sure the file replaces the correct file. E.g. if you're on Windows, replace chat.exe with your file. If you're on arm64 MacOS, replace chat_mac_arm64. Etc...

  1. Start the Electron app
    npm start

Building a release and installer

Run one of the following commands:

You can only build for the OS you are running the build on. E.g. if you are on Windows, you can build for Windows, but not for MacOS and Linux.

πŸ‘¨β€πŸ’» Credits

Credits go to @antimatter15 for creating alpaca.cpp and to @ggerganov for creating llama.cpp, the backbones behind alpaca.cpp. Finally, credits go to Meta and Stanford for creating the LLaMA and Alpaca models, respectively.

Special thanks to @keldenl for providing arm64 builds for MacOS and @W48B1T for providing Linux builds