← All guides

Claude Code and Codex, Running on a Local Model for Nothing

I made two videos on this: a live demo and a full crash course. Most people assume Claude Code and Codex only work with a paid plan behind them. They do not. You can wire either one to a model running on your own machine and pay zero per run. Here is the gist of both, enough to s

I made two videos on this: a live demo and a full crash course. Most people assume Claude Code and Codex only work with a paid plan behind them. They do not. You can wire either one to a model running on your own machine and pay zero per run. Here is the gist of both, enough to set it up without watching if you want.

The real run

In the video I use Ollama as the local model provider, connect it to Claude Code and Codex, and give both a coding task. The command is short: ollama launch claude or ollama launch codex, then pick the model. I ran both on Gemma 4 26B. Ollama serves the model on a local endpoint at localhost:11434, which is how the agents talk to it. Claude Code took about 52 seconds for its first reply, and on the same HTML page task it came out a bit better than Codex.

Ollama is the example, but the point is broader. Local providers, Ollama and LM Studio among them, can sit under a coding agent. The agent stays the same. The engine underneath becomes yours.

The one constraint to plan around is hardware. A local model has to fit in memory, so your RAM or VRAM sets what you can realistically run.

If you are starting from scratch

The crash course below is the primer for anyone who has never run a model locally.

It organizes the whole thing into four decisions: hardware, runner, model, and first task.

Hardware sets the ceiling, and the video matches machine memory to model size, from 8GB up to 70B and beyond. The runner is what serves the model, and the three worth knowing are Ollama, LM Studio, and llama.cpp. Choosing a model means picking a size and a quantization level, and understanding whether it is dense or mixture-of-experts. Quantization is the compression that shrinks a model to fit smaller machines. The first task is what you actually do with it, up to agentic coding with Codex.

When to stay local, when not to

Running local is not free of trade-offs, and the crash course says plainly where a cloud model still earns its place: the hardest reasoning, agent runs that go for hours, and frontier coding. One pattern splits the difference. A big cloud model like Claude Opus writes the spec, your local model does the coding, and the cloud model verifies. You pay for planning, not for every keystroke.

Both videos above cover the installs and the demos end to end. If you want the concrete cost difference between local and a paid API for your own usage, the calculator on openclawdc.com will spell it out.

I specialize in setting up local and hybrid AI coding workflows that cut the bill without slowing teams down. Book a call at cloudyeti.io/meet.

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

Read next

OpenClaw Keeps Using Claude Instead of Your Local Ollama Model — Fix
OpenClaw keeps calling Claude/Anthropic even though you set up Ollama? Fix the default chat model, kill env overrides, and verify with openclaw models status.
OpenClaw vs Aider: Which Open-Source AI Coding Agent? (2026)
OpenClaw vs Aider compared. Aider is a git-aware terminal pair programmer; OpenClaw is a broader local automation agent. See which open-source tool fits.
OpenClaw vs Cline: VS Code Agent vs Self-Hosted Agent (2026)
OpenClaw vs Cline compared. Cline is a VS Code coding agent with plan/act modes. OpenClaw is a self-hosted gateway agent across channels. When to use each.
OpenClaw as MCP Server: What It Means and Why It Matters
OpenClaw is becoming an MCP server. Claude Code, Codex, and Cursor will call OpenClaw tools directly. Here is what changes.