offline-ollama-assistant is a simple tool that uses Ollama models on your computer to help you with coding and other tasks. Everything runs offline on your machine.
- Find all your Ollama models automatically.
- Use different models for different tasks through simple settings files.
- Read, summarize, and edit files safely on your computer.
- Pull text from PDF and DOCX files (if you install extra packages).
- Save all your settings in easy-to-edit config files.
Before you start, make sure you have:
- Python
3.10or newer - Ollama installed and running locally
- At least one Ollama model pulled on your machine
Example - Get a model:
ollama pull llama3.2:1bCheck that Ollama is running:
ollama listFollow these steps to set up the project on your machine.
git clone https://github.com/abhinav25232354/CodingAgent.git
cd CodingAgentWindows PowerShell:
python -m venv .venv
.venv\Scripts\Activate.ps1macOS/Linux:
python3 -m venv .venv
source .venv/bin/activateBasic install:
pip install -e .Install with document support for PDF and DOCX:
pip install -e .[docs]If you don't have a model yet, get one now:
ollama pull llama3.2:1bThen verify:
ollama listOpen settings/settings.json and look at these:
ollama.base_url: usually stays ashttp://127.0.0.1:11434model_selection.active_model: use a model you already havepermissions.read_roots: folders the assistant can readpermissions.write_roots: folders the assistant can edit
Default example:
"model_selection": {
"mode": "fixed",
"active_model": "llama3.2:1b",
"allow_multi_model_fallback": false,
"default_role": "general"
}You can start the assistant in either of these ways:
python main.pyor:
offline-assistantIf you want to use this tool as your personal coding assistant, follow these steps:
Create a folder where you keep your coding projects.
Example:
DevWorkspace/
|-- CodingAgent/
|-- my-project-1/
|-- my-project-2/
In settings/settings.json, update:
read_roots- folders the assistant can readwrite_roots- folders the assistant can edit
If you only want it to work here, use "." for both.
To help with another project, point these settings to that project's folder.
Good choices to start:
- For basic tasks:
llama3.2:1b - For better coding: use a larger model if you have one
Set it in:
settings/settings.json -> model_selection.active_model
You can edit:
settings/system_prompts.jsonto change how the assistant talkssettings/settings.jsonto change what it can do
Use this to:
- Explain code
- Improve code
- Edit files
- Summarize documents
- Get help offline
Turn on your virtual environment, start Ollama, and run the assistant.
Follow this if you're new to the project:
- Install Python
3.10+ - Install Ollama
- Pull at least one model with
ollama pull <model-name> - Create and activate a virtual environment
- Run
pip install -e . - Optionally run
pip install -e .[docs] - Update
settings/settings.json - Run
python main.py
.
|-- pyproject.toml
|-- README.md
|-- main.py
|-- settings/
| |-- settings.json
| `-- system_prompts.json
|-- src/
| `-- offline_assistant/
| |-- __init__.py
| |-- assistant.py
| |-- cli.py
| |-- config.py
| |-- models.py
| |-- ollama_client.py
| |-- prompting.py
| |-- routing.py
| |-- utils.py
| `-- tools/
| |-- __init__.py
| |-- base.py
| |-- documents.py
| |-- files.py
| |-- registry.py
| |-- textops.py
| `-- web.py
`-- examples/
|-- sample_session.txt
`-- tasks.md
Sets:
- How to connect to Ollama
- Which model to use
- Which folders to read and edit
- What tools are on or off
- How the model works
Sets how the assistant acts and what it says.
- Works great with just one model.
- To read PDFs and Word files, run
pip install -e .[docs]. - Everything runs on your computer - no internet needed.