DEV Community

Cover image for I ran aider, OpenCode and Codex CLI on a local model: here is what passed and what broke
Darkboy7766
Darkboy7766

Posted on Originally published at homelabdeck.dev

I ran aider, OpenCode and Codex CLI on a local model: here is what passed and what broke

Disclosure: I run HomelabDeck, a site about self-hosted apps. Everything below ran in my own Proxmox homelab on 2026-11-08. This is a small test, not a benchmark.

Can a coding agent work with a model you host yourself, with no cloud and no subscription? I wanted a real answer, so I tried three agents on the same machine and checked the results with a script instead of by eye.

The setup

  • Model: gpt-oss:20b in Ollama 0.34.2, on an RTX 3090 in its own LXC container. About 122 tokens per second.
  • Agents: aider 0.86.2, OpenCode 1.19.5 and Codex CLI 0.167.0, installed in a second small container and talking to Ollama over the LAN.
  • Workspace: the agents ran inside Tuxee, a tiny web interface with a file manager and terminals that keep running after you close the tab. The Tuxee process itself used about 50 MB of RAM.
  • Rules: each run started from the same seed files in a fresh folder with a 7-minute limit. After the run a script checked the result. The agents never saw the check.

The four tasks

  1. Write a small word-frequency CLI with unittest tests, from scratch.
  2. Fix a wrong median and mode in a file, with tests provided and not editable.
  3. Read a CSV of sales and print totals per region, sorted. Output compared exactly.
  4. Add a --json flag to existing code, plus a test.

Results

Task aider OpenCode Codex CLI
1. From scratch pass, 58 s fail first run (15 s), pass on retry (57 s) fail, 209 s, stray test files
2. Bug fix pass, 46 s pass, 46 s fail (lost connection), twice
3. CSV report pass, 42 s pass, 52 s pass, 12 s
4. Add a feature fail, 54 s pass, 73 s fail (lost connection), twice
Total 3 of 4 4 of 4, one retry 1 of 4

What the failures looked like:

  • aider, task 4: the --json flag worked and printed valid JSON, but the test it wrote for it failed. I count that as a fail.
  • OpenCode, task 1: it looked at the empty folder, printed the code in the chat and never wrote a file. The next run was fine.
  • Codex CLI, tasks 2 and 4: stream disconnected before completion after five reconnect attempts, both times I ran it. On task 1 it burned about 50,000 tokens and left three stray test files with a failing test. This is about Codex CLI with this model through Ollama's Responses API, not about Codex with a cloud model.

The trap that cost me an hour

Ollama's default context is small, and a coding agent sends a large prompt full of tool descriptions. With the default, my first OpenCode run did not finish in 10 minutes. After I created a copy of the model with a 32k context, the same agent finished simple tasks in under a minute.

Through the OpenAI-compatible endpoint you cannot set the context from the client, so make a copy of the model:

printf 'FROM gpt-oss:20b\nPARAMETER num_ctx 32768\n' > Modelfile
ollama create gpt-oss-32k -f Modelfile
Enter fullscreen mode Exit fullscreen mode

Smaller gotchas: Codex refuses a custom provider named ollama because that name is reserved, and aider's numpy dependency would not build on Python 3.13, so I installed it with uv and Python 3.12.

What I would do

  • aider is the lightest and fastest, and works well when you name the files to edit. It does not run your tests by itself.
  • OpenCode explores the project and runs commands on its own, which feels closest to the cloud agents. It was the most reliable here. Expect an occasional run where the model talks instead of acting, and just repeat it.
  • Codex CLI I would skip for this model today.
  • A 20B model handles small, clear tasks. Give it one file, one goal and a test, not a whole repository.

Limits

Four tasks, one or two runs each, small Python tasks only, one model, one machine. Models are not deterministic, so another day could give different numbers.

The full guide has the exact configs for all three agents, the Tuxee setup and the security notes (a web terminal is a real shell, so keep it on your LAN or behind a VPN):

Read the full guide on HomelabDeck

If you have run these agents on other local models, I would like to hear which ones worked for you.

Top comments (1)

Collapse
 
darkboy7766 profile image
Darkboy7766 •

Quick context for anyone who wants to reproduce this: the one thing that changed everything was the context size. Ollama's default is small, and a coding agent sends a big prompt with all its tool descriptions. My first OpenCode run on the default never finished; after making a 32k copy of the model the same tasks took under a minute.

If you have tried these agents on other local models (Qwen coder, Devstral, GLM...), I would like to know which ones held up. I only tested gpt-oss:20b.

Reply rules

  • Reply to every comment days 1-3, short, no links unless asked.
  • Don't argue Ollama vs llama.cpp.
  • If someone suggests another model/agent, say "not tested, thanks" and note it as a follow-up test idea.