I’ve been running fully local agentic coding setups for a while, and the pain was never the model — it was everything around it. Model downloads scattered across machines, system-wide services that fight with each other, MCP servers installed per project, and session state that vanishes when you switch machines.
So I consolidated the whole thing into a single self-contained repo: my-local-agent-setup. Everything — configs, launchers, MCP servers, sessions, and even the inference engine — lives inside it. Here’s what the stack looks like and what actually works.
Hardware: 2× RTX 3090 (NVLink, 48 GB VRAM)
The target hardware is two RTX 3090s bridged with NVLink, giving a combined 48 GB of VRAM. That’s the number that matters most: with a 128K context, a 27B–35B model with a q8_0 KV cache needs roughly 22–25 GB, so both models fit comfortably across the pair.
Inference: repo-contained Ollama
Rather than relying on the system ollama.service, the repo ships its own user-level Ollama daemon under ./data/ollama-bin with models stored under ./data/ollama/models. Two big wins:
- No sudo, no systemd conflicts. It’s just a binary in your repo, started via
just start. - Reproducible. The binary version (
v0.40.21) is known, andjust upgrade-ollamabumps it when you want.
I run two models at 128K context with Flash Attention and a q8_0 KV cache:
| Model | Role | Size (disk) | VRAM @ 128K | Speed |
|---|---|---|---|---|
qwen4:35b-a3b |
Default agentic MoE coder (MTP, vision) | ~37 GB | ~25 GB | ~140 tok/s |
qwen3.8:27b |
Lightweight dense coder | ~17.7 GB | ~22 GB | ~126 tok/s |
Both fit across the NVLink-pooled 48 GB — you can swap them mid-session without a restart.
Agent harnesses: Pi and OpenCode
I run two terminal agents against the same local models so neither is a dead end:
- Pi (
@earendil-works/pi-coding-agent) is my default. It’s minimal, has built-in subagents (scout,planner,worker,reviewer) and workflow commands like/implement,/scout-and-plan, and/implement-and-review. I like that MCP exposure is explicit — servers are eitherdirect(always in context) ordeferred(available on demand), which matters a lot for moderate-context local models. - OpenCode is the alternative TUI, wired to the exact same local models, skills, and MCP servers. Bonus:
just webboots a web chat UI bound to0.0.0.0:4096, so I can poke at the agent from my phone on the same LAN — and it can require HTTP basic auth viaOPENCODE_SERVER_USERNAME/OPENCODE_SERVER_PASSWORDin.env.
On top of both sits the ECC operating layer — core profile plus curated TDD, review, and security skills — so both harnesses share the same behavioral rules instead of each accumulating their own.
The MCP stack — and why CodeGraph is the star
This is the part I’d tell anyone starting with local models: your context budget is the scarcest resource. The MCP servers I run:
- CodeGraph (colbymchenry/codegraph) — a local AST & call-graph index. This is the one I keep as
directin Pi. With a 27B model, reading a 3,000-line file to find one function is a terrible trade; an index that answers “who callsvalidateSession?” in one tool call is the difference between working and not. You index a repo once (just index /path/to/repo) and the agent navigates by symbols instead of grepping blindly. - Context7 — up-to-date library/framework docs. Local models are trained on whatever they were trained on; this gets current API docs and examples.
- DeepWiki — live architecture and docs for any GitHub repo, which is how I onboard into unfamiliar code without burning my own context on exploration.
- Fetch — live web docs and release notes as markdown.
- Web Search — zero-key DuckDuckGo search via
duckduckgo-mcp-server. - Browser —
@playwright/mcpdriving system Chrome headless, for JS-heavy pages, clicking, screenshots, and QA-ing local apps.
Everything except CodeGraph is deferred in Pi: the model sees the tool exists and calls it when needed, instead of paying context for every tool description all the time.
The day-to-day workflow
Everything is orchestrated by a justfile, so the muscle memory is short:
just setup # install repo-local tools, ECC core, verify MCP connections
just models # start Ollama + pull both models (~55 GB total)
just index ./myapp # build the CodeGraph AST index for a target repo
just pi ./myapp # launch Pi (auto-starts Ollama; Ctrl+P switches models)
just monitor # ECC Control Pane web UI, live-synced with Pi sessions
A few recipes I use more than I expected:
just verify— end-to-end checks: GPU/NVLink, Ollama, tool-calling, MCP, CodeGraph. Run it once after any hardware or binary change.just sessions/just export-session— Pi sessions are JSONL files indata/pi-sessions/, and I can export one to an interactive HTML report. Great for reviewing what the agent actually did.just gpu—nvtopon the dual 3090s, watching both cards split the load.just gpu-tuning— optional persistence mode + 300W power cap on both cards (needs sudo).
Where I’d go further
Two optional upgrades are wired in as scripts:
- Strata (
just strata, ~120 GB disk) — swap the Ollama daemon for the dual-3090 Strata stack to run 125B MoE models. Stop Ollama first so both GPUs are released. - Zagitta GPU unlock (
just gpu-unlock) — the well-known VRAM unlock mod, cloned and prepared on your system. I keep this as a deliberate, one-command opt-in rather than a surprise.
Try it
The repo is on GitHub with a full README, the justfile, all launcher scripts, and .env.example for swapping models, context length, or adding a CONTEXT7_API_KEY. It’s honest about what it is: a self-contained, opinionated setup that works on 2× 3090s — I’d happily take PRs for other VRAM budgets.

