OpenCode on a CPU-only Intel i7 laptop talking to local Ollama coder models
- Hardware
- Dell Latitude 5430-class machine: Windows 11 Pro / WSL2, 12th-gen Intel Core i7-1265U (10 cores / 12 threads), 32 GB DDR4, Iris Xe iGPU, ~60 GB free NVMe
- Models & engines
- Ollama Windows installer or irm https://ollama.com/install.ps1 | iex
Models: qwen2.5-coder:1.5b for fast inline work; optional qwen2.5-coder:7b (~8–15 tok/s on this i7) - Key gotcha
- OpenCode’s config folder may not exist until you create it; Win+R to the path can say Path Not Found before New-Item -Force.
What they built
After OpenCode’s free cloud tier blocked further use until midnight UTC, the author set up a fully local coding stack on a typical client laptop so prompts never leave the machine and there are no rate limits.
Ollama runs in the system tray and serves an OpenAI-compatible API on localhost:11434; OpenCode is pointed at that endpoint through a hand-written opencode.json provider block.
Because the laptop has only Intel Iris Xe (no discrete CUDA GPU), all inference stays on the CPU, so the guide sticks to quantized coder models under 8B.
Setup
- Dell Latitude 5430-class machine: Windows 11 Pro / WSL2, 12th-gen Intel Core i7-1265U (10 cores / 12 threads), 32 GB DDR4, Iris Xe iGPU, ~60 GB free NVMe
- Ollama Windows installer or irm https://ollama.com/install.ps1 | iex
- OpenCode Desktop with config at %USERPROFILE%\.config\opencode\opencode.json
- Models: qwen2.5-coder:1.5b for fast inline work; optional qwen2.5-coder:7b (~8–15 tok/s on this i7)
How it works
- Install Ollama, confirm http://localhost:11434 is up, then ollama run qwen2.5-coder:1.5b (and optionally ollama pull qwen2.5-coder:7b).
- Force-create the OpenCode config with New-Item … opencode.json -Force and paste a provider block using @ai-sdk/openai-compatible with baseURL http://localhost:11434/v1 and the two model ids.
- Restart OpenCode, open Settings → Providers, and select the local Ollama models.
- Bridge knowledge cutoffs with @file.md context mentions, a custom Ollama Modelfile that bakes project rules into a derived model, or an MCP web-search server when live docs are needed.
Results & numbers
- Local Ollama + OpenCode becomes the daily driver for coding, tests and boilerplate with zero subscription and unlimited local tokens.
- Author estimates roughly 8–15 tokens/sec for the 7B coder on this CPU; 1.5B is preferred for snappy inline completion.
Gotchas
- OpenCode’s config folder may not exist until you create it; Win+R to the path can say Path Not Found before New-Item -Force.
- Iris Xe has no CUDA path — stay under 8B or generation will crawl; 32 GB RAM is what keeps the OS usable while the model sits in memory.
- Static weights miss post-cutoff framework changes unless you inject docs, bake a Modelfile, or attach search MCP.
- Ollama tags ending in :cloud run on Ollama’s servers — skip them if privacy is the goal.
“a standard 32GB RAM developer laptop becomes a fully self-contained software workshop”— Idada Osaigbovo James
Do it yourself
- Install Ollama on Windows and run ollama run qwen2.5-coder:1.5b.
- In PowerShell: New-Item -Path "$env:USERPROFILE\.config\opencode\opencode.json" -ItemType File -Force; notepad that file.
- Paste a provider block with npm @ai-sdk/openai-compatible, baseURL http://localhost:11434/v1, and your local model ids; save and restart OpenCode.
- In OpenCode Settings → Providers pick Ollama Local and send a coding prompt against a private repo.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama Local",
"options": { "baseURL": "http://localhost:11434/v1" },
"models": {
"qwen2.5-coder:1.5b": { "name": "Qwen 2.5 Coder 1.5B (Local)" },
"qwen2.5-coder:7b": { "name": "Qwen 2.5 Coder 7B (Local)" }
}
}
}
}Similar setups
Getting OpenCode to work with a local Ollama model by fixing the 4,096-token context
OpenCode on a local Ollama model ignored files, invented tasks or looped, because each ~23k-token request was silently cut to fit Ollama's default 4,096-token context on a 16 GB GPU.
Local AI: a one-click Windows app that picks a model for your PC and sets up Ollama for friends
Tired of setting up local LLMs for friends, a developer built a free MIT-licensed Windows app that detects your GPU and RAM, installs Ollama without admin rights, pulls a fitting model and opens a private chat.
PatchPal TinyAgent: a coding agent on a 4B model and a 6GB laptop GPU
WiseProbe adapted its PatchPal coding agent to run Gemma 4 E4B or Qwen3.5 4B through Ollama on a 6GB RTX A1000, using handoff-note compaction and capped file reads to work inside a 16K or 32K window.
Hymnix: a Windows desktop gateway that shares your local Ollama models with friends over an optional tunnel
Carris Flynn’s Hymnix wraps Ollama in an OpenAI-compatible Windows gateway with a live request console, idle VRAM unload, and an optional Cloudflare or ngrok tunnel so invited people can use your GPU from elsewhere.