Keep going
Every workflow on Rundown University, free for 7 days
Members get all guides, courses, live sessions, and $1,000+ in partner perks.
Guides Ollama published apr 17, 2026
This guide teaches you how to download a coding LLM to your laptop with Ollama and wire it into Claude Code or Codex with a single command. You will end up with a local coding agent that can handle simple tasks for free while keeping proprietary code on your machine.
You will build a local Claude Code, Codex, or OpenCode session pointed at a free Ollama model running on your own hardware: the same agent-style interface, zero per-token cost, and nothing leaving your machine.
Download the biggest model version you can reasonably fit. Bigger means more reliable tool calls, which is what tends to break small models inside Claude Code.
Before you pull anything, check what your machine can handle.
Drop that screenshot into Claude, ChatGPT, or any LLM, and ask:
Which Ollama coder models can I realistically run on this machine with Claude Code or Codex?It will read the RAM and chip from your screenshot and give you a short list.
Use this rough guide for what fits where:
Pro tip: Download the biggest version you can reasonably fit. Bigger means more reliable tool calls, which is what actually breaks small models inside Claude Code.
Browse ollama.com/search?q=coder and open the page for a model your LLM recommended.
On the model page, scroll to the Applications section and confirm it lists Claude Code, Codex, OpenCode, or OpenClaw. If it lists none of them, the model does not support the tool calls agentic coding requires, so skip it.
The three models that held up best in testing were:
Pro tip: If you cannot choose between two candidates, pull both. Disk is cheap, and you can swap between them with the --model flag. Keep the one that holds up in your workflow.
From the model’s Ollama page, copy the launch command. It looks like:
ollama launch claude --model gemma4:e4b
Open a terminal in your actual project folder, paste the command, and hit Enter. Confirm the download when prompted, then wait for the weights to pull the first time.
After that, Ollama drops you into Claude Code pointed at the local model instead of Anthropic’s API.
Inside the session, type /model to confirm which model is wired in. Every response from here costs zero tokens.
Pro tip: Run ollama ps in a second terminal to see what is actually running. It shows the active model, RAM in use, and GPU utilization. 100% GPU means you are fully accelerated. Anything lower means part of the model is spilling to CPU, and responses will be slower.
This is the single most important setting in the setup. By default, Ollama allocates only 4K of context per model, which is too small for agentic coding. Claude Code can read one file, fill the buffer, and immediately start forgetting the rest of the conversation.
Fix it once:
Pro tip: Ask your LLM what context size your specs can safely handle. Maxing it out can push the model past your GPU’s limits and crash things. Start at 32K, verify with ollama ps, then raise if there is headroom.
Claude Code is a sophisticated harness with a lot of tools exposed at once. Small local models sometimes get confused by the volume of choices. OpenCode is a lighter-weight coding agent built for this case, and it uses the same ollama launch pattern.
Install it on Mac with one line:
curl -fsSL https://opencode.ai/install | bash
Then launch it the same way:
ollama launch opencode --model gemma4:e4b
Pro tip: Smaller models work better when you ask them to think less. Hit Shift+Tab inside Claude Code or OpenCode to toggle plan mode, where the agent writes its approach before touching files. Lower the reasoning effort in Settings if the agent keeps over-thinking simple tasks.
Keep going
Members get all guides, courses, live sessions, and $1,000+ in partner perks.