Aider Setup
I spent a week trying to get OpenHands to run reliably on my DGX Spark for long-running coding tasks. It kept crashing mid-stream, losing context, and leaving me with half-finished patches. Then I switched to Aider. Here’s what went wrong, how I fixed it, and what you need to watch out for.
Quick Take
- Aider runs locally in your terminal, not in a browser sandbox that can crash
- It keeps your git repo on the host, so you control the state and credentials
- It survived a 4-hour Mistral Small 4 session without dropping a single token
- Version tested: Aider v0.56.0 with Mistral Small 4 (v1.0.0)
Installing Aider with pipx on an ARM64 Workstation
First, the pipx install failed because my system Python was too old. The error was clear:
pip install --user --break-system-packages pipx
~/.local/bin/pipx install aider-chat
Error:
ERROR: Cannot install aider-chat in the current Python environment
because Python 3.8 is too old (requires >= 3.9)
So I upgraded Python using the deadsnakes PPA on Ubuntu 22.04:
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.11 python3.11-dev -y
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
After that, pipx installed Aider cleanly:
python3.11 -m pip install --user pipx
~/.local/bin/pipx install aider-chat==0.56.0
Note: The --break-system-packages flag is only needed if your distro still enforces the old pip policy. If you’re on Fedora 40 or Arch Linux, skip it. On Fedora, you might need to install python3-pipx via dnf instead.
Gotcha: If you have multiple Python versions, ensure
python3.11 -m pipxpoints to the correct binary. Check withwhich python3.11and verify the pipx path matches.
Configuring Aider to Talk to a Local LLM Endpoint
The default OpenAI key doesn’t work for local models. I tried setting openai-api-key: not-needed-local, but Aider still barfed:
model: openai/Mistral-Small-4
openai-api-base: http://localhost:30000/v1
openai-api-key: not-needed-local
Error:
ValueError: Missing required OpenAI API key
The fix was to set the key to an empty string explicitly:
model: openai/Mistral-Small-4
openai-api-base: http://localhost:30000/v1
openai-api-key: ""
Gotcha: If you forget the empty string, Aider will prompt you for a key every time, even in non-interactive mode. This happens because the YAML parser treats
not-needed-localas a non-empty string.
Watch out: The
openai-api-basemust end with/v1. A trailing slash (http://localhost:30000/v1/) or missing/v1will return 404s from your inference server. Test with:
curl -v http://localhost:30000/v1/models
Limitation: Some local LLM servers (like Ollama) may not fully implement the OpenAI API spec. If you see
Invalid requesterrors, check your server logs for unsupported endpoints.
Running Aider Inside a Git Repo on the Host
Aider uses your host git, not a container. That’s great until you forget to clone the repo first:
cd /data/projects/sovereign-backup
aider backup.sh restore.sh
Error:
fatal: not a git repository (or any of the parent directories)
So I initialized the repo:
git init
git add backup.sh restore.sh
git commit -m "Initial commit"
Watch out: If you’re using Gitea or another self-hosted Git server, Aider will try to push changes automatically. Make sure your
~/.git-credentialsis set up:
http://cipherfox:<TOKEN>@localhost:3002
Test it:
git ls-remote http://localhost:3002/cipherfox/sovereign-backup.git HEAD
Gotcha: The port 3002 is arbitrary. Swap it for whatever your Gitea instance uses. If the test fails, Aider will hang waiting for a remote that doesn’t exist. Check your Gitea admin panel at
http://localhost:3000/adminto verify the correct port.
Limitation: Aider’s automatic git operations assume a single remote named
origin. If you have multiple remotes or non-standard names, you’ll need to manually configuregit remote add origin <url>before running Aider.
Why Aider Beats OpenHands for Long Sessions
OpenHands runs in a browser tab that can freeze or crash. Aider runs in your terminal, survives SSH disconnects, and keeps your context intact.
I ran a 4-hour Mistral Small 4 session editing 27 files. Aider never dropped a line, never asked for a key, and committed changes every 10 minutes thanks to:
auto-commits: true
git: true
pretty: true
stream: true
Watch out: The
auto-commitsfeature creates a new commit for every change set. If you’re working on a feature branch with many small changes, this can clutter your history. Consider usinggit rebase -iperiodically to clean up.
Limitation: Aider’s terminal UI doesn’t render diffs as nicely as a web UI. If you need side-by-side diffs, pipe the output to
less -R:
aider --show-diffs | less -R
Gotcha: If your terminal width is less than 80 columns, Aider’s UI may wrap poorly. Set
export COLUMNS=120in your shell config to ensure proper display.
Experience: The terminal UI is efficient but lacks features like file tree navigation. For complex projects, combine Aider with
tmuxsplits to view files invimornvimalongside the chat.
What I Actually Use
- Mistral Small 4 v1.0.0: Runs locally on the DGX Spark, no cloud egress fees
- Aider v0.56.0: Terminal-first workflow that survives SSH disconnects
- Gitea 1.21.4: Self-hosted Git server keeps all repos under my control
- Configuration file:
~/.aider.conf.ymlwith persistent settings
Aider Setup
Local LLM workflow architecture