Written by Jakub Rusinowski · Last updated 2026-08-04 · Hardware figures computed by our VRAM engine
The terminal is where open-source coding agents caught up fastest. OpenCode, Qwen Code and Aider are all model-agnostic and all speak the OpenAI-compatible API that Ollama, LM Studio, llama.cpp and vLLM expose — so pointing them at your own GPU is a base-URL and a model name. What differs is harness weight: Aider is the lightest and survives a 16K window; the newer agents do more and want 24 GB and up.
Two years ago the good coding agents were closed products tied to one provider. In 2026 the strongest ones in the terminal are open source and provider-agnostic by design — you configure an endpoint, and the agent does not care whether it is a frontier API or llama-server on the box under your desk. OpenCode in particular grew into the de-facto open answer to the closed terminal agents, MIT-licensed and able to reach a long list of providers including local ones.
For local-first developers this is the important shift. You are no longer choosing between "good agent, someone else's model" and "your model, mediocre tooling." You can run a well-engineered harness on weights you own. The remaining constraint is the one this whole hub keeps returning to: the heavier the harness, the more window it needs before it starts working.
| Agent | Shape | Local endpoint | Window it wants | Best for |
|---|---|---|---|---|
| Aider | Terminal, git-native, diff-based edits | Ollama, any OpenAI-compatible | 8–16K workable | Small models and small cards. The lightest real harness |
| OpenCode | Full terminal agent, TUI, MIT | Any OpenAI-compatible provider, Ollama included | 32K comfortable | Terminal-first work, swapping models per task |
| Qwen Code | Terminal agent tuned to the Qwen coder line | OpenAI-compatible endpoints and local Ollama | 32K comfortable | Running the Qwen3-Coder family the way it was trained to be driven |
| Cline *(not terminal, listed for contrast)* | VS Code agent | Ollama, LM Studio | 32K+ | Editor-native work — see the Cline guide |
The pattern is consistent: the agents that do the most assume the most context. On 16 GB, Aider's compact repo map and search/replace edit formats mean far more of the window is your code and far less is scaffolding. On 24 GB and up, the fuller agents pay off — their planning, todo tracking and multi-file editing genuinely reduce the number of turns.
The mechanics are the same everywhere: an OpenAI-compatible base URL, a model name, and a dummy API key for clients that insist on one.
# 1. Serve a model with a context window that fits an agent's prompt
cat > Modelfile <<'EOF'
FROM qwen3.6:27b
PARAMETER num_ctx 32768
EOF
ollama create qwen3.6:27b-32k -f Modelfile
ollama serve # OpenAI-compatible at http://localhost:11434/v1
# 2. The environment most CLI agents read
export OPENAI_BASE_URL=http://localhost:11434/v1
export OPENAI_API_KEY=local # ignored, but often required to be set
# 3. Aider, explicitly
aider --model ollama_chat/qwen3.6:27b-32k
# llama.cpp instead of Ollama — same interface, finer control
llama-server -m qwen3-coder-8b-q4_k_m.gguf --port 8080 --ctx-size 16384 \
--jinja # use the GGUF's chat template, needed for tool calls
Three things to get right, in order of how often they are wrong:
1. Context window. The default is too small for any agent's system prompt plus a file. This is the single most common cause of "the agent ignores instructions" — see context engineering. 2. Tool-call support. If the agent uses function calling, the served model needs a chat template that supports it (--jinja on llama-server; an agentic tune rather than a base chat model). Otherwise pick an agent that uses diff formats instead (tool calling). 3. VRAM headroom for the cache. Weights plus 32K of KV cache, not weights alone. Check it with the calculator before you discover it mid-task.
Q4_K_M weights from the site’s compute engine — add KV cache for the context you configured. Agent prompts are large; do not size on weights alone.
| Model | VRAM (Q4) | Runs on | Context | License |
|---|---|---|---|---|
| Qwen3-Coder 8B 8 GB — Aider tier — Pairs with the lightest harness and tightly scoped tasks. Long context for its size. ollama pull qwen3-coder:8b | 5.6 GB | 8 GB GPU (RTX 3060/4060) Mac: 16 GB unified | 125K | Apache-2.0 |
| Devstral-2 22B 16 GB — first agentic tier — Agent-tuned; the best value for terminal agents that expect tool calls. ollama pull devstral:22b | 14.1 GB | 16 GB GPU (RTX 4060 Ti 16GB / 5060 Ti) Mac: 24 GB unified | 125K | Apache-2.0 |
| Qwen 3.6 27B 24 GB — daily driver — Where a full terminal agent stops feeling like a compromise. ollama pull qwen3.6:27b | 17.6 GB | 24 GB GPU (RTX 3090/4090) Mac: 24 GB unified | 256K | Apache-2.0 |
| Qwen3-Coder 80B-A3B (MoE) Workstation / 96 GB+ Mac — MoE decode speed makes long agent sessions practical at high quality. ollama pull qwen3-coder:80b-a3b-q4 | 49.1 GB | 2×48 GB GPUs / big unified memory Mac: 96 GB unified | 125K | Apache-2.0 |
Not a rivalry — most people end up with both, and the split follows the task.
Terminal agents own work that is naturally command-shaped: repo-wide refactors, migrations, "make the suite green," anything you want to run in a worktree and review as a diff. They compose with everything else you have — pipe output in, run them over SSH, wrap them in a shell loop. That last property is what makes them the natural host for loop engineering.
Editor agents own work where seeing the file matters: exploratory changes, UI work, anything where you want inline diffs and the language server's opinion beside you.
Autocomplete is a separate job with a separate model — a small FIM-tuned model answering in milliseconds, running alongside whichever agent you use. Full breakdown in the tool matrix.
What you should expect, so you configure around it rather than concluding the tooling is broken:
Want to know whether a heavier terminal agent is worth a hardware upgrade? Rent a 48 GB GPU for an evening, serve the bigger model, and run your own repo through it before spending anything.
Full list on the cloud AI directory.