keldenl / fleece

Llama for VSCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fleece

Fleece Logo

Fleece is a Visual Studio Code extension that allows developers to generate code using natural language. It's powered by dalai, an open source project that uses llama.cpp and alpaca.cpp language models to understand and interpret natural language.

Demo

Fleece Demo

The above demo showcases the comment-to-code feature of Fleece in real-time on an M1 Mac.

Installation

  1. Install Dalai globally:
npm install dalai -g
  1. Follow the steps here to install the models via dalai's readme.

  2. Install the Fleece extension from the VSCode extension marketplace or by building it from this repo or downloading the latest .vsix release in this repo.

Usage

Fleece currently has one feature: comment-to-code. An indicator for the hotkeys to trigger comment-to-code will show up automatically on comments. Simply press command+option+c on Mac to trigger the process. This will automatically start a Dalai server and send the comment as a request.

Note that Fleece is limited by the model used and the training data, so it's only as good as the Llama or Alpaca model. More features like autocomplete or language chatbot to answer questions will be added in the future.

Local Building and Installation

  1. Clone the repository:
git clone git@github.com:keldenl/fleece.git
  1. Install vsce globally (if not already installed):
npm install -g @vscode/vsce
  1. In the cloned repository, run the following command to generate a .vsix file:
vsce package
  1. This should generate a .vsix file, which can be installed in VS Code via the command palette (Ctrl+Shift+P) using the "Extensions: Install from VSIX..." command.

  2. Alternatively, you can also build and run Fleece locally in VS Code using the following steps:

  • Open the cloned repository in VS Code
  • Press F5 to start a local build and launch an instance of VS Code with the Fleece extension
  • Use the extension in the launched instance of VS Code

Contributing

Contributions to Fleece are welcome! To contribute, follow these guidelines:

  1. Clone the repo.
  2. Create a new branch.
  3. Make your changes and commit them.
  4. Open a pull request (PR) and describe your changes.
  5. Collaborators will review the changes and approve/merge if they are satisfactory.

Coding Guidelines

When contributing to Fleece, please follow these coding guidelines:

  • Write clean and readable code with proper indentation and comments.
  • Use meaningful and descriptive variable and function names.
  • Keep functions short and focused on one task.
  • Test your code thoroughly before committing changes.

Disclaimer

Note that the model weights are only to be used for research purposes, as they are derivative of LLaMA, and uses the published instruction data from the Stanford Alpaca project which is generated by OpenAI, which itself disallows the usage of its outputs to train competing models.

About

Llama for VSCode

License:MIT License


Languages

Language:JavaScript 100.0%