Comparing GitHub Copilot AI Models
GitHub Copilot now supports several powerful LLMs: GPT-4o, o3-mini, Gemini 2.0 Flash, Claude 3.5 Sonnet, and Claude 3.7 Sonnet. But how do they behave in real-world tasks?
Below, I’ve compared their performance using practical JavaScript + Node.js examples — so you can choose the right Copilot model based on how you code.
GPT-4o
Example Scenario:
Granting editor access to a user for a specific document.
Prompt:
"Write a function in Node.js to assign editor access for a given user and document."
Example Response:
function grantEditorAccess(userId, docId) {
const access = new AccessManager();
access.assignRole({
resourceType: "document",
resourceId: docId,
role: "editor",
userId: userId
});
}
Why GPT-4o is a good fit:
It generates complete, structured code with excellent clarity — ideal for well-defined logic flows and new learners who benefit from completeness.
o3-mini
Example Scenario:
Filtering active users and sorting by signup date.
Prompt:
"Filter active users from a list and sort them by signup_date using Node.js."
Example Response:
const activeUsers = users.filter(user => user.active);
const activeUsersSorted = activeUsers.sort(
(a, b) => new Date(a.signup_date) - new Date(b.signup_date)
);
console.log(activeUsersSorted);
Why o3-mini is a good fit:
It’s fast, minimal, and straight to the point — perfect for utility functions or when you want just the logic without extra noise.
Gemini 2.0 Flash
Example Scenario:
Managing a shopping cart system with add, remove, and total logic.
Recommended by LinkedIn
Prompt:
"Build a class for a shopping cart in Node.js with add, remove, and total calculation methods."
Example Response:
class Cart {
constructor(cartId, userId) {
this.cartId = cartId;
this.userId = userId;
this.items = [];
}
addItem(item) {
this.items.push(item);
}
removeItem(item) {
this.items = this.items.filter(i => i !== item);
}
calculateTotal() {
return this.items.reduce((total, item) => total + (item.quantity * item.product.price), 0);
}
placeOrder() {
return new Order("", null, 0);
}
}
Why Gemini 2.0 Flash is a good fit:
It’s great at rapidly building object-oriented structures. Best used when you want to move from task to task quickly while maintaining clarity.
Claude 3.5 Sonnet
Claude 3.5 Sonnet is a good choice for everyday coding support—including writing documentation, answering language-specific questions, or generating boilerplate code. It offers helpful, direct answers without over-complicating the task. If you're working within cost constraints, Claude 3.5 Sonnet is recommended as it delivers solid performance on many of the same tasks as Claude 3.7 Sonnet, but with significantly lower resource usage.
Example Scenario:
Consider a scenario where you are implementing both unit tests and integration tests for an application. You want to ensure that the tests are comprehensive and cover any edge cases that you may and may not have thought of.
Why Claude 3.5 Sonnet is a good fit:
Claude 3.7 Sonnet
Claude 3.7 Sonnet excels across the software development lifecycle, from initial design to bug fixes, maintenance to optimizations. It is particularly well-suited for multi-file refactoring or architectural planning, where understanding context across components is important.
Example Scenario:
Consider a scenario where you're modernizing a legacy COBOL application by rewriting it in Node.js. The project involves understanding unfamiliar source code, converting logic across languages, iteratively building the replacement, and verifying correctness through a test suite.
Why Claude 3.7 Sonnet is a good fit:
Summary Table:
Have you tried switching LLMs in GitHub Copilot yet? Let me know which one fits your style best!
#GitHubCopilot #LLM #NodeJS #JavaScript #GPT4o #ClaudeSonnet #GeminiFlash #DeveloperTools #CodeWithAI
Good article