How to Use a Local AI Coding Assistant (Copilot Without Microsoft)
GitHub Copilot is one of the most useful developer tools ever created. It autocompletes code, suggests entire functions, explains unfamiliar codebases, and writes boilerplate in seconds. It has genuinely changed how many developers work.
It also sends every line of code you write to Microsoft's servers.
For open-source projects, this is fine. For proprietary code — your company's backend, your client's application, your startup's secret sauce — sending code to a third-party server creates real risk. Your code becomes part of a data pipeline you cannot audit, operated by a company that has disclosed using Copilot data to improve their AI models.
The alternative: run an AI coding assistant locally, on your own hardware, with zero data leaving your machine. The models have gotten good enough in 2026 that for most coding tasks, a local setup produces 80-90% of Copilot's utility.
The Stack: Continue + Ollama
The best local AI coding setup in 2026 is Continue (VS Code extension) connected to Ollama (local model runtime). Continue is open-source, actively maintained, and designed specifically as a Copilot replacement that works with local models.
What Continue Does
- Tab autocomplete — code suggestions as you type, just like Copilot
- Chat sidebar — ask questions about your code, get explanations, request refactors
- Inline editing — select code, describe what you want changed, the AI rewrites it
- Codebase context — the AI can reference other files in your project for better suggestions
- Model switching — use different models for different tasks (fast model for autocomplete, smart model for chat)
How It Connects to Ollama
Continue talks to Ollama's local API (localhost:11434). Your code goes from VS Code to the model running on your CPU/GPU — never to the internet. Disconnect your Wi-Fi and it keeps working.
Setup Guide (15 Minutes)
Step 1: Install Ollama
If you have not already:
```bash
Mac
brew install ollama
or download from ollama.com
Linux
curl -fsSL https://ollama.com/install.sh | sh
Windows
Download from ollama.com
```
Step 2: Download Coding Models
For autocomplete (fast, lightweight):
```bash
ollama pull qwen2.5-coder:7b
```
Qwen 2.5 Coder 7B is optimized specifically for code completion. Fast enough for real-time tab completion on 16GB RAM.
For chat/reasoning (smarter, slower):
```bash
ollama pull codellama:13b
```
Or for the best local coding model available:
```bash
ollama pull deepseek-coder-v2:16b
```
DeepSeek Coder V2 is one of the strongest open-source coding models — competitive with GPT-3.5 for most coding tasks.
If you have 32GB+ RAM:
```bash
ollama pull qwen2.5-coder:32b
```
The 32B parameter version approaches Copilot quality for most languages.
Step 3: Install Continue Extension
- Open VS Code
- Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
- Search "Continue"
- Install "Continue - Codestral, GPT-4, Gemini, Llama, etc."
Step 4: Configure Continue for Local Models
Continue creates a config file at ~/.continue/config.json. Edit it to use your local Ollama models:
```json
{
"models": [
{
"title": "Qwen Coder (Chat)",
"provider": "ollama",
"model": "qwen2.5-coder:7b"
}
],
"tabAutocompleteModel": {
"title": "Qwen Coder (Autocomplete)",
"provider": "ollama",
"model": "qwen2.5-coder:7b"
}
}
```
Step 5: Start Coding
- Tab completion: Start typing code. After a brief pause, Continue shows a gray suggestion. Press Tab to accept.
- Chat: Press Cmd+L (Mac) or Ctrl+L (Windows/Linux) to open the chat panel. Ask questions, paste errors, request code.
- Inline edit: Select code, press Cmd+I (Mac) or Ctrl+I, describe the change.
Model Recommendations by Language
| Language | Best Local Model | Size | Notes |
|----------|-----------------|------|-------|
| Python | qwen2.5-coder:7b | 7B | Excellent for Python, strong stdlib knowledge |
| JavaScript/TypeScript | qwen2.5-coder:7b | 7B | Good React, Node, Next.js suggestions |
| Rust | deepseek-coder-v2:16b | 16B | Rust requires more reasoning — bigger model helps |
| Go | qwen2.5-coder:7b | 7B | Solid Go support |
| Java | codellama:13b | 13B | Good enterprise Java patterns |
| C/C++ | deepseek-coder-v2:16b | 16B | Complex memory management benefits from larger model |
| SQL | qwen2.5-coder:7b | 7B | Handles most SQL dialects well |
| HTML/CSS | qwen2.5-coder:3b | 3B | Simpler tasks, faster model sufficient |
How It Compares to Copilot
| Feature | GitHub Copilot | Continue + Ollama |
|---------|---------------|------------------|
| Tab autocomplete | Excellent | Good-Very Good (model dependent) |
| Chat/explain code | Excellent | Good (model dependent) |
| Inline editing | Good | Good |
| Multi-file context | Good | Good (with indexing) |
| Speed (autocomplete) | ~200ms | ~300-800ms (hardware dependent) |
| Privacy | Code sent to Microsoft | 100% local |
| Cost | $10-19/month | $0/month (after hardware) |
| Works offline | No | Yes |
| Code training | May use your code | Never touches your code |
| Open source | No | Yes (Continue + models) |
The honest assessment: Copilot is better at predicting exactly what you want to type next — Microsoft's models are trained on billions of lines of code and have more context. The gap is most noticeable for autocomplete speed and accuracy.
But for chat, explanations, refactoring, and code generation from descriptions, local models are surprisingly competitive. The privacy trade-off is worth the 10-20% quality reduction for anyone working with proprietary or sensitive code.
When to Use Local vs Cloud
Use local AI for:
- Proprietary company code
- Client projects under NDA
- Code that contains API keys, credentials, or business logic you do not want exposed
- Any code in a private repository
- Code that touches regulated data (healthcare, finance)
Cloud AI (Copilot/Claude) is fine for:
- Open-source projects
- Public code you would share on GitHub anyway
- Learning exercises and tutorials
- General programming questions not specific to proprietary code
The hybrid approach: Many developers use Copilot for open-source work and personal projects, then switch to Continue + Ollama for proprietary work. Continue makes model-switching easy — you can have both cloud and local models configured and switch between them with a dropdown.
Performance Optimization
If autocomplete feels slow:
- Use a smaller model for tab completion (3B or 7B) and a larger model for chat (13B+)
- Ensure Ollama is running with GPU acceleration if available
- On Mac: Apple Silicon's unified memory makes 7B models very responsive
- On Windows/Linux: An NVIDIA GPU with 8GB+ VRAM dramatically improves speed
- Close unnecessary background processes — local AI uses your CPU/RAM
If suggestions are not good enough:
- Try a larger model (upgrade from 7B to 13B or 32B)
- Use Continue's codebase indexing feature to give the model more context
- Write clear function names and comments — local models benefit more from context than cloud models
Key Takeaways
- Continue + Ollama gives you a Copilot-like experience with zero data leaving your machine
- Setup takes 15 minutes and costs $0/month
- qwen2.5-coder:7b is the best general-purpose local coding model for 16GB RAM
- Local AI is 80-90% as good as Copilot for most tasks — the gap is mainly in autocomplete speed
- Use local for proprietary code, cloud for open-source and learning
- The hybrid approach (both configured, switch as needed) gives you the best of both worlds
- Works completely offline — disconnect your internet and keep coding
Get The Private Intelligence — weekly
AI tools, privacy guides, and developer productivity tips for people who take code security seriously. Join 1,000+ readers.
Affiliate Disclosure: This article may contain affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you. We only recommend products we genuinely believe in. This helps support our work and allows us to continue providing free content.