GitHub Copilot Open Source Alternatives

GitHub's Copilot code generation tool is currently only available via approved request. Here are 4 Copilot alternatives that you can use in your programming today.

Last year, GitHub publicly unveiled Copilot, the preview of its "AI pair programmer," a code completion style tool designed to provide line or function suggestions in your IDE. It has certainly made waves in the world of programming and beyond, and you have likely heard at least something about it.

GitHub Copilot

But Copilot is more than simple autocomplete and is more context aware than other code assistants. Powered by OpenAI's Codex AI system, Copilot contextualizes a situation using docstrings, function names, comments, and preceding code to best generate and suggest what it determines to be the most appropriate code. Copilot is designed to improve over time, "learning" from how developers use it.


Trained on billions of lines of public code, GitHub Copilot puts the knowledge you need at your fingertips, saving you time and helping you stay focused.


Currently available for Visual Studio Code and platforms powered by a VS Code backend — such as GitHub's Codespaces — Copilot "understands" dozens of languages, with the technical preview being noted as doing "especially well for Python, JavaScript, TypeScript, Ruby, and Go." You can accept default code suggestions, cycle through additional proposals, modify the code you accept, or ignore Copilot suggestions at a particular point in your code altogether.

Presently, Copilot is only available via approved request. But fret not; open source alternatives of varying specification exist, and are available for you to try out right now.

Let's have a look at 4 code-generation and -suggestion alternatives to GitHub Copilot that you can use in your programming today. Though my investigation into these was prompted by the discovery of Second Mate (below), I have listed the options in descending order by number of GitHub stars, as it seemed as good a way to do so as any.


Captain Stack

We will start this off with Captain Stack, a code suggestion tool, as opposed to code generation.


This feature is somewhat similar to Github Copilot's code suggestion. But instead of using AI, it sends your search query to Google, then retrieves StackOverflow answers and autocompletes them for you.




Captain Stack only works with VSCode, making it an especially Copilot analog, and is installed as a VSCode extension.

Use Captain Stack to automate your Stack Overflow code copying! :)


GPT-Code-Clippy (GPT-CC)

GPT-Code-Clippy is a code-generation tool which employs a GPT-3 model for generation.


GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model -- based on GPT-3, called GPT-Codex -- that is fine-tuned on publicly available code from GitHub.




The VSCode extension of GPT-CC is available here. Somewhat curiously, from this extension repo, is the following reference to sitting atop the aforementioned Captain Stack:


This extension also sits completely atop this other clone of Github Copilot aptly named Captain Stack, since instead of synthesizing the answers using deep learning, it extracts them from StackOverflow posts.


Second Mate

Second Mate is a code-generation tool for Emacs, leveraging a GPT model.

An open-source, mini imitation of GitHub Copilot using EleutherAI GPT-Neo-2.7B (via Huggingface Model Hub) for Emacs.

This is a much smaller model so will likely not be as effective as Copilot, but can still be interesting to play around with!




Setup for Second Mate includes running a Flask app as a backend, and configuring the Emacs plugin to point at said backend server URL for submitting requests.


Clara-Copilot VSCode

Lastly, Clara-Copilot is a sparsely-documented VSCode Copilot alternative that doesn't explain upfront what mechanism it's using to accomplish its goals.


A alternative to Github Copilot for vscode until you get the access to github copilot.


(Edit: eagle-eyed reader FIREHAWK has noted that Clara-Copilot makes use of Code Grepper, making it a code search and recommendation solution as opposed to code generation).

It does, however, provide an example of how to use the extension, and boasts that it "[s]upports around ~ 50 Programming aproximately (sic) LOL !," and "[g]ives you snippets at an instant." Try at your own caution :)

Hopefully this small collection of alternatives provides you with something to hold you over until Copilot is released to the masses. You might even find that one of these are useful enough to work for you long term. Thanks to the respective authors of these tools.

Matthew Mayo (@mattmayo13) is a Data Scientist and the Editor-in-Chief of KDnuggets, the seminal online Data Science and Machine Learning resource. His interests lie in natural language processing, algorithm design and optimization, unsupervised learning, neural networks, and automated approaches to machine learning. Matthew holds a Master's degree in computer science and a graduate diploma in data mining. He can be reached at editor1 at kdnuggets[dot]com.