Claude Code, Codex or OpenCode on a local model (Ollama)

All three coding agents can run on your own GPU through Ollama. The catch is 64k of context, which Ollama doesn't give you by default. Which agent…

Aliteq
Priya Nair · Software & Systems Editor

The short answer

All three can run on a local model through Ollama: Claude Code, OpenAI's Codex CLI and OpenCode. Since Ollama v0.15.0, ollama launch claude, ollama launch codex and ollama launch opencode set each…

Set the context to 64k first: OLLAMA_CONTEXT_LENGTH=64000 ollama serve (Ollama docs, 25 Sep 2026).

24GB card: Qwen3-Coder 30B at 64k is right at the limit (24.0 GiB). An 8-bit KV cache brings it to about 21.0 GiB.

16GB card: gpt-oss 20B at 64k is tight (15.6 GiB), and 14.1 GiB with an 8-bit KV cache.

Under 16GB: use Ollama's cloud models, or rent a GPU by the hour.

Aliteq

Read the full story

Claude Code, Codex or OpenCode on a local model (Ollama)

Read the full story on Aliteq