A powerful VS Code extension that integrates Ollama AI models directly into your development workflow, providing intelligent code completions, AI-powered chat assistance, and code analysis features.
- Real-time AI-powered code suggestions as you type
- Context-aware completions that understand your codebase
- Support for 25+ programming languages
- Configurable completion settings and triggers
- Dedicated chat sidebar for conversations with AI
- Persistent chat history with configurable limits
- Streaming responses for real-time interaction
- Context-aware conversations about your code
- Explain Code: Get detailed explanations of selected code
- Improve Code: Receive suggestions for code improvements
- Generate Documentation: Auto-generate docstrings and comments
- Ask Questions: Query the AI about code or programming concepts
- Easy model selection from available Ollama models
- Real-time model switching without restart
- Status bar integration showing current model
- Automatic model discovery and configuration
- Right-click context menus for quick AI actions
- Editor selection-aware commands
- Command palette integration
- Keyboard shortcuts support
- Ollama must be installed and running on your system
- At least one Ollama model must be downloaded (e.g.,
ollama pull llama3.2)
- Install the extension from the VS Code Marketplace
- Ensure Ollama is running (
ollama serve) - The extension will automatically detect available models
- Start coding with AI assistance!
- First Setup: The extension will prompt you to select a model on first launch
- Code Completions: Simply start typing - completions will appear automatically
- Open Chat: Click the Ollama Chat panel in the Explorer sidebar
- Analyze Code: Select code and right-click for AI analysis options
Configure the extension through VS Code settings (Ctrl/Cmd + , β search "Ollama"):
{
"ollama.apiUrl": "http://localhost:11434",
"ollama.model": "llama3.2",
"ollama.timeout": 30000
}{
"ollama.completions.enabled": true,
"ollama.completions.maxTokens": 100,
"ollama.completions.triggerChars": [" ", "\t", "\n", ".", "(", "[", "{"]
}{
"ollama.chat.maxHistory": 20
}All commands are available through the Command Palette (Ctrl/Cmd + Shift + P):
Ollama: Open Chat- Open the chat sidebarOllama: Select Model- Choose from available modelsOllama: Toggle Code Completions- Enable/disable completionsOllama: Clear Chat History- Reset chat conversationOllama: Check Connection- Verify Ollama connectivityOllama: Explain Code- Get code explanationsOllama: Improve Code- Receive improvement suggestionsOllama: Generate Documentation- Create docstrings/commentsOllama: Ask Ollama- Query the AI assistant
The extension provides intelligent completions for:
Programming Languages:
- JavaScript/TypeScript
- Python
- Java, C#, C/C++
- Go, Rust, Swift, Kotlin
- PHP, Ruby, Scala, R
- And more...
Markup & Config:
- HTML, CSS, SCSS/Less
- JSON, YAML, XML
- Markdown
- Dockerfile, Makefile
- Shell scripts, PowerShell
- SQL
function calculateTotal(items) {
// Start typing and get AI suggestions
return items.reduce((sum, item) => |
}You: How do I implement a binary search in Python?
Ollama: Here's an efficient binary search implementation:
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1Select any code and right-click to:
- Explain: Understand complex algorithms
- Improve: Get optimization suggestions
- Document: Generate comprehensive docstrings
Extension not working:
- Ensure Ollama is installed and running (
ollama serve) - Check that models are available (
ollama list) - Verify the API URL in settings matches your Ollama instance
No completions appearing:
- Check that completions are enabled in settings
- Verify the selected model supports code generation
- Try toggling completions off and on
Chat not responding:
- Check Ollama connection status
- Verify the selected model is downloaded
- Increase timeout setting if requests are slow
- Use smaller, faster models for code completions (e.g., CodeLlama 7B)
- Adjust
maxTokenssetting to balance speed vs. completion length - Consider using different models for chat vs. completions
- All processing happens locally through your Ollama instance
- No code or data is sent to external servers
- Chat history is stored locally in VS Code
- You have full control over your AI models and data
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation
- π Report Issues
- π¬ Discord Community
- π Star on GitHub
See CHANGELOG.md for a list of changes and updates.
Enjoy coding with AI! π