Learning GitHub Copilot
Useful resources for learning GitHub Copilot and AI coding tools. I will continuously update this list.
GitHub Copilot and Alternatives#
- Captain Stack — Code suggestion for VSCode - VSCode extension for code suggestion.
- CodeGeeX: A Multilingual Code Generation Model with VS Code and Jetbrains extensions. [official article, article]
- FauxPilot – an attempt to build a locally hosted version of GitHub Copilot (github.com/moyix)
- Show HN: Codeium: Free Copilot Alternative for Vim / Neovim (github.com/exafunction) - Be careful of this project (has telemetry dialling home)
- Mar 2023: Codeium for Enterprises: Fine-tuning models on your existing repository entirely within your self-hosted Codeium instance. Full suite of AI acceleration for coding.
- Kodezi
- Buildt AI VSCode extension [Tweet]
- Amazon Codewhisperer
- Facebook’s InCoder [Tweet, Paper]
- Salesforce’s CodeGen [Blog post]
- BigCode
- Magic - Software that builds software.
- Blackbox
- Codium AI
LLMs#
- Codex by OpenAI
- SantaCoder by HuggingFace [HN: https://news.ycombinator.com/item?id=34097642]
- “Is anyone else here building AI programming services based on models like this? I see a lot of comments saying the models can’t do much programming. But I just suspect there must be a silent contingent that is also working on services like that. And maybe less likely to promote the abilities of these models because it encourages competition.”
- “We’re building tools like this at Grit: https://www.grit.io/ These kinds of models are particularly good at repetitive, boring work like refactoring legacy code and completing framework migrations. Unlike Copilot, we’ve specialized specifically in these areas and completing them end-to-end (instead of just sitting in the IDE, we open already-verified PRs).”
- “There’s replit. Constantly announcing new features around such models. They’d introduced “ghostwriter” a while back and yesterday or so they announced ghostwriter chat.“
- “There are a bunch of really good ideas used to train this model - multi query attention, infilling, near deduplication and dataset cleaning.”
- “Is anyone else here building AI programming services based on models like this? I see a lot of comments saying the models can’t do much programming. But I just suspect there must be a silent contingent that is also working on services like that. And maybe less likely to promote the abilities of these models because it encourages competition.”
ChatGPT-like#
- askGPT extension for VSCode
- KnowledgeGPT - A question-answering tool for your documents that includes citations in its responses! 🔥
Experimental#
- Copilot Labs: https://cs.github.com , GitHub Next (We are a team of researchers and engineers at GitHub who investigate the future of software development.)
- GitHub Copilot CLI (2023) by GitHub Next team. They investigates the future of software development.
Tweets#
Examples and things I learned from various Tweets:
- You can use copilot to ask what a regex in your codebase does. It’ll even give you test cases.
- Tired of forgetting terminal commands every 10 seconds? GPT-3.5 powered terminal commands - probably the biggest productivity hack you can install today :)
- My code comments were there to help the humans. Now they are there to help the copilot. Before they were for humans, now they aid the AI. It’s a new way of coding, I can’t deny.
- Nice read on reverse engineering of GitHub Copilot 🪄. Copilot has dramatically accelerated my coding, it’s hard to imagine going back to “manual coding”. Still learning to use it but it already writes ~80% of my code, ~80% accuracy. I don’t even really code, I prompt. & edit.
- github copilot feels like the blue-print for building AI-enabled applications. rich feature engineering, context stuffing, client-side request and response filtering, transparent telemetry collection, etc. much more than a wrapper around an OpenAI api.
- Interesting work by Barke et al. on grounded theory analysis of CoPilot… Among the findings, one design choice that never made sense to me: the need to prompt the AI using an in-line comment that then sticks around in the repo. Devs delete these:
- I put together a tutorial on automatically repairing C compiler errors. …
- 🤖 Github Copilot Pro Tip: Describe what your function should do in a comment before you implement the function.
- I used GitHub’s Copilot to write this unit test by typing “func T” followed by pressing the “tab” key 5 times.
- Overheard from 10x engineer: “I would never work for a company that won’t allow me to use GitHub copilot and chatGPT — there is no going back”
- GitHub Copilot has been getting noticeably better, it’s now getting a lot more long-distance and cross file context
- Announcing Ghostwriter Chat from Replit - The first conversational AI built right into your IDE, complete with a proactive Debugger. Generate, debug, refactor, and understand code faster than ever. Available today in Beta.
- This is by far the biggest impact feature since using other tabs for context. Game changer that’s long overdue for GA - Copilot is now (Feb 2023) using Codex’s Fill In the Middle capability to provide context from after the cursor to the model, giving more accurate completions.
Articles and Blog Posts#
- Refactoring code with ChatGPT
- The Ultimate Manual to GitHub Copilot
- 8 things you didn’t know you could do with GitHub Copilot
- Getting the most from GitHub Copilot
- How to Use GitHub Copilot Effectively
- Coding with GitHub Copilot
- What Building “Copilot for X” Really Takes - Note from swyx: I’m delighted to present our first guest post! This comes from the Codeium team. This small team blew away my expectations by creating a complete Copilot clone in one month (not exaggerating - I have disabled GitHub Copilot completely to use them, in part to beta-test Hey Github, but also Codeium seems a bit faster!)
- AI Code Assistants: Head to Head
- Can Amazon’s CodeWhisperer Write Better Python than You?
- Code-generating platform Magic challenges GitHub’s Copilot with $23M in VC backing
HN#
- Copilot and Conversational Programming (jessmart.in)
- GitHub Copilot: First Impressions (vladiliescu.net)
- Kodezi - Autocorrect for Programmers (kodezi.com)
- GitHub Copilot Labs (github.com/github)
- Copilot Internals (thakkarparth007.github.io)
- Diff Models – A New Way to Edit Code (carper.ai)
- Ask HN: What are your favourite free Copilot alternatives?
- Ask HN: Are there any decent GitHub Copilot Alternatives?
- Coping with Copilot (sigarch.org)
- Copilot just got company: Amazon announced Codewhisperer (amazon.com)
- Build your own GitHub Copilot with Salesforce CodeGen AI [video] (youtube.com)
- “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“
- The VSCode GitLab extension now supports getting code completions from FauxPilot (twitter.com/moyix)
“This is super awesome, too bad a A6000 cost $4500 or I would try this out myself.”
“The smaller models run on smaller GPUs too! :) You can see how much VRAM is required for various models in the Documentation: https://github.com/moyix/fauxpilot/blob/main/documentation/server.md#setup”
“A planned feature is to implement INT8 and INT4 support for the CodeGen models, which would let the models run with much less VRAM (~2x smaller for INT8 and ~4x for INT4) :)”
“I know there seem to be a few different models to choose from, does anyone have a resource that collects them and shows the strengths and weaknesses of the various options? Also, how do they compare to copilot?”
“Unfortunately, Copilot is a lot more capable. Most important is that it works with many more languages out of the box, is continuously updated, has more mathematical plus scientific knowledge and is better at understanding your comments. …”
- I figured out how to get GitHub Copilot to run in the terminal (github.com/maxwell-bland)
- Is GitHub Copilot a blessing, or a curse? (fast.ai)
- Part of my code makes Copilot crash (github.com/orgs)
- Copilot sells code other people wrote (twitter.com/reinh)
- GitHub Copilot is generally available (github.blog)
Papers#
- MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generation, 2022
- The Programmer’s Assistant: Conversational Interaction with a Large Language Model for Software Development by IBM, 2023.
- How should AI systems behave, and who should decide? by MIT and Microsoft Research, 2022.
- Learning Performance-Improving Code Edits by CMU et al., 2023 - Project (code and dataset) are available at https://pie4perf.com/ TL;DR: Allows CODEGEN to match the performance of 10x bigger CODEX on the task of suggesing functionally correct, performance improving code edits. [Tweet]
- LEVER: Learning to Verify Language-to-Code Generation with Execution [Tweet]
- Parsel: A (De-)compositional Framework for Algorithmic Reasoning with Language Models (PDF) [Tweet]
- Meet in the Middle: A New Pre-training Paradigm [Tweet]
Opinions#
FauxPilot
FauxPilot: It’s like GitHub Copilot but doesn’t phone home to Microsoft
Not a perfect world
FauxPilot doesn’t use Codex. It relies on Salesforce’s CodeGen model. However, that’s unlikely to appease FOSS advocates because CodeGen was also trained using public open-source code without regard to the nuances of different licenses.
the primary goal of FauxPilot is to provide a way to run the AI assistance software on-premises.
GitHub, in its description of what data Copilot collects, describes an option to disable the collection of Code Snippets Data, which includes “source code that you are editing, related files and other files open in the same IDE or editor, URLs of repositories and files paths.”
Dolan-Gavitt said he sees FauxPilot as a research platform.
“My personal feeling on this is I’ve had Copilot turned on basically since it came out last summer,” he explained. “I do find it really useful. That said, I do kind of have to double check its work. But often, it’s often easier for me at least to start with something that it gives me and then edit it into correctness than to try to create it from scratch.”
Updated to add
Dolan-Gavitt has warned us that if you use FauxPilot with the official Visual Studio Code Copilot extension, the latter will still send telemetry, though not code completion requests, to GitHub and Microsoft.
Amazon Codewhisperer
AWS developer tools like CodeCommit are just horrible. Seems like they crank out something with just the minimal amount of features to say they are competitive.
The reason they announced this is specifically to capitalise on GitHub CoPilot becoming paid.
Seems much more limited than copilot regarding supported languages.
This at least seems directly in response to code copyright/licensing concerns raised with CoPilot.
- At least this will tell you the code it generates is close to something in its training set and tell you the license that code is under. So it’s got that going for it.
Classic AWS…ripping off GitHub CoPilot.
Hacks#
- charliermarsh/autobot - An automated code refactoring tool powered by GPT-3. Like GitHub Copilot, for your existing codebase.
- copilot-hijacks - A collection of prompt-scripts that can make Copilot suggest fonts, translate languages, debug errors, and more.
- prompt_builder_for_copilot - An assistant to walk you through crafting your perfect, explicit prompt for GitHub Copilot.
- Code-Pile by Carper.AI - This repository contains all the code for collecting large scale amounts of code from GitHub.
Awesome Copilot#
- Awesome GitHub Copilot
- Awesome-Code-AI - A list of AI coding tools (assistants, completions, refactoring, etc.)
Copilot vs ChatGPT#
Is ChatGPT3 an alternative to Github Copilot?
Been surprised to see that ChatGPT3 is not only able to generate code, but also explain it.
How does ChatGPT compare to GitHub Copilot for programming?
ChatGPT (which I also didn’t use extensively yet) for me adds a very different quality. You can ask it to debug, explain why a certain error occurs, and keep asking it until the code actually works. And it not only debugs or writes code, it actually explains it. It explains why errors occur, what might be an issue, gives you alternatives.
I would love to have this functionality from within programming environment; I really hope that Copilot gets updated with some of this functionality. At the very least, I hope that ChatGPT will receive a subscription-based API, so that I can access it programmatically at some sensible price.
How does ChatGPT compare to GitHub Copilot for coding?
ChatGPT is good to get broad architectural outlines while Copilot is excellent for short snippets. Both do reasonably well but copilot is better integrated into vscode and it’s a nicer UX.
Copilot uses the codex model while ChatGPT uses the bigger, more generic gpt3 davinci model
-
I have been using copilot every day professionally for a couple of months now, and ChatGPT this week.
For asking general questions, ChatGPT is generally easier to work with. E.g. ‘This code I wrote isn’t working, I’d like it to do X, but it fails at Y, can you tell me why it is failing?’
For one-off utilities and functions in languages I don’t regularly use, they’re both excellent. For ChatGPT, I would write it a prompt asking what I want it to do, and for Copilot I would open a new file and describe the desired behavior in comments.
Once it your Copilot ‘gets the hang of’ your codebase, it is invaluable. It learns your style conventions and will adapt to your suggestions. It really speeds up the amount of characters you can get on to the page, and makes refactoring easier as well.
When I want some inspiration for a way to approach a given problem, I find copilot’s suggestions are all a bit samey, with minor variations. It is easier to use ChatGPT for inspiration / exploratory work because you can tell it what parts you don’t like and how you’d like to change it, and even get it to give you its opinion on whether that’s a good idea.
I any event I think both are very useful tools to have in your toolbox and I recommend them to my teammates.
I am using github copilot for almost an year and recently came across chatgpt here are couple of key points on how to use one of them in a given scenario.
GithubCopilot works very well if you are using it from the start of the project it can quickly fill up functions, assign variable names , pick up algorithms for sorting and selecting and have a general idea of how you code, this is a key point because most of its suggestions are based on your style of programming, using copilot at the middle of the project it seems to provide solutions that needs to re write the existing solution that i have.
Chatgpt is more like a AI assistant where you can provide it a piece of code and ask it to optimize it it surprisingly comes up with a great and easy solution which is code when you want to refactor your code. Chatgpt is also nice in asking for suggestion like for example when to use Action and Func and use cases of anonymous functions a/c to your project for safety and security purposes.
Summary: Both works in different way and provides optimal solution if you ask we how to define them i would say. GithubCopilot works with you and makes you work faster and effective where Chatgpt provides you improvements and alternative methods to do your work efficiently.
i was using Tabnine for a long time and switched recently to GitHub Copilot. I feel tabnine is less annoying and more predictable than Copilot. Regarding ChatGPT vs Github Copilot vs TabNine I’ve tried to combine my experience in an article, but i think i will go back to tabnine.
Both ChatGPT as well as Copilot use a modified version of the GPT 3 model so technically they’re rather equal. The difference is in the models that these two AIs have been trained on. Copilot uses all the endless resources found on Github and is clearly geared towards writing code while ChatGPT is trained with a model that is aiming to resemble natural language. I guess that’s probably the key difference.
ChatGPT is significantly superior to copilot, when will it get upgraded?
- General consensus from the comments:
- ChatGpt is far superior to Copilot.
- You should not “affirm” your beliefs so strongly without actually informing yourself properly on a subject.
- General consensus from the comments:
References#
I referenced the following stuffs while creating my learning resources: