GitHub Copilot with Claude 3.5 Sonnet AND multimodel Google’s Gemini 1.5 Pro, OpenAI’s o1-preview and o1-mini
GitHub Copilot, an AI-driven code completion tool, has recently expanded its capabilities by integrating multiple language models, including Anthropic's Claude 3.5 Sonnet. This development offers developers enhanced flexibility and performance in their coding workflows.
Introduction to GitHub Copilot
Launched in 2021, GitHub Copilot utilises AI to assist developers by suggesting code snippets, functions, and even entire modules. Initially powered by OpenAI's models, Copilot has evolved to incorporate a diverse range of AI models, enhancing its adaptability and effectiveness.
Claude 3.5 Sonnet: A Brief Overview
Developed by Anthropic, Claude 3.5 Sonnet is a state-of-the-art AI language model renowned for its advanced reasoning, coding proficiency, and rapid response times. It surpasses previous models in various benchmarks, including reading comprehension, mathematical problem-solving, and code generation. Notably, Claude 3.5 Sonnet is twice as fast and five times more cost-effective than its predecessor, Claude 3 Opus.
Integration of Claude 3.5 Sonnet into GitHub Copilot
In October 2024, GitHub announced the integration of multiple AI models into Copilot, including Claude 3.5 Sonnet. This multi-model support allows developers to select the AI model that best suits their specific tasks, enhancing the tool's versatility. The integration of Claude 3.5 Sonnet is set to roll out to Copilot Chat's web and VS Code interfaces over the coming weeks.
Wanna try? Here is how you can use it:
Enable your ‘Anthropic Claude 3.5 Sonnet in Copilot’ model from the GitHub Copilot Setting. You can check from here.
Install the Extension GitHub Copilot on your VS Code OR directly open your GitHub Codespaces for trying it out.
-
Select the model Claude 3.5 Sonnet from the model drop down menu.
Input the prompt you are looking to ask, AND you can also select the file you want the copilot to work on. Using the chat mode, here are prompts with copilot.
Here you see, I’d been using NodePort Service with port-forward to access the application on the local development. However, on the production, we need the LoadBalancer service instructed by Copilot.
Also, do not forget to use the GitHub Copilot Edits mode. This helps directly to update the file as per the requirement after the prompt
Use Cases
With context about your entire codebase, you can use Claude 3.5 Sonnet on GitHub Copilot to:
Write production-ready code: Ask GitHub Copilot Chat to transform natural language descriptions into high-quality code that matches your project’s patterns and conventions.
Debug with inline chat: Highlight problematic code to get instant analysis and fixes, or ask GitHub Copilot Chat to explain error messages and suggest solutions.
Create tests from implementation: Select any function to automatically generate comprehensive test suites that match your testing framework and cover edge cases.
Understand code with contextual explanations: Hover over functions or highlight blocks of code in VS Code to get explanations of what the code does and how it fits into your project.
Getting into multi-models by GitHub Copilot
Google's Gemini 1.5 Pro is another advanced AI model integrated into GitHub Copilot. While specific details about Gemini 1.5 Pro's capabilities are limited, its inclusion in Copilot signifies a commitment to providing developers with a diverse set of tools to enhance their coding experience.
OpenAI's o1-preview and o1-mini models are designed to offer specialised capabilities, particularly in advanced reasoning tasks. These models provide developers with more focused assistance, especially in complex coding scenarios.
Conclusion
The integration of Anthropic's Claude 3.5 Sonnet into GitHub Copilot marks a significant advancement in AI-assisted coding tools. By offering multi-model support, GitHub Copilot provides developers with enhanced flexibility, performance, and accuracy, catering to a wide range of programming needs. As AI technology continues to evolve, such integrations are poised to play a pivotal role in the future of software development.