This repository contains the source code for the Visual Studio Code extension "codehelper". This extension serves as a starting point and proof of concept for how one can recreate a GitHub Copilot-like extension using the open-source model deepseek-coder:1.5b.
The primary goal of this extension is to demonstrate the capabilities of the deepseek-coder:1.5b model in providing intelligent code suggestions and assistance within the Visual Studio Code environment. It aims to replicate some of the functionalities of GitHub Copilot using an open-source approach.
- Install and Set Up: Follow the installation steps to set up the development environment.
- Run and Debug: Use Visual Studio Code to run and debug the extension in a new VS Code window.
- Test Functionality: Test the various features provided by the extension.
- Contribute: Make improvements or add new features to the extension and contribute back to the repository.
Step 1: Install Docker
Step 2: Install Ollama
Step 3: Pull deepseek-coder:1.3b
Step 4: Clone this repo and set up
Step 5: Make sure your Ollama is running and deepseek-coder is operational. Run your VSC in debug mode to test
Step 6: Package and deploy as needed
- Download Docker Desktop for Windows from the official site:
- Run the installer and follow the setup instructions.
- After installation, start Docker Desktop.
- Verify installation by running:
docker --version
-
Update package lists:
sudo apt update
-
Install required packages:
sudo apt install -y ca-certificates curl gnupg
-
Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null sudo chmod a+r /etc/apt/keyrings/docker.asc
-
Set up the repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
Install Docker Engine:
sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io
-
Verify installation:
docker --version
- Download Docker Desktop for Mac:
- Open the downloaded
.dmg
file and follow the installation instructions. - Start Docker Desktop.
- Verify installation by running:
docker --version
- Pull the Ollama Docker image:
docker pull ollama/ollama
- Run the Ollama container:
docker run -d --name ollama -p 11434:11434 ollama/ollama
- Verify Ollama is running:
curl http://localhost:11434
- Pull the deepseek-code:1.5b model:
ollama pull deepseek-code:1.5b
- Run a test command to check if the model is working:
ollama run deepseek-code:1.5b "def hello_world(): print('Hello, world!')"
- Clone this repository:
git clone https://github.com/yourusername/codehelper.git cd codehelper
- Install the necessary dependencies:
npm install
- Open the project in Visual Studio Code:
code .
- Make sure your Ollama is running and deepseek-coder is operational.
- Run Visual Studio Code in debug mode to test the extension:
- Press
F5
to start debugging.
- Press
-
Open the project in Visual Studio Code:
code .
-
Press
F5
to start debugging. This will open a new VS Code window with the extension loaded. -
In the new window, open the command palette (
Ctrl+Shift+P
orCmd+Shift+P
on Mac) and run the commandcodehelper.codehelper-ext
to open the CodeHelper Chat panel. -
In the CodeHelper Chat panel, enter a prompt in the text area and click the "Send" button.
-
The extension will use the deepseek-coder:1.3b model to generate a response, which will be displayed in the panel. Screenshots below on the current experience.
-
Check the output and debug console for any errors or logs to ensure the extension is working as expected.
-
Extend and contribute back your changes and enhancements.