We know how GitHub Copilot has revolutionized the developer’s toolkit. This paid AI service, offered by GitHub/Microsoft, excels at generating code, enabling faster and more efficient work. As someone who isn’t a developer, I find this tool incredibly helpful in achieving my goals without much hassle.
However, there’s a caveat: GitHub Copilot is an online service. This means that a shaky internet connection can quickly lead to frustration, and that’s where Localpilot steps in.
Localpilot is a tool that allows you to have the equivalent of GitHub Copilot locally on your MacBook M1/M2 with just one click, using models like CodeLlama or Mistral. This becomes particularly handy when you’re stuck on a train without Wi-Fi or dealing with an internet connection as slow as a snail. Of course, at any time, you can switch back to the real Copilot online.
To install Localpilot, open VS Code Settings and add the following to your settings.json file:
"github.copilot.advanced": { "debug.testOverrideProxyUrl": "http://localhost:5001", "debug.overrideProxyUrl": "http://localhost:5001" }
Next, create a virtualenv to launch this Python process, install the prerequisites, and download the templates:
virtualenv venv source venv/bin/activate pip install -r requirements.txt # First run of the installation. Multiple models will be downloaded to your ~/models folder. python app.py --setup
Then, all you have to do is launch the creature like this:
python app.py
Once everything is set up, you can use GitHub Copilot locally without worrying about connection issues, latency, or pricing since it’s cheaper than free ^^.
Localpilot’s performance can vary based on the complexity of the functions you’re trying to generate and the model you’re using. But, in general, the tool does a commendable job and proves extremely useful for developers who prefer working offline or encounter connection issues.
I hope this piques your interest!
Enjoy!
"Because of the Google update, I, like many other blogs, lost a lot of traffic."
Join the Newsletter
Please, subscribe to get our latest content by email.