Ollama + Claude Code = 99% CHEAPER
TL;DR
Claude Code is a harness, not a model — "the car, not the engine" — and the engine is swappable through documented environment variables, so the same tool loop can be driven by a local Ollama model or an OpenRouter-hosted open-weight model instead of Anthropic's API. The video demonstrates both paths end to end and then, more usefully, demonstrates their costs: a 9B local model takes four minutes to answer "what do you know about my project," silently drops its tool-call visibility, and lies about its own context window; and a partial env-var override leaves Claude Code's sub-model slots pointed at Anthropic, so tool calls and file searches keep billing paid Haiku while the operator believes they are running free — the presenter's own OpenRouter logs show exactly that. The two durable ideas underneath the tutorial are that a harness encodes an implicit contract the substituted model must satisfy (tool training, context window large enough for the system prompt, JSON protocol conformance) and that "free" only relocates the bill — into hardware, a subscription, a VPS, latency, or lost observability. The presenter's own landing place is not the title: he ends recommending a cheap-but-paid model (a claimed 14¢/40¢ per million tokens against Opus 4.6's $5/$25) for "50 to 100x cheaper" rather than free, and scopes open models to low-stakes, high-volume work — first-pass triage, summarize-before-passing-up, repetitive scaffolding — which is Model-Tier Routing with a new, self-hostable bottom tier.
Concepts introduced
- Harness / Model Separation — the agent harness (system prompt, tool definitions, loop, permissions) is a separable artifact from the model that drives it; "the car and the engine."
- Harness / Model Fit — separability is not free. A harness encodes an implicit contract — tool training, a context window that fits its system prompt, protocol conformance — and a substituted model can violate it while still appearing to run.
- BYO Inference Endpoint —
the config seam that makes the swap real
(
ANTHROPIC_BASE_URL+ANTHROPIC_AUTH_TOKEN), and its sharp edge: a partial override silently leaves sub-model slots on the vendor's paid defaults. - Open-Weight Capability Gap — the closing-but-nonzero distance between open-weight and frontier closed models, and the capability-per-parameter axis that decides what you can actually self-host.
- Total Cost of Inference — "there's really no such thing as free": eliminating the token bill relocates the cost into hardware, a subscription, latency, capability, or observability.
Held, not dropped — themes the capture touches that do not warrant a concept page yet:
- Agent observability as a model-dependent property. On the 9B local model, Claude Code stopped streaming tool calls ("it basically just spins forever"); on larger models the calls reappeared. Whether step-visibility is a harness feature or a model capability is a real question — held pending a second source.
- Context-window labels that lie. Ollama reporting 200k while serving far less, fixed by a Modelfile rebuild. Sharp and useful; currently one vendor's default, not yet a general claim.
- Rate limits as the real free-tier currency. OpenRouter: 50 requests/day at zero balance, 1,000/day once $10 is loaded — money buys throughput, not tokens.
- Loss of routing control as the price of a free
router.
openrouter/freedodges rate limits by choosing the model for you. - Privacy as an independent reason to go local, distinct from cost. Mentioned once, not developed.
- Using the coding agent to configure its own substrate — asking Claude Code which model size fits your hardware, and to write the Modelfile command. A small, recurring self-reference worth watching for.
- The $5 Anthropic credit minimum required to reach the API-key path before you can override it away.
Key claims
- An agent harness and the model that drives it are separable artifacts; the harness supplies the tools, the loop, and the instructions, and the model is swappable underneath it. principle — Harness / Model Separation
- A harness encodes an implicit contract on the model — trained on its tools, a context window that fits its system prompt, conformance to its JSON tool-call protocol — and a model that misses it will "seem to misbehave" rather than fail cleanly. principle — Harness / Model Fit
- Removing the token bill does not remove the cost; it relocates it into hardware, a subscription, a VPS, latency, capability, or observability. principle — Total Cost of Inference
- When redirecting Claude Code to a third-party endpoint, override every model slot — the top model, the Sonnet/Opus/Haiku defaults, the small-fast model, and the subagent model — not just the base URL and token. best practice — context: the vendor's harness falls back to its own paid models for tool calls, file searches, and subagents; the presenter's OpenRouter logs show Claude Haiku 4.5 billed under the app name "Claude Code" while he believed he was running free. The context that makes this "best" is a harness with named sub-model slots — the specific variable names are Claude Code's and will not transfer. BYO Inference Endpoint
- Scope open-weight models to low-stakes, high-volume work — first-pass triage, summarize-before-passing- up, grepping a codebase, repetitive scaffolding — and re-check anything consequential with a stronger model. best practice — context: the current capability gap on hard, unrecoverable tasks; the video states this scoping is because the gap exists, so it loosens as the gap closes. Model-Tier Routing
- Raise a local model's context window before judging it — an
undersized window presents as state loss and lost tool-call visibility,
not as an error. best
practice — context: Ollama defaults that advertise a larger
window than they serve; the same 9B model went from a 4m failure to a 2m
5s success on a
-64krebuild. Harness / Model Fit - Prefer a cheap-but-paid model over a free one when you need predictable routing: the free router picks the model for you, and free tiers are metered by requests per day and per minute. best practice — context: sustained agentic use, where per-request rate limits bind before cost does. Total Cost of Inference
- Capability per parameter, not capability alone, decides what you can self-host — a small model at a given Elo is strictly more useful to a local operator than a large one at the same Elo. principle — Open-Weight Capability Gap
- The video states that on SWE-bench Verified (charted from Vals.ai, SWE-rebench, and official tech reports, early 2026), Qwen3.5-397B (open weight) scores above GPT-5.1 and below Claude Sonnet 4.6/4.5, and Claude Opus 4.6 leads; and that Sonnet 3.7 now falls out of the top five, below Kimi K2 Thinking. observation — the source's charted claim; groundable, not verified here. Open-Weight Capability Gap
- The video states that Google's Gemma 4 models (26B-A4B and 31B, "thinking" variants) reach ~1440–1452 Elo at 20–30B parameters, matching models 10–30× larger, and that this is what prompted the video. observation — the source's charted claim; groundable, not verified here. Open-Weight Capability Gap
- The video states that Gemma 4 31B Instruct is priced at $0.14 per million input tokens and $0.40 per million output on OpenRouter, against Opus 4.6 at $5 and $25, yielding "50 to 100x cheaper" Claude Code. observation — the source's on-screen claim; groundable, not verified here. Total Cost of Inference
- The video states that OpenRouter allows 50 free-model requests per day at zero account balance and 1,000 per day once $10 is loaded, and that a $5 Anthropic credit purchase is required to reach the API-key path at all. observation — the source's claim; groundable, not verified here.
- The video states that pointing Claude Code at a non-Anthropic model is not against Anthropic's terms of service, on the reasoning that "we're using their agent harness, we're just plugging in a different model." observation — asserted on a title card with no citation; a licensing question, groundable, explicitly not adjudicated here. Worth a targeted check before an operator relies on it.
Why this is novel — and what it builds on
Nothing in this vault yet names the harness/model seam. Agent Loop describes the loop, and Agent-Computer Interface (ACI)
describes the tools as the agent's interface to the world, but both
assume a model that was trained for the harness it sits in. This source
pulls the two apart and shows what leaks out of the joint: the tools
survive the swap, the capability behind the tools does not (the
Web Search tool fires, returns "Did 0 searches in 42ms,"
and the model gives up). That is a new node, Harness / Model Fit, and it is the
reason Harness / Model
Separation is interesting rather than trivial.
Secondarily this builds on Model-Tier Routing. That page routes sub-roles across tiers within one vendor's ladder plus a cross-vendor bridge; the "when to actually do this" slide is the same discipline with a self-hostable bottom tier, and the same task shape ("summarize files before passing to a smarter model," "grep a codebase," "repetitive scaffolding") appears independently here. Two sources now converge on "route each sub-role to the cheapest tier that clears the bar." What this source adds — and what tier routing did not previously carry — is that the cheapest tier has a floor: at 9B parameters the model was cheap and useless, and the operator paid in four minutes of wall-clock and total loss of step visibility. Total Cost of Inference is the sharpened form of that.
It also corroborates Execution Commoditization from a third direction. That page argues a cheap model tying an expensive one on ordinary work is a fact about the task; this source, independently, shows an open-weight model displacing a model that was frontier one generation earlier (Sonnet 3.7, now out of the charted top five) and a 31B model matching 400B ones on Elo. Same conclusion, different evidence — convergence from below rather than a tie at the top. Note the presenter does not draw the strategic corollary; he stops at the cost saving, which is precisely the layer Execution Commoditization calls table stakes.
No claim here contradicts an existing concept page.
Illustrated walkthrough
t=00:22 — the load-bearing analogy (spoken, un-illustrated). "Claude Code is the car and the chat model is the engine." Natively the harness wraps Opus/Sonnet/Haiku; the whole video is "open up the hood and switch out the engine." Context limits and token limits, he notes, are properties of what you pay Anthropic for, not of the harness.
t=02:22 — the SWE-bench chart. A bar chart, "closed source" in blue and "open weight" in green, captioned SWE-bench Verified scores (%) — Sources: Vals.ai, SWE-rebench, official tech reports, early 2026. Order shown: Claude Opus 4.6, Claude Sonnet 4.6/4.5, then Qwen3.5-397B (open) above GPT-5.1, then Devstral 2 (open), Gemini 3.1 Pro, GPT-4.1, Kimi K2 Thinking (open), DeepSeek V3.1 (open), Llama 4 Maverick (open). His narration over it: the gap "is just shrinking and shrinking."
t=03:08 — the point of the chart. Sonnet 3.7 is overlaid in orange and lands below Kimi K2 Thinking, out of the top five. "Some of the open-weight models we can access today are better than Claude Sonnet 3.7 — and when that model dropped, everyone was freaking out."
t=04:03 — capability per parameter. A log-x scatter, Model Performance VS Size: Elo against total parameters.
gemma-4-31b-thinkingandgemma-4-26B-A4B-thinkingsit in a highlighted upper-left wedge — Elo ~1440–1452 at 20–30B, level withqwen3.5-397b-a17band nearglm-5andkimi-k2.5-thinkingat 400B–1T. His framing is explicitly about self-hosting: small is better here "because that means we can actually host it on our machine."t=04:50 — the licensing question, answered on a title card. "Are these against TOS?" → "No." "We're using their agent harness. We're just plugging in a different model." (Stated, not sourced.)
t=09:24 — the swap, working. VS Code terminal:
ollama launch claude→ Launching Claude Code with qwen3.5:9b… → the Claude Code banner readingqwen3.5:9b · API Usage Billing. The harness is intact — same directory, same banner, different engine.t=11:24 — the first real cost. Same session, after "what do you know about me and my project?":
✳ Sautéed for 4m 1s, status lineqwen3.5:9b | 2% | 4k / 200k. Four minutes, and no streamed tool calls — "it basically just spins forever until it responds." He diagnoses the state loss as a context overflow, noting the displayed 200k is Ollama's default label and "not actually 200k."t=13:10 — the fix, and the contrast. After rebuilding the model with a larger context window (one Modelfile command, which he has Claude Code write for him), the banner reads
qwen3.5-9b-64kand the transcript now shows an actualWrite(quen 3.5 test)→ Wrote 7 lines,✳ Worked for 2m 5s,20% | 39k / 200k. Same model, more context: tool calls become visible and the task completes.t=14:12 — "there's really no such thing as free." Shown against Ollama's own pricing page — Free $0 / Pro $20 per month / Max $100 per month, with cloud-model concurrency as the gated feature. Having just moved to a cloud-hosted MiniMax model because the 9B local one was too weak, he states the trade plainly: good model locally → you buy the hardware; good model in the cloud → you buy a subscription or a VPS.
t=16:38 — when to actually do this. A slide, Research and information gathering: web searches and summarizing results; pulling docs, READMEs, or API references and condensing them; first-pass triage of GitHub issues or error logs. Spoken alongside it: low-stakes/high-volume work, reading and summarizing files before passing to a smarter model, grepping a codebase, repetitive scaffolding — plus two availability cases (Claude is down; you hit your session limit).
t=19:06 — the actual configuration. The
freerouter.jsonhe pastes intosettings.local.json, visible in full:ANTHROPIC_BASE_URL: "https://openrouter.ai/api",ANTHROPIC_AUTH_TOKEN(his OpenRouter key, on screen),ANTHROPIC_API_KEY: "", and then five model slots all set toopenrouter/free—ANTHROPIC_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL,ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_HAIKU_MODEL,ANTHROPIC_SMALL_FAST_MODEL,CLAUDE_CODE_SUBAGENT_MODEL.t=20:18 — why all five. His OpenRouter activity log, page 4: row after row of Claude Haiku 4.5, app
Claude Code, billed to Credits —$0.000318,$0.00384,$0.0102. Following OpenRouter's own documentation (which sets only the base URL and token) left the sub-model slots on Anthropic defaults, so "whenever it was doing little tool calls or doing little file searches, it was using Haiku" — charging him "without you even knowing." This is the single most operationally useful moment in the video.t=21:28 — the free-models router, and why he won't use it. OpenRouter's
openrouter/freeendpoint routes to whatever is most available (recent traffic: Step 3.5 Flash 40.2%, Qwen3.6 Plus Preview 28.3%, Nemotron 3 Nano, Nemotron 3 Super, Trinity Mini). It dodges rate limits; it also means "you don't have any control over what model is getting called."t=23:28 — the contract breaking in public. Pinned to
qwen/qwen3.6-plus:free, asked to research Gemma 4:Web Search(...)→ Did 0 searches in 42ms, twice. The model narrates its own failure — "the current model seems to not have WebSearch access" — falls back toFetch, gets a 301, a 200, and a401from Hugging Face, and answers from training data anyway. Harness tool, no capability behind it.t=24:36 — where he actually lands. OpenRouter model pages side by side: Gemma 4 31B Instruct, 262K context, against Opus 4.6, 1M context. He reads the prices as 14¢ and 40¢ per million input/output against "five bucks and 25" — and closes on paid but cheap: "you could very well just use this OpenRouter combination with Claude Code to get yourself Claude Code for like 50 to 100x cheaper rather than just being completely free, and I think that's still a huge win." The video's title says 99% cheaper; its conclusion says 50–100× cheaper and not free.