free-handoff: Cost Engineering for Multi-Model Agent Orchestration
1 · Why a harnessthe problem
Much research work is wait-dominated: running SAS/CIAO reductions, waiting for spectral fits to converge, waiting on Virgo-server pipelines. Handing such tasks to Opus/Sonnet-class agents spends money on "the model watching a progress bar" — every turn replays the full context, cache reads/writes dominate, and a few hours of polling costs $10–25 per task.
The free-handoff harness idea: a dispatcher (the main Claude agent) writes each task as a brief and hands it to an executor arm drawn from a tiered model pool. Every arm runs in an isolated sandbox and must deliver reproducible checks (runnable commands + SHA256). Critical tasks run as paired arms (same brief, two models from different families), with the dispatcher independently recomputing and adjudicating. Free models carry the waiting; paid models are spent only where judgement matters.
2 · Four tiers and pricingtiers & pricing
Four tiers (finalized 2026-10-16), ordered by API-equivalent price:
- Opus 5.5 (Claude)
- gpt-6-astra
- Fable
- Expert control arms only
- Sonnet 5.5 (Claude)
- gpt-6.1-sol (OpenAI)
- Default for diagnosis, discovery, design
- gpt-6-luna (OpenAI)
- Haiku 5.5 (Claude)
- Workhorse for wait-dominated tasks
- Hermes (nim-large, NIM)
- codexnim (nim-stream, NIM)
- Workhorse for red teams, bulk reduction
Prices (USD/M tokens, checked 2026-10-11): Sonnet 5.5 input 2.00 / cache-read 0.10 / cache-write 2.50 / output 10.00; luna input 0.10 / cached 0.01 / output 0.50; Haiku ≤100K prompt 0.10/0.01/0.50, >100K 0.50/0.05/2.50; Opus 4/20. Subscriptions are paid, so API prices are a yardstick, not an invoice.
3 · Paired arms: cost vs capabilitypaired arms
Same brief, two arms, independent recomputation by the dispatcher — the mechanism that makes free-handoff's comparisons meaningful. Below are the most representative pairs from the ledger (capability 0–3: 3 = correct at first delivery).
Sonnet vs sol (both normal tier, different vendors)
| Task (class) | Sonnet | sol | Verdict |
|---|---|---|---|
| XARTATOMS fit-reliability-audit (I-D2) | $13.22 / 3h45 | ≈$9.5 / 2h17 | cap 3 tie; sol 28% cheaper |
| XARTATOMS perinst-profile (I-D2 modelling) | $5.52 / 92min | $1.49 / 7h19 | sol 73% cheaper but 4.8× slower and C-only; Sonnet delivered the first C+XMM joint profile |
| XARTATOMS gti-lightcurve-audit | $2.89 / 27min | ≈$1.55 / 19min | both cap 3; Sonnet's recommendation clearer, sol's definitions more careful |
| S2Fitting E015 velocity-field (D2) | $1.92 / 2h15 | ≈$1.37 / 46min | Numbers identical digit-for-digit; sol 3× faster |
| S2Fitting E013 velocity-gradient (D2) | $1.12 / 45min | — | Sonnet traced the anomaly to a biased input table (B005); luna misattributed it |
Sonnet vs free arms (the widest cost gap)
| Task | Sonnet | Free arm | Verdict |
|---|---|---|---|
| FXT×XMM blank-field archive search (discovery) | $7.75 / 147min | $0 / 31min (Hermes v1) | Hermes 4.7× faster but cap 1: used only ⅓ of the public archive, took wall-clock as effective exposure, narrow cluster screen. Sonnet cap 3 = the reference |
| Same (Haiku blind repeat) | $7.75 | $0.55 / 27min (Haiku) | Haiku made the same three errors, cap 1 — speed and cheapness do not buy discovery quality |
| DXC exam-score LMC pilot (fitting) | $6.85 / 4h | $0 / 8h (Hermes) | Hermes hit 8 h and was stopped INCOMPLETE; Sonnet finished and was used |
| DXC pareto-policy-search (D2 design) | $0.77 / 16min | $0 / 1h35 (Hermes) | Both cap 3; Hermes 6× slower but free |
Sonnet vs luna (normal vs cheap)
| Task | Sonnet | luna | Verdict |
|---|---|---|---|
| E013 toy forward model + 1,536 fits | $1.12 / 45min | $0.60 / 2h15 | Same core numbers; Sonnet diagnosed deeper (found the input artefact's root cause) |
| thinking pilot1 blind review + pushback ladder | $0.24 | $0.07 (luna) / $0.04 (codexnim price) | Sonnet was the only arm that held 4/4 rungs; luna yielded to a bare assertion, codexnim to an unverifiable number |
Sonnet vs Opus (normal vs expert)
| Task | Sonnet | Opus | Verdict |
|---|---|---|---|
| XARTATOMS stage5 D55 decisive test | $15.35 / 4h | ~64min | Same AMBIGUOUS verdict; Opus corrected MD (>0.50 not 0.43) and found 2 wording defects Sonnet missed → expert margin ≈ 1 point |
| S2Fitting E018a xdsp-closure (expert control) | — | $2.54 / 46min (Opus) vs sol $0.18 | Opus found a brief frame error and decomposed the offset; expert tier's edge is ~1 point on diagnosis/interpretation only |
4 · Cost-control resultsresults
The core result: move wait-dominated work (SAS reduction, batch fitting, long polling) from normal/expert down to free/cheap — a 10–100× cost reduction at equal capability. Judgement-dense work stays on normal; expert appears only as a control arm (once per 5 normal tasks, adaptive ratio 3:1 → 7:1).
5 · Routing lessons: which task to whomrouting
The ledger answers "who gets what" from several hundred runs. Conclusions as of 2026-10-17:
| Task class | Route | Evidence |
|---|---|---|
| Discovery / archive search (open-ended) | Start at Sonnet, or a dual with Sonnet | Free arms alone are unusable (the same three systematic errors recurred on Hermes and Haiku) |
| Multi-hour SAS / response chains (wait-dominated) | codexnim / luna | codexnim reliable and free: stops on provenance mismatch instead of improvising; luna same result at 8–12× less |
| Well-specified numerics / fitting (frozen recipe) | sol / luna / Haiku | Four arms gave digit-identical numbers (E010/E011); recipe + brief produce cap 3, tier does not |
| Diagnosis / modelling comparison (judgement-dense) | sol or Sonnet | sol ≈ half Sonnet's price; in E013 Sonnet traced a biased input table where luna misattributed |
| Web / literature search | cheap or higher (PI rule) | luna found the key source codexnim missed in 14 min / 26 refs vs 2 h 31 min (Nevalainen+2005); free arms' web is weak |
| Red team / adversarial review | codexnim first (free) | Hermes red-team content is good but it does not write reports incrementally (two 9.7 h no-report cases); codexnim delivers complete reports in 45 min–3 h |
| Static pages / mechanical recipes | Hermes (free) | CF Pages publishes at cap 3 repeatedly; 6–8 min per job |
6 · Guardrails learned from failuresguardrails
The ledger's Routing notes accumulate 60+ dated lessons. The structural ones:
Cost side
Rule 1 Wait-dominated long tasks: the brief says "launch-and-exit" — the executor starts a detached worker,
writes the report skeleton, and exits; a watcher (or the heartbeat) resumes it later for the report.
Avoids full-context polling.
Rule 2 Do not resume a long thread for a costly arm's stage 2: every turn replays the entire context.
sol's stage-2 resume cost $26.08 (178M input). Use "fresh session + compact hand-off" instead,
unless the stage truly depends on in-context state.
Rule 3 Quota gate first: no dispatch unless quota-gate claude/codex passes; a 5h window already reset counts
as full (--rolled-5h-ok), but a live 5h reading below 30% is still NO-GO — it would cut off the
running subagent.
Rule 4 Never price a run from the Agent tool's printed token total (e.g. 235,146) — it is not a billing
measure; recompute exactly from the transcript events with cost.py.
Quality side
Rule 5 Dual briefs must say in words "do not open the other arm's REPORT / out_* files" — otherwise the
second arm read the first's report, its agreement is copied, and the run is not scorable.
Rule 6 Give the CPU gate as an exact snippet (busy = Δ(total−idle−iowait)/Δtotal); never let the
executor write its own — two self-written gates counted idle as busy and waited 1.5 h for nothing.
Rule 7 Brief defects dominate errors: two thirds of executor "mistakes" were dispatcher brief bugs.
Validate the brief's paths, target existence, and naming rules on the repo before dispatch.
Rule 8 Hermes non-interactive bans: never end the turn while a background job runs; never ask
("shall I write the report?"); never repeat an identical failing call (observed: 283 repeats).
Rule 9 codexnim silent stalls cluster near ~200k request tokens: do not resume a ≥200k thread —
start a new session with a short continuation prompt pointing at saved products.
Rule 10 Numerical fitting briefs must set OMP/OPENBLAS/MKL_NUM_THREADS=1 per worker — multithreaded
BLAS once pulled load 65 on 32 cores from 4 workers.
7 · Reusable mechanismsreusable
If you take five things away:
- Tiers + controls: a four-tier model pool; free arms carry volume, normal arms supply control arms at an adaptive ratio (3:1–7:1), expert appears once per 5 normal tasks. All controls share one brief, and the dispatcher recomputes independently.
- A cost ledger: every run records wall time, tokens, API-equivalent cost, capability 0–3, errors, corrections, and whether it was used. One week of data answers "who gets what".
- Capability scoring, not vibes: 0 unusable / 1 needs a redo / 2 correct after minor corrections / 3 correct at first delivery, against a dispatcher-recomputed reference.
- The brief is the contract: paths, acceptance checks, resource caps, and bans are all written down; executors may not silently substitute, write outside bounds, or deliver anything non-reproducible (commands + SHA256).
- Failures enter the ledger: every incident becomes a dated rule that the next brief cites. Standing red teams (≥2 free per project), findings triaged as material / minor / false alarm and recomputed.