Overview Version History Q & A Rating & Review
Ollama Code Agent - VS Code Extension
A free, local AI-powered code generation agent for Visual Studio Code using Ollama .
Features
Inline Code Completion - Get AI-powered code suggestions as you type
Chat Panel with Copilot-Style Modes - Switch between ⚡ Agent (auto-creates files on prompt/response) and 💬 Ask (Q&A mode)
Model Selector Dropdown in Chat - Switch between installed Ollama models directly inside the chat header UI
Autonomous File Creation - Automatically creates, writes, and opens files in your workspace root when Agent mode is active or when you request file creation
Image & Screenshot Support - Paste (Ctrl+V), drag & drop, or attach images into chat for multimodal AI vision models (e.g. llava, llama3.2-vision)
Code from Comments - Generate code implementations from natural language comments (Ctrl+Shift+G)
Fully Local & Free - All processing happens on your machine, no API keys needed
Prerequisites
Install Ollama : Download from ollama.ai
Pull a coding model :
# Recommended models for code generation:
ollama pull deepseek-coder:6.7b # Best balance of speed/quality
ollama pull codellama:7b # Meta's code model
ollama pull starcoder2:7b # BigCode's model
Ensure Ollama is running : The Ollama service must be running (default: http://localhost:11434)
Installation
From Source
cd C:\Arul\Projects\VCode\VSCodeAgentPlugin
npm install
npm run compile
Then press F5 in VS Code to launch the extension in debug mode.
Run the extension-host checks with:
npm test
Package as VSIX
npm run package
Then install the .vsix file via VS Code: Extensions → ⋯ → Install from VSIX.
Usage
Inline Completion
Simply start typing code — the extension will suggest completions after a brief pause. Press Tab to accept.
Chat Panel
Click the Ollama icon in the Activity Bar (left sidebar)
Type your coding question and press Enter
Click "Insert" on any code block to paste it into your editor
Write a comment describing what you want:
# Function to calculate fibonacci numbers recursively with memoization
Place your cursor on or below the comment
Press Ctrl+Shift+G (or run command "Ollama: Generate Code from Comment")
Select Model
Run command "Ollama: Select Model" to pick from your installed Ollama models.
Configuration
Setting
Default
Description
ollamaCodeAgent.endpoint
http://localhost:11434
Ollama API endpoint
ollamaCodeAgent.model
deepseek-coder:6.7b
Model for code generation
ollamaCodeAgent.enableInlineCompletion
true
Enable/disable inline suggestions
ollamaCodeAgent.maxTokens
512
Max tokens per generation
ollamaCodeAgent.temperature
0.2
Creativity (0=deterministic, 1=creative)
ollamaCodeAgent.maxTokensChat
1024
Max tokens per chat response
ollamaCodeAgent.debounceTime
500
Delay before inline completions, in milliseconds
ollamaCodeAgent.contextLines.completion
50
Preceding lines sent with inline completion requests
ollamaCodeAgent.contextLines.comment
10
Preceding lines sent with comment generation requests
ollamaCodeAgent.autoCreateFiles
true
Offer to create files from Agent responses
Agent responses are always confirmed before files are written, and generated paths must remain inside the open workspace.
Recommended Models
Model
Size
Best For
deepseek-coder:6.7b
~4GB
General code completion & generation
codellama:7b
~4GB
Code completion, multi-language
codellama:13b
~7GB
Higher quality, slower
starcoder2:7b
~4GB
Code completion
deepseek-coder:1.3b
~1GB
Fast completions on limited hardware
Troubleshooting
"Cannot connect to Ollama" : Ensure Ollama is running (ollama serve)
Slow completions : Try a smaller model like deepseek-coder:1.3b
No suggestions appearing : Check that inline completion is enabled in settings
License
MIT