Free and Private GitHub Copilot Clone for VS Code Using Ollama and Continue

Vincent Codes Finance
15 Mar 202407:48

TLDRThis video tutorial demonstrates how to utilize Ollama and the Continue VS Code extension to create a free GitHub Copilot alternative on your computer. It guides viewers through the installation of Ollama via their website or Homebrew on Mac, selecting and installing coding-based models like codellama, deepseek-coder, and wizard-coder. The video also explains the installation and usage of the Continue extension, which can interact with any LLM, to assist in coding tasks such as understanding code functions, refactoring, and debugging. The presenter provides practical examples of how Continue can enhance the coding experience within Visual Studio Code.

Takeaways

  • 🚀 The video demonstrates how to set up a GitHub Copilot replacement using two open-source tools: Ollama and the Continue VS Code extension.
  • 🎯 Ollama is used to serve large language models, and it can be downloaded from their website or installed via Homebrew on Mac.
  • 🔍 To find the appropriate model, one can search for 'code' on the Ollama platform to discover coding-based models like codellama, deepseek-coder, and wizard-coder.
  • 🛠 The Continue VS Code extension acts as a coding assistant and can work with any LLM, not just those provided by Ollama.
  • 📋 After installing Continue from the Visual Studio Code marketplace, it is recommended to place it on the right-hand side for easy access.
  • 🔧 Continue allows users to interact with their code through a chat interface, providing information about functions, refactoring suggestions, and debugging assistance.
  • ✂️ To refactor code, users can select the code block and use the command-shift-L shortcut to initiate the process.
  • 🐞 Debugging can be facilitated by highlighting a function that is not working and using the command-shift-R shortcut to receive error descriptions and modification suggestions.
  • 📝 The contextual menu in Continue offers additional options such as adding to context, fixing, optimizing, or writing a docstring for the code.
  • 🎥 The video creator also suggests watching a related video on using Ollama with Open WebUI as a ChatGPT replacement for running on one's own machine.
  • 📌 The video concludes with an encouragement for viewers to like and subscribe for more content on coding for finance research.

Q & A

  • What are the two open-source tools mentioned in the video for creating a GitHub Copilot replacement?

    -The two open-source tools mentioned are Ollama and the Continue VS Code extension.

  • How can one download Ollama?

    -Ollama can be downloaded by visiting their website at ollama.com and clicking download. For Mac users who use Homebrew, the command `brew install ollama` can be utilized.

  • What is the purpose of Ollama in the GitHub Copilot replacement setup?

    -Ollama serves the large language models on your computer, enabling you to utilize coding-based models for various tasks.

  • How can one find the appropriate model to install with Ollama?

    -You can search for models by going to the Ollama website and searching for 'code' to find all coding-based models.

  • What are some popular coding-based models available for Ollama?

    -Some popular coding-based models include codellama, deepseek-coder, and wizard-coder.

  • How does one install a model with Ollama?

    -To install a model, you need to use the terminal and type `ollama pull` followed by the name of the model you wish to install.

  • What is the Continue VS Code extension and how does it function?

    -Continue is a Visual Studio Code extension that acts as a coding assistant. It can work with any LLM, including those served by Ollama or cloud-based LLMs.

  • How can Continue be used to get information about code?

    -You can highlight a function or code snippet, use command-M to select it, and then ask a question in the chat about the code. Continue will provide the answer.

  • What are the ways to use Continue for code refactoring?

    -You can use Continue for refactoring by highlighting a large function, pressing command-shift-L, and then following the prompts to refactor the code. You can accept, reject, or retry the changes.

  • How can Continue assist with debugging?

    -To use Continue for debugging, highlight the problematic function, press command-shift-R, and it will provide a description of the error and suggestions for fixing it.

  • What additional features are available in Continue's contextual menu?

    -In the contextual menu, you can add to context, fix issues, optimize code, or write a docstring for the code, among other options.

  • How can one switch between different models in Continue?

    -In Continue, you can edit your settings by clicking the gear icon to access the configuration file, where you can define and switch between different models as needed.

Outlines

00:00

🤖 Introducing GitHub Copilot Replacement with Ollama and Continue

This paragraph introduces the viewers to a method of installing a GitHub Copilot replacement on their computers for free. The two primary tools required for this setup are Ollama, which serves large language models, and the Continue VS Code extension, which acts as the AI coding assistant within the Visual Studio Code environment. The video creator, Vincent Codes Finance, encourages viewers to subscribe for more finance-related coding content. The process begins with downloading Ollama from their website or using Homebrew on Mac. Afterward, the user must manually install the models by searching for coding-based models like codellama, deepseek-coder, and wizard-coder using the `ollama pull` command. The video also mentions a previous tutorial on using Ollama with Open WebUI as a ChatGPT replacement. The key point is to demonstrate how to set up a local, cost-effective alternative to GitHub Copilot for coding assistance.

05:03

🛠️ Utilizing Continue as a Coding Assistant and Exploring its Features

This paragraph delves into the functionalities of the Continue extension when used in conjunction with the Ollama tool. It explains how users can get information about their code by starting a chat session and querying the AI about specific functions or sections of the code. The video showcases how to refactor code by selecting a section, using the command-shift-L shortcut, and then accepting, rejecting, or retrying the AI's suggestions. Additionally, it covers the debugging process, where the AI provides error descriptions and modification suggestions to fix code issues. The paragraph also highlights the contextual menu options in Continue, which allow users to add context, optimize code, or generate docstrings. The summary emphasizes the practical applications of Continue in code refactoring, debugging, and documentation, illustrating how it can enhance a developer's workflow.

Mindmap

Keywords

💡Open-source tools

Open-source tools refer to software applications whose source code is made available to the public, allowing users to view, use, modify, and distribute the software freely. In the context of the video, open-source tools like Ollama and the Continue VS Code extension enable users to access and utilize large language models without incurring costs, promoting a collaborative and community-driven approach to software development.

💡GitHub Copilot

GitHub Copilot is an AI-powered code assistant that helps developers write code by providing suggestions and autocompletions based on the context of the code being written. It is designed to enhance productivity and streamline the coding process. The video discusses an alternative to GitHub Copilot, which involves using the open-source tools Ollama and the Continue VS Code extension to achieve similar functionalities without the need for a paid service.

💡VS Code extension

A VS Code extension is a software component that adds new features or enhances existing capabilities within Visual Studio Code, a popular open-source code editor developed by Microsoft. These extensions can range from debugging tools and language support to themes and productivity boosters. In the video, the Continue VS Code extension is highlighted as a key component in setting up a GitHub Copilot-like experience within the Visual Studio Code environment.

💡Large language models

Large language models are AI algorithms that process and generate human-like text based on the input data they have been trained on. These models are capable of understanding and producing complex language structures, making them useful for various applications, such as chatbots, text summarization, and code generation. In the video, large language models are served by Ollama and used to provide coding assistance and insights, similar to the functionality offered by GitHub Copilot.

💡Coding for finance research

Coding for finance research involves the application of programming skills and techniques to analyze financial data, develop models for investment strategies, and automate financial processes. This interdisciplinary field combines finance knowledge with software development to uncover insights and drive decision-making in the financial sector. The video channel, Vincent Codes Finance, focuses on this niche, providing content that bridges the gap between coding and finance.

💡Model installation

Model installation refers to the process of downloading and setting up software models, such as large language models, onto a local machine or system. This process typically involves following specific instructions to ensure that the model functions correctly within the desired environment. In the video, model installation is crucial for using Ollama to serve coding-based models like codellama, deepseek-coder, and wizard-coder.

💡Code refactoring

Code refactoring is the process of restructuring existing computer code without changing its external behavior. The purpose of refactoring is to improve the nonfunctional attributes of the software, such as its readability, efficiency, maintainability, and scalability. In the context of the video, code refactoring is one of the functionalities that the Continue VS Code extension provides, allowing users to enhance their code quality with the help of AI.

💡Debugging

Debugging is the process of finding and fixing errors or bugs in a computer program. It involves analyzing the program's behavior, identifying discrepancies between the expected and actual outcomes, and making the necessary changes to correct these issues. In the video, debugging is one of the key features of the Continue VS Code extension, which assists users in identifying and resolving errors in their code.

💡Code documentation

Code documentation refers to the practice of adding comments, explanations, and other descriptive information to the source code of a software project. The purpose of documentation is to make the code more understandable and maintainable for both the original developers and future contributors. In the video, the Continue VS Code extension is used to automatically generate docstrings for functions, which are a form of code documentation that provides information about the purpose and usage of the function.

💡Chat interface

A chat interface is a user-friendly communication system that allows users to interact with an AI or another user through text-based messages. In the context of the video, the chat interface is used as a medium for users to communicate with the large language models served by Ollama, enabling them to ask questions about their code, receive insights, and get assistance with coding tasks.

Highlights

The video demonstrates how to use two open-source tools, Ollama and the Continue VS Code extension, for a free GitHub Copilot replacement.

Ollama is used to serve large language models, while the Continue VS Code extension acts as the AI coding assistant.

To install Ollama, visit their website at ollama.com or use Homebrew on Mac with the command `brew install ollama`.

Models need to be installed manually, and a video is referenced that shows how to use Ollama with Open WebUI for a ChatGPT replacement.

When searching for models in Ollama, look for those tagged with 'code' to find coding-based models.

Popular coding-based models include codellama, deepseek-coder, and wizard-coder.

To install a model, use the terminal command `ollama pull` followed by the model's name.

Continue is a versatile VS Code extension that can work with any LLM, not just those provided by Ollama.

After installing Continue from the Visual Studio Code extension marketplace, it will appear in the left sidebar.

Continue recommends being placed on the right-hand side of the editor for easy access and visibility.

In the Continue settings, you can define the model to be used, such as codellama, and adjust completion options.

Ollama allows the addition of multiple models, providing the flexibility to switch between them as needed.

Continue can be used to get information about code by highlighting a function and asking a question, such as 'What does this function do?'.

The extension also supports refactoring code through the editor with command-shift-L.

Debugging is aided by highlighting a function and using command-shift-R to receive error descriptions and suggestions for corrections.

Contextual menu options in Continue include adding to context, fixing, optimizing, and writing docstrings for code.

The video provides a comprehensive guide on setting up a free and open-source alternative to GitHub Copilot, enhancing the coding experience.