Confirmed working for Claude Code. Ollama connected directly to claude (the
env-var method in Part 5) has been run for real on
multiple machines, both Mac and Windows. The OpenCode half is still unverified — see
Verify This Before You Teach It.
This is a home option only. It will not work on CompuCon’s lab laptops — they don’t have the hardware for it. See Hardware You Need.
This is the deepest of the three “keep coding at home” options:
It’s also the most advanced option. It needs real hardware, a bigger download, and more patience than either of the other two. Read What You Get and What You Give Up before you spend an evening on this.
It’s a bigger departure from the rest of the track than the OpenCode Zen page. That page breaks one rule (a second command). This one breaks several: it needs an install with real disk space, it needs hardware most lab machines don’t have, and the whole point is running software the track never touches in class. That’s fine for a take-home page for a camper with a gaming PC or a family computer with a good graphics card. It has no place in the Session 1 spine, and it isn’t for every camper — most should use OpenCode Zen instead.
claude talking straight to
Ollama’s built-in endpoint, no proxy — has been run for real on both a Mac and a
Windows machine. Treat that part as confirmed.opencode.json config below still matches OpenCode’s current docs.ollama.com/library or LM Studio’s model browser for anything newer before you point
a camper at a specific download.The two things that matter: how much RAM your computer has, and whether it has a dedicated graphics card (GPU) with its own memory (VRAM). A model with no GPU still runs — it just runs on the CPU and RAM, and it runs much slower.
| Model size | Minimum to run it at all | Comfortable | What that gets you |
|---|---|---|---|
| 7–8B (billion parameters) | 8 GB RAM, no GPU needed | 8 GB VRAM GPU | Fast enough for real use, weakest coding quality of the three |
| 14B | 16 GB RAM | 12 GB VRAM GPU | The sweet spot for most home computers in 2026 |
| 30–32B | 32 GB RAM | 24 GB VRAM GPU | Noticeably stronger, needs a serious gaming or workstation card |
A local model server is the program that actually loads the model into memory and answers requests — OpenCode and Claude Code both talk to it instead of talking to Anthropic or OpenAI over the internet. Two good options:
| Ollama | LM Studio | |
|---|---|---|
| Interface | Command line | Graphical app with a chat window and a model browser |
| Best for | Someone comfortable in a terminal, or scripting it | Someone who wants to click around, browse, and compare models visually |
| Runs headless (no window) | Yes | Not really — it’s built as a desktop app |
| Install | One installer, small download | One installer, small download |
Either one works with OpenCode and Claude Code. This page uses Ollama, because its command-line habits match the rest of the track. If a camper would rather click through a graphical model browser, LM Studio does the same job — see lmstudio.ai.
Install Ollama from https://ollama.com/download/windows, or with winget:
winget install --id Ollama.Ollama
Ollama installs as a background service — once it’s installed, it’s just running,
listening on your own computer. No opencode-style command to start it every time.
Download a model — this is the multi-gigabyte part, and only needs to happen once per model:
ollama pull qwen2.5-coder:7b
Swap 7b for 14b or 32b depending on the hardware table above. Bigger number,
bigger download, slower to load, better answers.
Try it right from the terminal, no OpenCode or Claude Code involved yet:
ollama run qwen2.5-coder:7b
Type a question, see it answer. Type /bye to exit.
Not every model is good at writing code — plenty are built for chat and creative writing instead. As of August 2026, the strongest local coding models are all in the Qwen Coder family, with a couple of other names worth knowing:
| Model | Ollama name | Size | Good for |
|---|---|---|---|
| Qwen2.5-Coder | qwen2.5-coder:7b |
7B | The safe default — runs on almost anything, strong for its size |
| Qwen3-Coder | qwen3-coder:30b |
30B (only ~3B active at once) | The best quality-per-GB pick if you have 24 GB+ of RAM or VRAM |
| DeepSeek-Coder V3 | deepseek-coder-v3 |
Large | The strongest open coding model overall, but needs serious hardware |
| Devstral | devstral:24b |
24B | Built specifically for multi-step, agent-style coding tasks like Claude Code and OpenCode use |
Rule of thumb: start with qwen2.5-coder:7b. If it feels slow to reply but the
answers are good, the model is right and the hardware is the bottleneck. If the answers
themselves are weak, and the hardware table says you can afford it, step up to a bigger
model.
OpenCode needs to know your local server exists. Create (or edit)
opencode.json in $HOME\.config\opencode\:
{
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"options": { "baseURL": "http://localhost:11434/v1" },
"models": {
"qwen2.5-coder:7b": {}
}
}
}
}
Then, inside OpenCode:
/models
Your local model shows up alongside the OpenCode Zen models from the OpenCode Zen how-to. Pick it, and prompts run against your own computer instead of the internet — no request leaves the machine.
Confirmed working, on a Mac and on Windows. Claude Code normally only understands
Anthropic’s own API. Recent versions of Ollama (0.14 and up) added a compatible
endpoint, which lets claude talk to it directly with no translator program in
between:
$env:ANTHROPIC_BASE_URL = "http://localhost:11434"
$env:ANTHROPIC_AUTH_TOKEN = "ollama"
$env:OLLAMA_CONTEXT_LENGTH = "32768"
claude --model qwen2.5-coder:7b
claude.claude goes back to normal — no local setup left behind, and no risk of
accidentally leaving a lab machine pointed at the wrong thing.claude and Ollama and
converts between the two API formats. That’s a second install and outside the scope
of this page — treat it as the thing to reach for only if the direct route above is
confirmed broken.| What you see | Likely cause |
|---|---|
| Ollama install finishes, nothing seems to be running | It’s a background service, not a window — check with ollama list in a terminal |
| Model download is extremely slow | Normal for the first pull of a large model — it’s several GB over your home internet |
| Replies are very slow | Model is too big for the hardware — see the hardware table, try a smaller size |
| OpenCode doesn’t list the local model | opencode.json has a typo, or Ollama isn’t running — confirm with ollama list first |
claude errors immediately after setting the environment variables |
Ollama version is older than 0.14 — update it, or use the LiteLLM fallback in Part 5 |
| Computer becomes unusably slow while a model answers | Normal on a machine near its hardware limit — close other programs, or step down to a smaller model |
The general troubleshooting reference is
troubleshooting.html — it’s written for claude against
Anthropic’s cloud, but the sections on hung sessions and on reading errors still apply.
This Vibe Coding Curriculum by Brian Bird, created in with AI assistance, is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.