privy
privy copied to clipboard
An open-source alternative to GitHub copilot that runs locally.
Pre-requisites
If you haven't done already, please pick one of the following platforms to run LLM of your choice on your system locally.
Some of the popular LLMs that we recommend are:
Quick Install
You can install Privy extension from the Visual Studio Code Marketplace or from the Open VSX Registry.
Configuration Options
Please set the following options in the settings for Privy extension.
- privy.model: Select the LLM that you want to use. Supports Mistral and CodeLLama. Experimental support for GPT-3.5-Turbo and GPT-4.
-
privy.provider: Pick the platform that is being used for running LLMs locally. There is support for using OpenAI, but this will affect the privacy aspects of the solution. The default is
Ollama
. -
privy.providerUrl: The URL of the platform that is being used for running LLMs locally. The default is
http://localhost:11434
.
Features
AI Chat | Explain Code | Generate Tests | Find Bugs | Diagnose Errors
AI Chat
Chat with Privy about your code and software development topics. Privy knows the editor selection at the time of conversation start.
- You can start a chat using one of the following options:
- Run the
Privy: Start Chat 💬
command from the command palette. - Select the
Privy > Start Chat 💬
entry in the editor context menu (right-click, requires selection). - Use the "Start new chat" button in the side panel.
- Use the keyboard shortcut:
Ctrl + Cmd + C
(Mac) orCtrl + Alt + C
(Windows / Linux). - Press 💬 on the MacOS touch bar (if available).
- Run the
- Ask a question in the new conversation thread in the Privy sidebar panel.
Explain Code
Ask Privy to explain the selected code.
- Select the code that you want to have explained in the editor.
- Invoke the "Explain Code" command using one of the following options:
- Run the
Privy: Explain Code 💬
command from the command palette. - Select the
Privy > Explain Code 💬
entry in the editor context menu (right-click).
- Run the
- The explanations shows up in the Privy sidebar panel.
Generate Unit Test
Generate a unit test for the selected code.
- Select a piece of code in the editor for which you want to generate a test case.
- Invoke the "Generate Unit Test" command using one of the following options:
- Run the
Privy: Generate Unit Test 💬
command from the command palette. - Select the
Privy > Generate Unit Test 💬
entry in the editor context menu (right-click).
- Run the
- The test case shows up in a new editor tab. You can refine it in the conversation panel.
Find Bugs
Identify potential defects in your code.
- Select a piece of code that you want to check for bugs.
- Invoke the "Find Bugs" command using one of the following options:
- Run the
Privy: Find Bugs 💬
command from the command palette. - Select the
Privy > Find Bugs 💬
entry in the editor context menu (right-click).
- Run the
- Privy will show you a list of potential bugs in the chat window. You can refine it in the conversation panel.
Diagnose Errors
Let Privy identify error causes and suggest fixes to fix compiler and linter errors faster.
- Select a piece of code in the editor that contains errors.
- Invoke the "Diagnose Errors" command using one of the following options:
- Run the
Privy: Diagnose Errors 💬
command from the command palette. - Select the
Privy > Diagnose Errors 💬
entry in the editor context menu (right-click).
- Run the
- A potential solution will be shown in the chat window. You can refine it in the conversation panel.
Tips and Tricks
Understanding these concepts will help you get the most out of Privy.
- Be specific. When you ask for, e.g., code changes, include concrete names and describe the desired outcome. Avoid vague references.
- Provide context. You can include the programming language ("in Rust") or other relevant contexts for basic questions. You can select a meaningful code snippet for code explanations and error diagnosis.
- Do not trust answers blindly. It's a big step for Privy to be able to respond to your questions. It might respond with inaccurate answers, especially when talking about less well-known topics or when the conversation gets too detailed.
- Use different chat threads for different topics. Shorter threads with specific topics will help Privy respond more accurately.
Credits
- RubberDuck AI - This project is heavily inspired by RubberDuck AI's work, and we're indebted to them for building on top of it.
Contributors
Code Contributions
Contributing Guide
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes.
Good First Issues
To help you get your feet wet and become familiar with our contribution process, we have a list of good first issues that contains things with a relatively limited scope. This is a great place to get started!