Intended Audience π€
- Every software engineer!!
- Unlimited autocomplete and chat without paying anything extra!!
- VRAM or RAM(macos) required: 8GB
NOTE: Click on video link to see comparison between mac and linux as well as hosted deepseek vs qwen-2.5-coder
Intro π
We are going to setup our own custom coding copilot in both Linux and Mac(tested on M1 pro) , which will be free unlimited and will be hosted on local machine thus no leakage of sensitive data. We will use an open-source tool called continue for our setup and ollama to run the model.
Installing continue π₯
Continue come with a VS Code and JetBrains extension, simply search continue in extensions bar and install it.(NOTE: disable github copilot or other coding assistants). Below is a vs-code example to install continue.
Installing ollama π₯
Ollama is also very simple to install, just visit the download section, select your OS and get the installer, and is available for Linux and MacOS
Setting up continue π οΈ
As shown in the image above click on the continue icon(if not visible reload the vscode), click on "configure autocomplete options" from the drop-down , this will open the config file for continue. Replace it with the following code snippet
{
"models": [
// {
// "model": "gpt-4o",
// "title": "GPT-4o",
// "systemMessage": "You are an expert software developer. You give helpful and concise responses.",
// "apiKey": "",
// "provider": "openai"
// },
// {
// "model": "gpt-4o-mini",
// "title": "GPT-4o Mini",
// "systemMessage": "You are an expert software developer. You give helpful and concise responses.",
// "apiKey": "",
// "provider": "openai"
// },
{
"model": "qwen2.5-coder:latest",
"title": "Qwen2.5 coder:7B",
"systemMessage": "You are an expert software developer. You give helpful and concise responses.",
"provider": "ollama"
}
],
"tabAutocompleteModel": {
"model": "qwen2.5-coder:latest",
"title": "Qwen 2.5 Coder 7b",
"provider": "ollama"
},
"customCommands": [
{
"name": "test",
"prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
"description": "Write unit tests for highlighted code"
}
],
"contextProviders": [
{
"name": "code",
"params": {}
},
{
"name": "docs",
"params": {}
},
{
"name": "diff",
"params": {}
},
{
"name": "terminal",
"params": {}
},
{
"name": "problems",
"params": {}
},
{
"name": "folder",
"params": {}
},
{
"name": "codebase",
"params": {}
},
{
"name": "web",
"params": {
"n": 5
}
},
{
"name": "file"
},π€
{
"name": "currentFile"
},
{
"name": "open"
},
{
"name": "search"
},
{
"name": "url"
},
{
"name": "clipboard"
}
],
"slashCommands": [
{
"name": "edit",
"description": "Edit selected code"
},
{
"name": "comment",
"description": "Write comments for the selected code"
},
{
"name": "share",
"description": "Export the current chat session to markdown"
},π€
{
"name": "cmd",
"description": "Generate a shell command"
},
{
"name": "commit",
"description": "Generate a git commit message"
}
]
}
This adds qwen-2.5 coder as chat and autocomplete model, there is also commented code to add openAI's gpt as well. To add different model for chat and autocomplete from different providers follow these docs:
Running Qwen2.5 coder(7B) π€
After installing ollama, go to your terminal and run ollama pull qwen2.5-coder
and wait for it to complete.
Chat and Edit features β¨
Open vs-code and press ctrl+L
for linux or cmd+shift+L
for mac. this will open the continue window, drag it to right and select the qwen model. It may take longer for the first time since model is getting loaded into memory, now you can ask your queries. Let me walk you through some interesting features:
- Use
@docs
in query box to reference the already provided docs, or you can add a new one as well. - Use
@web
to search and reference the web(doesn't work very well, instead setup google search) - Other context providers: docs
- Use
ctrl+I
to open the selected code in edit mode.
Autocomplete π
Go to the continue icon at the bottom right and enable the autocomplete option, now simply go to a code or write any comment autocomplete should start to show, press tab
to accept whole or ctrl + ->
to accept line by line.
For my system with M1 chip(pro) qwen-2.5:7b worked slow, and wasn't very usable for autocomplete, but was for chat. In linux with Rtx4060 both features were fast and usable. Go through the video for comparison.
And done π₯³π₯³!! You know have your unlimited free coding copilot running on your local system!! π₯π₯
Top comments (0)