Overview
Each AI model supported in Copilot Chat has different strengths. To help you decide which model to use, this article provides real-world examples of common developer tasks along with sample prompts, responses, and guidance on why a particular model is a good fit.
These examples show how models vary in their reasoning style, response depth, and ability to handle visual input. Use them to compare output quality and choose the right model for your specific workflow.
For a full list of supported models and side-by-side feature comparisons, see Choosing the right AI model for your task.
GPT-4o
GPT-4o est un bon choix pour les tĂąches de dĂ©veloppement courantes qui bĂ©nĂ©ficient de la vitesse, de la rĂ©activitĂ© et dâun raisonnement polyvalent. Si vous travaillez sur des tĂąches qui nĂ©cessitent des connaissances Ă©tendues, des itĂ©rations rapides ou une comprĂ©hension de base du code, GPT-4o est probablement le modĂšle Ă utiliser.
Example scenario
Consider a scenario where you are writing helper functions for access control in a Python service. You want to add docstrings to clarify the purpose of the function.
Below is the helper function that grants editor access to a document:
def grant_editor_access(user_id, doc_id):
access = AccessManager()
access.assign_role(
resource_type="document",
resource_id=doc_id,
role="editor",
user_id=user_id
)
Example prompt
Add a docstring to the function that explains what it does.
Example response
Remarque
La réponse suivante est un exemple. Les réponses Copilot Chat ne sont pas déterministes, vous pouvez donc obtenir une réponse différente de celle affichée ici.
def grant_editor_access(user_id, doc_id):
"""
Grants editor access to a specific document for a given user.
This function uses the AccessManager to assign the "editor" role
to the specified user for the provided document ID.
Args:
user_id (str): The ID of the user to grant access to.
doc_id (str): The ID of the document to which access is being granted.
"""
access = AccessManager()
access.assign_role(
resource_type="document",
resource_id=doc_id,
role="editor",
user_id=user_id
)
Why GPT-4o is a good fit
- The function is short and self-contained, making it ideal for quick docstring generation.
- GPT-4o can recognize the pattern and provide a clear, concise explanation.
- The task doesn't require deep reasoning or complex logic.
o3-mini
OpenAI o3-mini is a fast, cost-effective reasoning model designed to deliver coding performance while maintaining lower latency and resource usage. o3-mini outperforms o1 on coding benchmarks with response times that are comparable to o1-mini. Copilot is configured to use OpenAI's "medium" reasoning effort.
Example scenario
Consider a scenario where you are working on a software licensing system. You have a list of user records, each stored as a dictionary with fields like name
, active
, and signup_date
. You want to find only the active users, sorted by their signup date, so that the newest users appear last.
Below is list of users you are working with:
users = [
{"name": "Alice", "active": True, "signup_date": "2023-12-10"},
{"name": "Bob", "active": False, "signup_date": "2023-11-05"},
{"name": "Charlie", "active": True, "signup_date": "2024-01-15"}
]
Example prompt
Filter the list of users to only include active users, and sort them by signup_date.
Example response
Remarque
La réponse suivante est un exemple. Les réponses Copilot Chat ne sont pas déterministes, vous pouvez donc obtenir une réponse différente de celle affichée ici.
# Filter to only include active users
active_users = [user for user in users if user["active"]]
# Sort active users by signup_date
active_users_sorted = sorted(active_users, key=lambda user: user["signup_date"])
print(active_users_sorted)
Why o3-mini is a good fit
- The task involves simple filtering and sorting, which doesnât require deep reasoning.
- Its fast responses make it ideal for quick iteration during development.
Flash Gemini 2.0
Flash Gemini 2.0 prend en charge lâentrĂ©e dâimage afin que les dĂ©veloppeurs puissent intĂ©grer le contexte visuel dans des tĂąches telles que lâinspection de lâinterface utilisateur, lâanalyse de diagramme ou le dĂ©bogage de disposition. Cela rend les donnĂ©es Flash Gemini 2.0 particuliĂšrement utiles pour les scĂ©narios oĂč lâentrĂ©e basĂ©e sur lâimage amĂ©liore la rĂ©solution des problĂšmes, comme demander Ă Copilot dâanalyser une capture dâĂ©cran de lâinterface utilisateur pour les problĂšmes dâaccessibilitĂ© ou pour mieux comprendre un bogue visuel dans une disposition.
Example scenario
Youâre designing a shopping cart system and have a UML class diagram that outlines the relationships between Cart
, Product
, User
, and Order
. Instead of writing out the system from scratch, you want to upload the image of the diagram and ask Copilot to generate the classes.
Example prompt
Use this UML diagram to generate the classes for a shopping cart system.
Example response
Remarque
La réponse suivante est un exemple. Les réponses Copilot Chat ne sont pas déterministes, vous pouvez donc obtenir une réponse différente de celle affichée ici.
Copilot will generate a class for each of the classes in the diagram, including the relationships between them. Hereâs the example code generated for the Cart
class:
from cart_item import CartItem
from order import Order
class Cart:
def __init__(self, cart_id, user_id):
self.cart_id = cart_id
self.user_id = user_id
self.items = []
def add_item(self, item):
self.items.append(item)
def remove_item(self, item):
self.items = [i for i in self.items if i != item]
def calculate_total(self):
return sum(item.quantity * item.product.price for item in self.items)
def place_order(self):
# Implementation for placing an order
return Order("", None, 0)
Why Flash Gemini 2.0 is a good fit
- It can interpret visual assets, such as UML diagrams, wireframes, or flowcharts, to generate code scaffolding or suggest architecture.
- It can be useful for reviewing screenshots of UI layouts or form designs and generating.
Claude Sonnet 3.5
Claude Sonnet 3.5 est un choix judicieux pour l'aide au codage au quotidien, notamment la rédaction de documentation, la réponse à des questions spécifiques au langage ou la génération de code standard. Il offre des réponses utiles et directes sans compliquer la tùche. Si vous travaillez avec des contraintes de coûts, Claude Sonnet 3.5 est recommandé car il offre de bonnes performances sur de nombreuses tùches identiques à Claude Sonnet 3.7, mais avec une utilisation des ressources nettement inférieure.
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.
For a complete walkthrough of the scenario, see Writing tests with GitHub Copilot.
Why Claude Sonnet 3.5 is a good fit
- It performs well on everyday coding tasks like test generation, boilerplate scaffolding, and validation logic.
- The task leans into multi-step reasoning, but still stays within the confidence zone of a less advanced model because the logic isnât too deep.
Claude Sonnet 3.7
Claude Sonnet 3.7 excelle tout au long du cycle de dĂ©veloppement du logiciel, de la conception initiale Ă la correction des bogues, de la maintenance Ă l'optimisation. Il est particuliĂšrement adaptĂ© Ă la refactorisation multi-fichiers ou Ă la planification architecturale, oĂč la comprĂ©hension du contexte entre les composants est importante.
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.
For a complete walkthrough of the scenario, see Modernizing legacy code with GitHub Copilot.
Why Claude Sonnet 3.7 is a good fit
- Claude Sonnet 3.7 handles complex context well, making it suited for workflows that span multiple files or languages.
- Its hybrid reasoning architecture allows it to switch between quick answers and deeper, step-by-step problem-solving.