OllamaCode: An AI Coding Assistant That Actually Does Things
I built an AI coding tool that doesn't just generate code blocks - it creates files, runs commands, and manages your workflow automatically

OllamaCode: An AI Coding Assistant That Actually Does Things
I love AI coding assistants. I also hate them a little.
The love part: They're amazing at explaining code, suggesting approaches, and generating snippets. The hate part: They generate beautiful code blocks... and then you have to copy, paste, save, and run them manually. Every. Single. Time.
So I built something different.
The Problem
Here's a typical interaction with most AI coding assistants:
You: "Create a Python script that fetches weather data and run it"
AI: "Here's the code you can use:"
[Shows beautiful, well-commented code block]
"You can save this as weather.py and run it with python weather.py"
You: *sigh* [copies code, creates file, saves, runs...]It's not a huge deal for one file. But do it 50 times a day and the friction adds up.
The OllamaCode Solution
Same request, different experience:
You: "Create a Python script that fetches weather data and run it"
OllamaCode: Creating weather_fetcher.py...
Running python weather_fetcher.py...
Current weather: 72°F, sunny
You: Nice.The AI calls tools directly instead of generating code blocks. Create files, run commands, manage git - it just does them.
How It Works
OllamaCode sits on top of Ollama (local LLM inference) and adds a tool-calling layer. When the AI decides it needs to create a file, it calls the file creation tool. When it needs to run a command, it calls the shell tool.
The key insight: Modern LLMs are good at deciding what to do, not just explaining what you should do. OllamaCode lets them actually do it.
Tool categories:
- File operations: Create, edit, read files with built-in safety checks
- Shell commands: Run anything with permission prompts for sensitive operations
- Git integration: Status, diff, commit, push with AI-generated commit messages
- Project understanding: Automatically indexes your codebase for context
Real Examples
Creating and Running Code
$ ollamacode
You: write a file that generates sine wave data and saves as CSV
OllamaCode creates: sine_wave_generator.py
✓ Created Python script with:
• numpy for sine wave generation
• pandas for CSV export
• configurable frequency and amplitude
• 5 seconds of 440Hz sine wave data
You: now run it
OllamaCode: Running python sine_wave_generator.py...
✓ Saved 5000 data points to sine_wave.csvNo copying. No pasting. Just done.
Git Operations with Context
You: help me write a commit message for these changes
OllamaCode: Looking at staged changes...
Found:
- Modified: src/api/auth.py (added rate limiting)
- Modified: tests/test_auth.py (new rate limit tests)
- Added: config/limits.yaml (rate limit configuration)
Suggested commit:
"Add rate limiting to authentication endpoints
- Implement token bucket algorithm for /login and /token
- Add configurable limits via config/limits.yaml
- Include tests for rate limit behavior"
Commit with this message? (y/n)Code Analysis
You: explain @main.py and suggest improvements
OllamaCode: Analyzing main.py...
Summary:
This is a FastAPI application handling user authentication.
Structure:
- Routes at lines 15-45
- Database models at lines 50-80
- Helper functions at lines 85-120
Suggestions:
1. The password hashing at line 92 uses MD5 - switch to bcrypt
2. Error handling at line 35 catches all exceptions - be more specific
3. Consider extracting database queries into a repository pattern
Want me to implement any of these improvements?Why Local (Ollama)?
OllamaCode uses Ollama for inference, which means:
- Your code stays on your machine. No sending proprietary code to cloud APIs.
- No API costs. Run unlimited queries once you've downloaded a model.
- Works offline. Develop on planes, in coffee shops, wherever.
- Model choice. Use whatever model works best for your use case.
I recommend qwen3:latest for tool calling - it's fast and reliable.
Key Features
Permission System
You probably don't want an AI auto-running rm -rf /. OllamaCode has a permission system:
OllamaCode wants to run: npm install lodash
Allow this operation?
[y] Yes, once
[s] Yes, for this session
[n] NoFor file operations, you can review changes before they're written.
Session Persistence
Working on something complex? OllamaCode auto-saves your conversation:
$ ollamacode
[Restored previous session: "Refactoring auth module"]
You: where did we leave off?
OllamaCode: We were updating the password hashing.
I had implemented bcrypt in auth.py and you wanted
to add the tests next. Want me to continue?Project Context
OllamaCode automatically understands your project structure:
You: add error handling to the API routes
OllamaCode: I see you're using FastAPI in a project with:
- 12 route files in /api
- Custom exception classes in /exceptions
- A logging setup in /utils/logger.py
I'll add try/except blocks using your existing exception
classes and log errors to your logger. Starting with
api/users.py...Syntax Highlighting
When code does need to be displayed, it's beautiful:
# Auto-detected language, proper highlighting
def calculate_fibonacci(n: int) -> int:
if n <= 1:
return n
return calculate_fibonacci(n - 1) + calculate_fibonacci(n - 2)Supports 14+ languages with automatic detection.
Getting Started
Requirements
- Python 3.9+
- Ollama with a tool-calling capable model
- Recommended:
qwen3:latest
Installation
# Clone and install
git clone https://github.com/tooyipjee/ollamacode.git
cd ollamacode
pip install -e .
# Make sure Ollama is running
ollama serve
# Pull a compatible model
ollama pull qwen3:latest
# Start coding
ollamacodeRemote Endpoints
Have a GPU server? Point OllamaCode at it:
# Use remote Ollama server
ollamacode --endpoint http://192.168.1.100:11434
# Set as default
ollamacode --set-endpoint http://gpu-server:11434
ollamacode --set-model llama3.1:70bWho Is This For?
OllamaCode shines for:
- Rapid prototyping: Get from idea to running code fast
- Code exploration: Understand unfamiliar codebases
- Learning: See working examples created in context
- Automating tedious tasks: Refactoring, test generation, documentation
- People who value privacy: Everything stays local
It's probably not for:
- Production deployment (it's a development tool)
- Projects requiring specific cloud AI models
- Environments where you can't run Ollama
The Philosophy
I built OllamaCode because I think AI assistants should assist, not just advise.
When I ask a human colleague to "create a test file for this module," they create it. They don't describe how I could create it myself. AI should work the same way.
The tool-calling approach also produces better results. When the AI knows it will actually run the code, it tends to write code that actually works. There's an accountability loop that improves output quality.
Links
- GitHub: tooyipjee/ollamacode
- Issues/Feature Requests: GitHub Issues
OllamaCode is open source (MIT license). Contributions welcome.
Try it out and let me know what you think. I use it daily and I'm always looking for ways to make it better.