vscode-llamafile: llamafile extension for VSCodeThis Visual Studio Code extension allows you to use a local llamafile to generate code or natural language responses to your questions from you LLM instance, right within the editor. Supercharge your coding with AI-powered assistance! Automatically write new code from scratch, ask questions, get explanations, refactor code, find bugs and more 🚀✨ This extension is based on Tim Kmecl's excellent CodeGPT extension. Please go give him a star, and maybe even buy him a coffee! Links:Features
InstallationTo use this extension, install it from the VSCode marketplace.
After completing these steps, the extension should be ready to use. Obtaining llamafile instanceTo use this extension, you will need a running llamafile instance. To start one, follow these steps:
Using the ExtensionTo use the extension, open a text editor in Visual Studio Code and open the llamafile panel by clicking on the llamafile icon in the sidebar. This will open a panel with an input field where you can enter your prompt or question. By clicking enter, it will be sent to your llamafile. Its response will be displayed below the input field in the sidebar (note that it may take some time for it to be calculated). You can also select a code snippet in the editor and then enter a prompt in the side panel, or right-click and select "Ask llamafile". The selected code will be automatically appended to your query when it is sent to the AI. This can be useful for generating code snippets or getting explanations for specific pieces of code. To insert a code snippet from the AI's response into the editor, simply click on the code block in the panel. The code will be automatically inserted at the cursor position in the active editor. You can select some code in the editor, right click on it and choose one of the following shortcuts from the context menu: Commands:
There, you can also change the temperature and number of tokens that will be returned by the AI. The default values are 0.5 and 1024, respectively. Please note that this extension is currently a proof of concept and may have some limitations or bugs. We welcome feedback and contributions to improve the extension. Also check out the original CodeGPT extension which this project is based on. If you enjoy this extension, please consider buying Tim a coffee ☕️ to support his work! I wouldn't be able to make this version without him! |