Photo by DAVIS VARGAS on Unsplash

If you love GitHub Copilot but don’t want to pay for it (or want your code to stay 100% private), the good news is: you can build a free Copilot alternative running entirely on your laptop.

In this guide, I’ll show you how to set up Ollama, DeepSeek Coder, and Continue inside VS Code to create your own “Copilot-like” experience.

Key Components

Ollama: A lightweight runtime that lets you download and run large language models (LLMs) locally. Think of it like “Docker for AI models.”

DeepSeek Coder: An open-source code generation model trained for programming tasks. It’s smaller than GPT-4 but good enough for inline completions and code assistance.

Continue: A free, open-source VS Code extension that brings Copilot-like functionality. It connects to AI models (local or remote) and provides inline completions, refactoring, and code explanations.

Step 1: Install Ollama

Ollama runs the model locally on your machine.

brew install ollama

Start the Ollama server:

ollama serve

By default, it runs on http://localhost:11434.

Step 2: Download a Coding Model

DeepSeek Coder is a great open-source alternative for code completions. Let’s pull the 6.7B version, which runs well on modern Macs:

ollama pull deepseek-coder:6.7b

If you have limited resources → try deepseek-coder:1.3b.

If you have a powerful machine (M2 Pro/Max, 32GB+ RAM) → try deepseek-coder:33b for better results.

Step 3: Install Continue in VS Code

1. Open VS Code.
2. Go to Extensions (Cmd+Shift+X on Mac).
3. Search for Continue and install it.

Continue adds an inline assistant (triggered by Cmd+I) and a sidebar chat panel (Cmd+Shift+I).

Step 4: Connect Continue to Ollama

Open the Continue configuration file (Settings gear icon -> Models -> Add model -> config file (at the bottom)).

Add these model configurations (change according to your needs):

name: Local Agent
version: 1.0.0
schema: v1
models:
- name: Qwen2.5-Coder 1.5B
provider: ollama
model: qwen2.5-coder:1.5b-base
roles:
- autocomplete
- name: Nomic Embed
provider: ollama
model: nomic-embed-text:latest
roles:
- embed
- name: Llama 3.2 3B
provider: ollama
model: llama3.2:3b
- name: deepseek-coder:1.3b
provider: ollama
model: deepseek-coder:1.3b

To make the model available in the chat model selection, you can simply omit the role field.

Now Continue will talk directly to your locally running Ollama service.

Step 5: Use Continue Like Copilot

Open a code file.

Place your cursor where you want completions and start writing your code.

Select a block of code that you want to edit and press Cmd+I to open the text area where you can ask what modifications do you want → the model will generate suggestions inline.

Open the sidebar (Option+Cmd+B) → chat with the model about your code, request explanations, or generate new functions.

Step 6: Switching Between GitHub Copilot and Continue

Sometimes you might want to switch back to GitHub Copilot. To avoid Ollama competing with Copilot, you can stop the ollama server with a ctrl+c on the terminal and deactivate the Continue extension in VS Code, and just activating the Github Copilot extension and vice-versa.

This makes it easy to toggle between GitHub Copilot (cloud) and Continue with Ollama (local).

Pros and Cons vs GitHub Copilot

Pros:

✅ 100% free
✅ Fully private (code never leaves your machine)
✅ Works offline
✅ You can choose the model (DeepSeek, Code Llama, StarCoder, etc.)

Cons:

⚡ Slower than Copilot (depends on your hardware)
📏 Smaller models = less accurate than GPT-4
⚙️ Requires some setup

Conclusion

With just three free tools — Ollama, DeepSeek Coder, and Continue — you can turn VS Code into a free Copilot alternative that respects your privacy and doesn’t require a subscription.

And the best part? You can switch between GitHub Copilot and your local Copilot whenever you want by starting or stopping Ollama.

Give it a try, and see how much control you gain over your development workflow!