Copilot is GitHub’s propietry AI based code completion tool. It works by sending your code to GitHub’s server to run against the AI model. It has also ended the free-beta program and now is a paid service.
moyix/fauxpilot is an open-source alternative based on Salesforce’s CodeGen model. Fauxpilot requires docker and an Nvidia GPU.
Since I am using windows + WSL, I wanted to document my setup for Fauxpilot.
Docker In WSL
I like installing docker community engine in WSL instead of using Docker Desktop.
Docker’s website covers the instructions well for installing on Ubuntu. It looks like docker compose
has become a docker subcommand now so docker-compose
command is no longer installed if you follow the standard instructions.
I worked around this by just creating a wrapper script called docker-compose
:
#!/usr/bin/env bash
docker compose $@
Remember to put this file somewhere that’s in your path and also to chmod +x <file>
.
I then also followed the optional step to add $USER
to the docker group to allow me to run docker commands without sudo.
Nvidia support in Docker in WSL
WSL has amazing support for Nvidia GPU’s out-of-the-box. This is the general documentation but as long as you have the latest Nvidia drivers, WSL will have access to the GPU.
So then I just had to install the nvidia-container-toolkit to make sure that the GPU was accessible from docker.
Fauxpilot
At this point, all the dependencies were available so I could run Fauxpilot.
git clone https://github.com/moyix/fauxpilot.git
cd fauxpilot
./setup.sh
# <wait for all downloads>
./launch.sh
./launch.sh
will bring up a server that can accept requests for completion.
VSCode
I first tried using the Copilot VSCode extension but it seems to disable itself immediately if you are not paying for it. GitLab’s VSCode Extension recently added the ability to use Fauxpilot as the code completion engine so I was able to use that to get the same feature.
After installing the extension, I changed these settings (the weird capitalization exists in the setting names):
- Gitlab Aiassit Enabled - True
- Gitlab Aiassist Engine - Fauxpilot
- Gitlab Aiassist Server - defaults to
localhost:5000
(which is where fauxpilot was running for me)
After doing this I had the code completion working and was able to record the video from above!