Skip to main content

How I Route Agent Work Across Models and Machines in My Homelab

The tiers describe the intent of the work, so the model catalog behind them can keep changing.

Lovell Felix 9 min read

I have spent enough time around automation to know that “use the best model” stops being useful advice as soon as there is more than one model, more than one machine, and more than one kind of task in the system.

That is the point I reached in my own setup this year. I have an 18GB M3 MacBook that I use as the operator console, a few homelab nodes handling always-on work, and several different ways to serve inference. Some work can stay local. Some work should go to a cloud model with a 1 million token context window. Some work needs a queue because it is going to take longer than an interactive request should reasonably stay open. Once all of that existed at the same time, model selection turned into an operational problem.

Picking one winning model wasn't the interesting part. What mattered was building a system that could make a good-enough choice repeatedly, at a cost I was willing to pay, with latency and failure modes I could live with.

Why I route at all

The simplest reason is cost. On the Copilot side alone, the spread is wide enough that it changes behavior. A cheap support model like gpt-5-mini or claude-haiku-4.5 sits at the 0.33x tier. A stronger general model like gpt-5.4 costs 6x. At the top end, gpt-5.5 is 57x. If every scout pass, repo search, note cleanup, and small shell task lands on a premium tier by default, you feel that decision almost immediately.

The second reason is that quality is uneven by task type. I do not need the same model for a quick file lookup that I want for a multi-file implementation plan, a security review, or a frontend change where image support helps. The system works better when the cheap model handles the cheap work, and the expensive model appears only when the task actually benefits from it.

The third reason is that local inference has different tradeoffs than remote inference. Local models are effectively free once the machine is running, and I like having a path that keeps routine work off an API. At the same time, local capacity is finite in a way cloud capacity usually is not. An 18GB laptop can run useful models, but it cannot pretend to be an infinite pool. Memory pressure, cold starts, prompt processing time, and tool reliability all show up quickly when several workflows compete.

Routing is what keeps those constraints from leaking everywhere else. Without it, every prompt, script, queue, and agent entry starts carrying its own half-remembered idea of what should run where.

The tier system I actually use

The durable part of the system is not a list of favorite models. It is the tiering.

In the shared base configuration, I keep things conservative and broadly available. The important roles that coordinate or review work sit on stronger Copilot models, while most of the supporting roles stay on the cheap tier. In practice that means the orchestrator, reviewer, and language-coder use gpt-5.4, while a long tail of smaller agents stay on gpt-5-mini. The UI path is separate because I have had better luck with Claude there, so claude-haiku-4.5 handles the cheap frontend side.

That base layer is there so the system still works everywhere, even without extra keys or local model servers. The personal overlay is where it gets more opinionated.

For my own use, I push most of the high-value coding and reasoning work onto OpenCode Go models. deepseek-v4-pro carries six of the serious roles, including orchestrator, reviewer, language-coder, security-auditor, sre-debugger, and engineer-agent. That assignment is mostly about benchmark strength and context window. A 1 million token context is materially useful when an agent needs to read a large repository or keep a lot of planning state in one pass.

One level down, I use deepseek-v4-flash for work that still needs to be good, but does not need the full price of the best tier. Tester, jr-coder, documentation, and a couple of execution-oriented roles sit there. That has been a good trade in practice because the Flash model stays close enough on coding quality that I can spend the expensive tier on fewer tasks.

The exceptions are important. kimi-k2.6 gets the ui-coder role because multimodal support matters there. A few low-value, high-frequency roles deliberately stay on cheap Copilot models as fallback insurance. If the OpenCode Go key is unavailable or I simply want to avoid spending it on trivial work, the system still has a stable floor.

Then there is the free local path. I keep a set of agents that can be overridden to a single MLX model on Apple Silicon. The exact model depends on the machine's memory tier. Under 16GB, the practical fallback is tiny. In the 16GB to 35GB range, the best local option I have found is a 9B-class model such as qwen3.5-9b-optiq, which has been landing around 9 seconds for a 150-token warm inference on my 18GB M3 Pro. That is fast enough to be useful, cheap enough to use freely, and small enough to coexist with the rest of the machine.

The thing that matters most is that the tiers describe intent. I am not asking every caller to know the full catalog. I am saying this task is trivial, this one is standard, this one is deep, this one needs image support, this one can take the free local path if it is available. The catalog behind those classes can keep changing.

Moving the work is a separate problem

Model routing turned out to be only half of the picture. Once I had more than one agent host, I also needed a clean answer to a different question: where should the task itself run?

The transport layer in my homelab now has two paths, and the split is mostly about time.

For synchronous delegation, I use A2A over HTTP. The Mac is the orchestrator and sends one-way requests into the fleet. Right now that means posting to port 8010 on the A2A side and getting an answer back inside a bounded window, generally 120 seconds or less. That is the path I use when I want an agent to inspect something, call tools, and hand me an answer while I am still at the keyboard.

For asynchronous work, I use the lean-ctx hub queue. That is a different transport and a different contract. The Mac pushes a task into the hub, the worker on jarvis-claude polls for it, usually within 10 minutes, runs it with the logged-in Claude session on that host, and writes the result back to the hub. I do not keep an HTTP request open because there is no reason to pretend overnight planning, repo-wide implementation work, or queued follow-up jobs are interactive.

That separation cleaned up a lot of confusion. I no longer need to treat every task like a synchronous RPC call. Some tasks deserve that. Others should obviously be queued.

The fleet itself is small enough to name. jarvis-infra and jarvis-synth are the synchronous tool-using A2A agents. jarvis-claude is the queue-backed worker. The hub holds shared context and task records. The Mac mostly triggers and coordinates. The important design choice is that the channels are complementary rather than interchangeable.

A2A means do this and tell me what happened, while the hub queue means take this, work through it when the worker is ready, and leave the result where I can read it later.

The local models still need their own routing discipline

The homelab side made the same lesson more obvious.

On the 6GB infrastructure agents, the model with the best general behavior has been Qwen3-4B-Q4_K_M. It is not the fanciest model in the fleet, but it is the one that consistently behaves when a task needs tool execution through A2A. I have benchmark notes showing it passing direct tool calls, strict JSON, A2A tool execution, and A2A JSON triage where some seemingly stronger alternatives fall over on formatting or tool use.

That reliability matters more than theoretical capability in that part of the system. A tool-using agent that emits beautiful markdown instead of a valid action is still a bad tool-using agent.

The heavier synthesis side is different. On jarvis-synth, Gemma-4-12B-it-Q4_K_M replaced an older 9B default because it matched the 93.8 percent pass rate in my smoke tests while cutting average latency from 22.2 seconds to 13.6 seconds. For deeper offline work, I still keep a Qwen3.6-27B frontier mode around because it was the only local model that went 16 for 16 in the same evaluation set, even though it averaged 33.4 seconds and had a roughly 63-second startup.

That is a good example of why I do not think about this as a single ranking anymore. The best model for a queue-backed offline quality task is not the best model for a constrained tool loop on a 6GB LXC. The best model for a fast local edit suggestion on my laptop is different again.

Once I accepted that, the system got easier to reason about. Every path has a job. Every job has a budget.

What operating it taught me

The first lesson is that routing policy has to live in one place that is more authoritative than prompt headers and more durable than habit. In my setup, the generated runtime configuration is the contract. Prompt metadata is useful documentation. It is not the thing I trust when I need to know what will actually run.

The second lesson is that transport and model choice should be decided separately. A2A versus queue is about interaction pattern, timeout, and where state is allowed to accumulate. Model tier is about cost, quality, and capability. Keeping those decisions independent makes the system much easier to change.

The third lesson is that benchmarks help, but production behavior settles the argument. I care about SWE-bench numbers and context windows, but I care just as much about whether a model keeps tool calls well-formed, whether it survives the prompt format I actually use, whether it loads quickly enough for the role, and whether it fails in a way I can recover from. A model that looks excellent in a leaderboard and awkward in a real tool loop is telling me something operationally important.

The fourth lesson is that free local inference is most valuable when it has a narrow, honest role. I like local models a lot. I still do not want them pretending to be a universal replacement for every remote path. On my 18GB laptop, the local tier is excellent for routine work, support tasks, and cheap exploration. When the task genuinely needs a stronger reasoning model or a huge context window, the system should just say so and route accordingly.

The fifth lesson is that queueing is a feature, not a concession. Once a task is likely to cross the 120-second line, or requires a worker with its own long-lived session state, the clean answer is to enqueue it. That keeps the interactive path honest and makes failure recovery much simpler.

I started this as a way to make a handful of agent workflows less clumsy at home. What I ended up with looks a lot like any other small reliability problem: classify the work, keep the control plane simple, separate fast paths from slow paths, prefer proven behavior over aspirational behavior, and record enough of the decision that you can explain it later.

The system is still changing. Models will keep changing with it. The part I expect to survive is the split between choosing the quality tier, choosing the execution path, and keeping both choices explicit enough that they can be revised without rewriting everything around them.

About the author

Lovell Felix

Infrastructure and reliability engineer working on Linux platforms, configuration delivery, and deployment safety at fleet scale.

More notes