A lightweight AI agent that chats with Ollama and can use tools. ~300 lines of Python.
Tools can execute any shell command and read/write any file. Only run this with models you trust, in environments you control.
- Install:
uv sync - Copy
.env.example→.envand set your model
Run: uv run main.py (interactive mode)
Run: uv run main.py --message "Your question here" (one-shot)
- Streaming responses from Ollama in real-time
- Tool calls: bash commands, file read/write
- Interactive mode with persistent context (
/clearto reset)
| Variable | Default | Description |
|---|---|---|
AGENTO_OLLAMA_MODEL |
required | Which model to use (e.g. kimi-k2.5) |
AGENTO_OLLAMA_BASE_URL |
https://ollama.com |
Ollama server URL |
AGENTO_OLLAMA_API_KEY |
empty | request Ollama API Keys |
httpxfor HTTP streamingpython-dotenvfor config- Native Ollama API (no extra SDKs)