Skip to content
NEWBudgetBench: memory strategy evaluation under a fixed token budget (arXiv:2609.13149) →
Aditya Karnam
Chapter 7 of 7 · Factories · 30 min

Software factories: running it all

Put the stack to work: routing subagents across machines, a local lab, and an infrastructure layer for agents.

You will learn

By the end of this chapter

  • Explain a control plane that routes agents across local compute
  • Compare local and cloud economics honestly
  • Plan your own small software factory
7.1

From one model to a factory

Six chapters gave you the parts. A chip does arithmetic and moves memory. An inference runtime turns a model into answers. Training and distillation make a small model better. Retrieval puts the right context in a small window. An agent harness wraps a loop around the model. Evals tell you whether any of it worked.

A software factory is what you get when you run those parts together on purpose. Instead of one chat window talking to one model, you have several roles, such as a planner, an implementer and a reviewer. Each role has its own model, its own tools and its own machine. Something has to decide which request goes where, keep the machines warm, and show you what happened. That something is a control plane.

The stack from Silicon to Factories7Factories30 min6Evals30 min5Agents35 min4Retrieval30 min3Models30 min2Inference30 min1Silicon25 min
Factories. Routing, cost and a plan: this chapter.

Schematic, not to scale

Click a layer. Each line restates a result from that chapter's sources. Schematic, not to scale.

The rest of this chapter looks at one concrete control plane, what its evaluation found, what the hardware costs compared with renting, and the gap in the stack that nobody is filling. All of it comes from the author's own posts.

7.2

One config, many machines

subagent-fleet is an open-source control plane for running Claude Code-style subagents across local Ollama machines. The problem it solves is simple to state. Most coding-agent setups ask for one model endpoint. That is fine for one chat. It breaks down once you have subagents, because a planner does not need the same model as an implementer, and a long session should not silently fail because one machine dropped off the network.

It sits above Ollama and LiteLLM and replaces neither. You describe the fleet once in a file called fleet.yaml: which machines exist, which Ollama models live on each, which role uses which model, and how the LiteLLM gateway should route. Running subagent-fleet generate then writes the LiteLLM config, the agent definition files and a local environment file from that one source of truth.

The routing in the post is deliberately plain. The planner goes to a small fast model on a lightweight node. The implementer and the reviewer go to a larger coding model on a bigger node. The summarizer goes to a small local model on the controller. Try it below.

subagent-fleet routing schematicfleet.yamlnodes, models, roles, routesgeneratesCoding harness, role: plannerLiteLLM gatewayroutes from fleet.yamlControllersmall local modelOllamaLightweightsmall fast modelOllamaBigger nodelarger coding modelOllamaschematic, not to scale

Pick a role, then press Step.

Pick a role and press Step to follow one request. Routes follow the example in the subagent-fleet post. Schematic, not to scale.

A model route in the file looks like this. The post's example maps a model called heavy-coder to the node m4-mini-64gb, running qwen2.5-coder:32b, exposed to agents under the alias claude-sonnet-local, with a context of 32768 and a timeout of 600.

Two operational details matter more than they sound. First, cold starts: the first request to a model can be slow enough to make the whole system feel unreliable, so subagent-fleet warmup preloads the configured models before the session starts. Second, visibility: subagent-fleet ui opens a live dashboard on port 8080 that shows node health, agent routing, the LiteLLM trace stream and warmup progress. Once agents do real work, you need to see which model answered.

It is also built for private networks only: a LAN, Tailscale, WireGuard or a private subnet. The post says not to expose Ollama to the public internet and not to expose LiteLLM without authentication.

7.3

Does the local fleet hold up?

After building the control plane, the author asked the obvious question and ran a head-to-head eval. It sends 8 real coding tasks to three systems: the local fleet, Claude Sonnet 5 and GPT-4o-mini, the last two through OpenRouter. A separate LLM judge scores each answer blind from 0 to 10 for correctness, code quality and completeness.

SystemMean scoreMean latencyTotal cost
Local fleet8.3817.47 s$0.0000
Sonnet 58.885.22 s$0.0077
GPT-4o-mini7.503.47 s$0.0004

The fleet reached 94% of Sonnet 5's mean quality at zero marginal model cost, and beat GPT-4o-mini on mean score. It passed 7 of 8 prompts against the author's bar of staying within 80% of the best frontier score for that prompt.

Read the table the way chapter 6 taught you. The local fleet was also the slowest, at 17.47 seconds against 5.22 for Sonnet 5. And it had one clear miss: on the pytest_unit_tests prompt it scored 4.0 while Sonnet 5 scored 8.0. The author's reading is that local coding models can be strong at implementation and refactoring while still needing work on edge-case test generation. His own summary is that local does not beat frontier here. A well-routed local fleet can get close enough to be useful, private and effectively free per extra run.

Which model goes on the nodes is its own measured choice. In the author's serving benchmark on one MacBook Pro with an M5 Pro and 48 GB of memory, Ollama was the best overall latency baseline and won 5 of 6 workloads. In the Qwen 3.5 size sweep on Ollama, the 0.8b model averaged 146.03 tokens per second and the 9b model 29.77, but qwen3.5:2b looked like the practical default. The same benchmark also shows how memory limits a shared machine: vLLM Metal crashed with an out-of-memory error once SGLang had reserved a large KV pool, so the runs had to be isolated.

7.4

What it costs: local versus cloud

The author's overkill ML lab is one Mac mini M2 Pro with 64 GB of unified memory, running Ray, MinIO, Streamlit and Docker. The post lists a monthly electricity cost of $1.73 and says the machine draws 20 watts under full ML load. For the equivalent AWS setup it lists a c5.4xlarge for CPU at $196 per month, GPU instances for training at $300, and S3 storage and transfer at $50, for $546 per month in total. It states a break-even point of 5.1 months.

Those are the post's numbers and they are one person's estimate for one workload. Use the explorer to test them. Untick the GPU line if you do not train models. Lower the share of the cloud bill you would really rent. Then enter what a machine would cost you and see how the break-even moves.

Cloud line items per month
Local (electricity $1.73/month + hardware)$10.38
Cloud equivalent ($546/month)$3,276

With hardware set to $0 the local side is only electricity, which is how the post counts its monthly cost. Move the hardware slider to what a machine really costs and watch the gap shrink.

Figures from the overkill-lab post: author's own estimate, one Mac mini M2 Pro with 64 GB. Schematic, not a quote.

Local versus cloud, using only the figures from the overkill-lab post. Hardware price is yours to enter. Schematic, not a quote.

The post's $1.73 counts electricity and treats internet as free because it already existed. The hardware price is not in that monthly figure, so the hardware slider starts at zero for you to fill in. The author also admits he could do most of his ML work on a laptop with 16 GB of RAM and a cloud account. Cheap local compute pays off when you keep the machine busy. It pays off less when it sits idle.

7.5

The layer between model and product

In July 2026 the author wrote about five news stories from one week in Indian tech, including a $1.5 billion valuation for Emergent and up to ₹3,500 crore approved by HCLTech for AI data centers scaling to 50 MW. His argument is that the money is going to two ends of the stack: applications on top and compute underneath. What is still mostly missing is the runtime between a model endpoint and a working product, the harness that decides whether an agent finishes the job.

He lists what that missing middle contains:

  • Agent evaluation that measures the harness, not only the model's benchmark score.
  • Tool and MCP interoperability, so an agent is not locked to one vendor's format.
  • Telemetry: a trace of what the agent tried and called.
  • Permission and identity boundaries with an auditable approval model.
  • Cost-aware routing, so a planning step does not burn the budget of an implementation step.
  • Human approval gates that are real checkpoints.
  • Multilingual reliability, in a market with 22 scheduled languages.
  • Reproducible benchmarks.

You have now seen most of this list in this course. Cost-aware routing is subagent-fleet. Approval gates and tracing are the harness work in chapter 5, where Quecto's core is described as 1.3 MB. Reproducible benchmarks are chapter 6. The post's claim is that the factory is the combination, and that evaluating which harness wired to which model finishes a class of task inside a budget is more useful than asking which model is best.

7.6

Plan your own factory

You do not need three machines. The post lists examples for a laptop only, a Mac mini, and multi-node clusters. Answer these on paper before you install anything.

  1. Roles. Which jobs do you hand to an agent: planning, implementing, reviewing, summarizing? Which of them need a strong model and which do not?
  2. Machines. What do you already own? Which one has the most memory? Remember that on Apple Silicon, memory is the system.
  3. Models and runtime. What is the smallest model that passes your own tasks? Measure it the way the Qwen sweep did, on speed and on a rubric, not on a leaderboard.
  4. Evidence. What are your eight tasks? Who or what judges them, and what bar counts as good enough? Write the bar down before you run it.
  5. Cost. What would the same work cost in the cloud, and how many months until your hardware breaks even? Be honest about idle time.
  6. Safety. Is everything on a private network? Is the gateway behind a key? Which actions need a human to approve?
  7. Visibility. When a request goes wrong, how will you know which model answered and why?

When you are ready to try it, subagent-fleet starts with subagent-fleet init, then validate, discover, generate and ui. Running examples are on the Live page and the Systems page.

Check yourself

Can you answer these?

Q1What does the single fleet.yaml file generate?
The LiteLLM gateway config, the Claude Code-style agent definition files and a local environment file, all from one description of machines, models and roles.
Q2In the head-to-head eval, where did the local fleet lose, and by how much?
It scored 4.0 on the pytest_unit_tests prompt where Sonnet 5 scored 8.0. It was also the slowest system, at 17.47 seconds mean latency against 5.22 for Sonnet 5.
Q3Why is the $1.73 monthly figure not a full cost comparison?
It counts electricity only. The hardware price is not part of it, so the break-even point depends on what the machine cost and on how busy you keep it.
Q4Which roles does the post route to the larger coding model on the bigger node?
The implementer and the reviewer. The planner goes to a small fast model on a lightweight node, and the summarizer to a small local model on the controller.
Go deeper

The original work behind this chapter

← EvalsBack to the course →
© 2026 Aditya Karnam