Using Ollama with VS Code for Local AI-Assisted Development
Source: Dev.to
Overview
If you want an AI coding assistant that runs locally without sending your code to the cloud, Ollama makes it easy to run an LLM on your machine and integrates with Visual Studio Code (and other IDEs).
Install Ollama
- Download and install Ollama from the official site.
- Verify the installation in a terminal:
ollama --version
Run a Model
Choose a model that fits your hardware (RAM/CPU/GPU). For coding tasks, a good starting point is qwen3-coder:7b.
ollama run qwen3-coder
The model will be downloaded automatically the first time you run it. You can also test the model via the Ollama GUI.
Install a VS Code Extension
A popular extension that supports Ollama is Continue.
- Open VS Code.
- Go to the Extensions view (
Ctrl+Shift+X). - Search for Continue and click Install.
Configure the Extension to Use Ollama
Open the Continue configuration file, typically located at ~/.continue/config.json, and add your local Ollama model:
{
"models": [
{
"title": "My Qwen3 Coder Model",
"provider": "ollama",
"model": "qwen3-coder:7b"
}
]
}
Save the file and restart VS Code.
Using the Assistant
You can now ask questions or give instructions directly in the IDE, for example:
- “Explain this codebase.”
- “Add the following feature …”
- “Write unit tests for the file
UserService.cs.”
All requests are processed locally through Ollama using the model you configured.
Ollama provides a private, offline AI coding assistant that can serve as an alternative to cloud‑based tools like ChatGPT or Claude—especially useful when you need offline access, run out of credits, or prioritize privacy. It’s free to run and works with many open‑source models.