This is a starter app that uses Electron and React to build cross-platform desktop apps that can run llamafiles. Llamafile allows you to share and execute LLMs across platforms using a single file.
Download a llamafile from the llamafile repo and place it in the 'assets/llamafile' directory then linked by changing the exec
command file path in src/main/main.ts
. The mistral-7b-instruct-v0.1-Q4_K_M-main.llamafile is the current default.
Or build your own llamafile from any llama-variant model and link it the same way.
This starter app is based on Electron React Boilerplate with minimal changes to create a simple chat interface.
Thanks to the Electron React Boilerplate, Electron, React, Llamafile, llama.cpp, and all the other open source projects that make this one possible.
Clone the repo and install dependencies:
git clone --depth 1 --branch main https://github.com/swkidd/react-electron-llamafile-starter.git
cd your-project-name
npm install
NOTE: Any llamafile can be used, but the filepath for the exec command in
src/main/main.ts must be changed to match the location.
The default llamafile is mistral-7b-instruct-v0.1-Q4_K_M-main.llamafile
and default path is assets/llamafile/mistral-7b-instruct-v0.1-Q4_K_M-main.llamafile
Default llamafile (copied from the llamafile repo)
LINK: mistral-7b-instruct-v0.1-Q4_K_M-main.llamafile
Start the app in the dev
environment:
npm start
To package apps for the local platform:
npm run package
MIT