Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Why I moved my homelab's coding agent from Claude to OpenCode + OpenRouter — and what it actually costs now

Description and use

Moving the homelab automation from a single vendor to OpenCode + OpenRouter reduced monthly costs to a coffee’s price, eliminated vendor lock‑in, and enabled flexible model selection based on task complexity and cost.

Problem

The homelab automation was tightly coupled to a single vendor’s agent, model, and subscription, creating a single point of failure, inflexible cost structure, and limited ability to run locally for cheap tasks.

Outcome

The new architecture reduces monthly costs to roughly the price of a coffee, eliminates vendor lock‑in, and provides flexibility to route tasks to the most cost‑effective model while maintaining local execution for simple jobs.

Workflow

  • 1. Install OpenCode as the coding agent on local infrastructure.
  • 2. Configure OpenRouter as the model layer API endpoint.
  • 3. Set the desired model (frontier, cheap, or local) in OpenCode’s configuration.
  • 4. Run automation tasks; OpenCode routes requests to the configured model via OpenRouter.
  • 5. Monitor and adjust model selection or add new models by editing a single config line.
  • 6. Maintain a blocklist of models that fail tool‑calling or truncate context.
  • 7. Use local models for low‑complexity tasks to keep costs near zero.
  • 8. Pay per token for expensive frontier model usage, resulting in a monthly bill comparable to a coffee.

Evidence

Most requests are routed to cheap or free models. The boring, high-volume work doesn't touch an expensive model at all.

Source

A lot runs locally for £0. Anything a small local model can handle — and that's more than you'd think for summarise/triage/draft work — runs on my own hardware and costs only electricity.

Source

Not every model can drive an agent. Agentic work needs reliable tool‑calling… I've had to measure this per-model and keep a blocklist of ones that quietly fail.

Source

  • Record date: 2026-09-15T17:15:13.739Z