I implemented a "mini" version of Copilot using EleutherAl GPT-Neo-2.7B and HuggingFace model hub and wrote a wrapper to use in emacs -- https://github.com/samrawal/emacs-secondmate
It's much more rudimentary compared to Copilot, but it's fun to play around with, and it can be run completely locally (after the model is downloaded). Plus it runs using a simple Flask local server, so it can be easily extended to other text editors.