This project uses Ollama to run a local AI model on your computer.
Install Ollama from:
https://ollama.com
On Linux, you can install Ollama with:
curl -fsSL https://ollama.com/install.sh | shCheck that Ollama installed:
ollama --versionIf Ollama is not running, start it with:
sudo systemctl start ollamaOptional status check:
sudo systemctl status ollamaThis template uses Qwen3 4B by default:
ollama pull qwen3:4bYou can test the model directly with:
ollama run qwen3:4bThen try a simple prompt:
Say hello in one sentence and confirm the local model is working.
To exit the Ollama chat, type:
/bye
Clone the project from GitHub:
git clone https://github.com/YOUR-USERNAME/local-ai-work-agent-template.gitMove into the project folder:
cd local-ai-work-agent-templateReplace YOUR-USERNAME with your actual GitHub username or organization name.
Create the virtual environment:
python3 -m venv .venvActivate it on Linux or macOS:
source .venv/bin/activateActivate it on Windows PowerShell:
.venv\Scripts\Activate.ps1When the virtual environment is active, you should see something like this at the beginning of your terminal line:
(.venv)
Install the required packages:
pip install -r requirements.txtFor this first version, the project uses:
requests
python-dotenv
requests lets Python send a request to Ollama.
python-dotenv lets Python read local settings from the .env file.
Copy the example environment file:
cp .env.example .envYour .env file should include:
OLLAMA_MODEL=qwen3:4b
OLLAMA_BASE_URL=http://localhost:11434
AGENT_NAME=Local Work Agent
ENABLE_THINKING=false
ENABLE_FILE_ACCESS=true
ENABLE_CALENDAR_ACCESS=false
ENABLE_WEATHER_ACCESS=false
DATA_INBOX_PATH=data/inbox
DATA_PROCESSED_PATH=data/processed
DATA_OUTPUTS_PATH=data/outputs
ALLOW_FULL_COMPUTER_ACCESS=false
SAVE_OUTPUTS=trueThe .env.example file is safe to commit to GitHub.
The real .env file should stay on your computer and should not be pushed to GitHub.
From the project root, with your virtual environment activated, run:
python3 -m app.mainExpected output:
Local Work Agent is starting...
Using local model: qwen3:4b
Thinking enabled: False
Agent response:
Local model connected.
This proves the basic local path is working:
Python project
→ Ollama running locally
→ Qwen model
→ response back to Python
On some Linux systems, use python3 instead of python.
python3 -m venv .venvIf you see an error about venv not being available, install it:
sudo apt-get update
sudo apt-get install python3-venvThen try again:
python3 -m venv .venvIf you see:
ModuleNotFoundError: No module named 'requests'
Make sure your virtual environment is activated:
source .venv/bin/activateThen install dependencies:
pip install -r requirements.txtIf you see:
ERROR: This version requires zstd for extraction.
Install zstd first:
sudo apt-get update
sudo apt-get install zstdThen rerun the Ollama install command:
curl -fsSL https://ollama.com/install.sh | shQwen3 can sometimes generate reasoning text even for simple prompts.
For this first connection test, the template uses several guardrails:
ENABLE_THINKING=false/no_think- a strict system prompt
- low randomness settings
- a response length limit
- cleanup logic for leaked thinking text
The goal of the first test is not deep reasoning.
The goal is to confirm that Python can talk to Ollama and return a clean local response.
Make sure your requirements.txt has:
requests
python-dotenvMake sure your .gitignore includes:
.env
.venv/
data/inbox/*
data/processed/*
data/outputs/*
!data/inbox/.gitkeep
!data/processed/.gitkeep
!data/outputs/.gitkeep