Lot of tools are persent that help the developer to take the advantages of Auto AI code generation i.e.
1- Codeium – Free
2- Amazon Codewhisper
3- Amazon Q
4- Tabnine- Free
5- Github Copilot- Free for Student and Contributor
Even codeium has introduce the IDE called as windsurf https://codeium.com/windsurf that is build on top of VSCode for the same.
Today we will try to use free tool LLM known as Ollama and VSCode extension called as ChatGPT combination to use the functionality provided by above tools exactly free and also this combination work without internet.
Lets follow the given step religiously
we assume you already have vscode installed if not please free to install the same from below location.
https://code.visualstudio.com/download
once VSCode is installed make sure to installed ChatGPT Plugin as shown below
It is better to create an free account in codegpt on below given site
https://codegpt.co/
After installaion of the plugin you will be able to see this icon on you vscode
Now lets install/download Ollama from the given site
https://ollama.com/
Ollama is available for windows, mac and linux. As i am using window we will download Ollama for windows
Once the exe is download and install make sure Ollama is in running stage in you machine as given below
Additional you can also check using below command
Now if you check https://github.com/ollama/ollama you will find there are so many model available that can be used for AI Auto code generation we will be using Code Llama
Install codellama using below command it will take size of 3.8GB.
ollama run codellama
Try to ask the question and you will get the reply from the codellama
Now lets configure this CodeLlama in our ChatGPT VS code plugin using below steps.
you can also check the model that is installed in your machine using below command
ollama list
In short this blog explain you step for Exploring Free Tools for AI-Powered Code Generation:
A Step-by-Step GuideA Guide to Free AI Tools for Developers: Code Generation Made Easy
In today’s rapidly evolving tech landscape, developers are leveraging AI-powered tools to enhance productivity and streamline workflows. A variety of tools enable developers to take advantage of automated code generation, including:
Codeium – Free
Amazon CodeWhisperer
Amazon Q
Tabnine – Free
GitHub Copilot – Free for students and contributors
Among these tools, Codeium stands out with its dedicated IDE called Windsurf (built on top of VSCode). Explore more about Windsurf here.
In this blog, we’ll explore how you can use Ollama, a free large language model (LLM), in combination with the ChatGPT extension for VSCode, to achieve similar functionalities provided by these tools. What’s remarkable is that this setup works offline, making it a great choice for secure development environments.
Step-by-Step Guide to Setting Up Ollama with ChatGPT
Prerequisites
Before diving in, ensure you have VSCode installed. If not, download and install it from here.
Step 1: Install the ChatGPT Plugin in VSCode
Open VSCode and navigate to the extensions marketplace.
Search for the ChatGPT plugin and install it.
After installation, create a free account at CodeGPT. Once done, you should see the ChatGPT plugin icon in your VSCode interface.
Step 2: Download and Install Ollama
Visit Ollama’s official website to download the tool. Ollama supports Windows, macOS, and Linux.
For this guide, we’ll demonstrate the setup on Windows:
Download the .exe file for Windows.
Install the application by following the on-screen instructions.
Ensure Ollama is running on your machine after installation.
You can confirm this by executing the following command in your terminal:
bash
Copy code
ollama status
Step 3: Explore Available Models in Ollama
Ollama offers several AI models for various use cases. Visit Ollama’s GitHub repository to explore the models. For this guide, we’ll use Code Llama, a powerful model for AI-driven code generation.
Step 4: Install Code Llama Model
To install the Code Llama model, run the following command in your terminal:
bash
Copy code
ollama run codellama
Note: The installation may take some time and requires approximately 3.8 GB of storage space.
Once installed, you can ask questions or provide coding tasks, and Code Llama will generate accurate responses.
Step 5: Integrate Code Llama with the ChatGPT Plugin in VSCode
Now, let’s configure Code Llama in your ChatGPT plugin:
Open the ChatGPT settings in VSCode.
Navigate to the model configuration section.
Link the Code Llama model from Ollama.
You can also verify installed models on your machine using the command:
bash
Copy code
ollama list
This command displays all available models, including Code Llama, ready for use.
Testing the Setup
With everything configured, you can now use the ChatGPT plugin in VSCode with Code Llama to generate, debug, and refine your code. For example:
Ask for help in writing a function.
Request an explanation for a block of code.
Debug errors with AI guidance.
Conclusion
The combination of Ollama and the ChatGPT plugin in VSCode offers developers a free and offline solution for AI-assisted code generation. Whether you’re a student, contributor, or professional developer, this setup provides robust tools to enhance productivity without requiring an internet connection.
Try it out and unlock the full potential of AI in your development workflow!