← Back to DejaViewed
arbitrage_opportunity

Earned Autonomy — a three-tier router that demotes work to your own GPU

Three trends in the catalog point at one design. Orchestrator-worker splits (Fable plans, Opus or GPT-5.6 executes) cut frontier spend. A 27B Qwen now fits a single 24GB card and posts agentic benchmarks that were frontier-only a year ago, while open-token share flipped to 80/20 in twelve weeks. And vendors can change the deal overnight — Anthropic killed subscription tokens in third-party tools. The agentic OS blueprint's 'earned autonomy' is the missing link: let each task class graduate down the stack — frontier, mid-tier, local — as its review pass rate proves it can.
Anthropic · ChatGPT · Claude · Claude Code · Claude Max · Claudex · Codex · DeepSeek · GPT-4o · Gemini · Grokbot · Llama · Notion · Open Claw · OpenAI · Qwen · Unsloth · Xiaomi AI Cube · cron · oc

Try It — Action Sketch

Log every delegated task for two weeks with a class label (rename, test-writing, data cleanup, UI tweak) and the reviewer's pass/fail Stand up Qwen 27B via llama.cpp or Ollama behind the same subagent interface; route one low-stakes class to it in shadow mode and grade it with the same frontier reviewer Add the promotion rule: 20 consecutive passes moves a class one tier down, any fail moves it back up; track dollars saved per class Falsifier: if after a month no task class sustains a 90%+ pass rate on the local tier, the local floor is not there yet for your work — stay two-tier

Connected Posts (12)

Prompt system — run this yourself

Pasteable into Claude Code, Claude, or any agent. One-shot for the whole result, step prompts when you want to steer. Every step carries its own audit; the gap audit makes the agent find and fill what it missed.

Mission. Build a three-tier task router (frontier, mid-tier, and a local Qwen 27B on one 24GB GPU) plus a zero tier for plain shell commands, wired into an existing orchestrator-worker setup. Each task class earns its way down the stack only through statistically justified review pass rates. The router doubles as a measuring instrument: per task class, it reports where open models have caught up and what that saves in dollars. Done means 14 days of logged tasks, a shadow-mode local tier graded blind by a reviewer from a different vendor, a promotion rule with a confidence bound, a cost ledger reconciled to billing, and a verdict on the falsifier.

1 · Deeper, not bigger

Rewritten prompt — ask for exactly that:

You are an ML platform engineer. Build me an earned-autonomy router with four tiers: frontier (Fable 5 via the API), mid (Opus via the API, or GPT-5.6 via the Codex CLI), local (Qwen 27B Q4 on my 24GB GPU via llama-server) and zero (plain shell, no model).
1. Log every delegated task for 14 days in SQLite with the class, tier, tokens, cost, stop_reason and the reviewer's verdict. Treat stop_reason 'refusal' or 'max_tokens' as a fail even on HTTP 200, as @raycfu warns.
2. Run the local tier in shadow mode on two low-stakes classes. Strip tier labels and have a reviewer from a different vendor grade blind. Double-grade 10% and report kappa.
3. Promotion is not '20 in a row'. Use SPRT with p0=0.85 and p1=0.95, plus a Wilson bound, and demote when the upper bound falls below 0.90.
4. Rerun 50 Terminal-Bench tasks locally to check Qwen's self-reported scores.
5. Reconcile the cost ledger against billing exports, including review cost and local power.
6. Use API keys only. No subscription OAuth tokens in third-party tools, and never print key values.
Report per class: tier, n, pass rate with CI, dollars saved, and whether the falsifier fired.

2 · One-shot prompt

ROLE
You are an ML platform engineer. You build measurement before automation and treat vendor benchmarks and creator claims as hypotheses.

CONTEXT
- @thomas.lentine: Fable orchestrates, writes specs, spawns cheaper Opus subagents in worktrees, and reviews in a loop.
- @raycfu: a cron loop.sh in which a cheap model triages, Fable plans, Sonnet executes and a fresh Fable reviews. Tasks earn autonomy 'after 20 passes at 95%' and lose it 'below 90%'. Refusals 'come back as HTTP 200', so check stop_reason.
- @cooper.simson: a /route skill that sends execution to GPT-5.6 through the Codex plugin. @nateherkai: Claudex, where two vendors cross-audit plan and build.
- @gigaqian: Qwen 3.8 27B fits in about 17GB at 4-bit on a 3090/4090 and claims 84.3 on OSWorld, but these are 'Qwen's evaluations'. DeepSeek V4 Flash went from 61.8 to 82.7 on Terminal Bench 2.1 through re-post-training. The Xiaomi AI Cube is an 80GB unified-memory prototype.
- @techno.optimist.prime: Friedberg says token share flipped from 80/20 closed to 80/20 open in 12 weeks.
- @tech.unicorn: Anthropic blocked subscription tokens in third-party tools, an estimated jump from $200 a month to $500-$2,000. @duck.tate: plan-value estimates of $7,000 and $12,000 in usage, which are third-party figures.
- @githubsignals: only-cli/oc gives compact numbered page views. @shellonback: never send an LLM a command you could run in bash.

HARD CONSTRAINTS
- Comply with vendor terms. Automation uses API keys. No subscription OAuth tokens in third-party harnesses. Ignore the 'don't tell Anthropic' workaround.
- Never show or log secret values. Only check whether a key exists.
- The local tier stays in shadow mode until promoted: it runs, but the incumbent output ships.
- Promotion uses statistics, not streaks. With 20 of 20 passes, the 95% upper bound on the fail rate is still about 14%.
- Graders never see which tier produced an output.

DELIVERABLES
1. router/ containing: classify.py (rules first, a cheap model as fallback); tiers.yaml; zero_tier.py, which maps requests to commands in package.json, the Makefile or scripts/; and stop_reason handling.
2. The ledger.sqlite schema and 14 days of logged tasks.
3. The local tier: llama-server with a Qwen 27B Q4_K_M GGUF, plus llama-bench output (tokens per second and the largest context that fits).
4. A blind grading harness: labels stripped, a cross-vendor reviewer, and a 10% double-graded sample for Cohen's kappa.
5. promote.py implementing SPRT per class and tier, with Wilson-bound demotion.
6. An independent rerun of 50 Terminal-Bench tasks on the local model, compared with the vendor numbers.
7. A cost report reconciled to billing, covering review spend and GPU power, with dollars saved per class.

BUILT-IN GAP ANALYSIS
List the classes with fewer than 30 graded tasks, reviewer disagreement above 20%, local runs with truncated context, and any cost that was estimated rather than billed. Fill what you can, by adding tasks or a second reviewer. Mark the rest UNFILLED.

SELF-QUESTIONS
Does my reviewer favor its own vendor? Does the local tier fail on long-context tasks the classifier hides? Are refusals counted as passes? Would the zero tier have handled 10% or more of the 'tasks'?

STOP
Stop at day 14 with a verdict per class. Stop immediately and ask if any harness needs subscription tokens or a terms grey zone.

RETURN
Return router/, ledger.sqlite, grading/, bench/, costs.csv and report.md with the sections Setup, Classes, Promotion Results, Independent Benchmarks, Costs, Falsifier, Compliance and Gaps.

3 · Step-by-step prompts

Step 1 — Ground truth: logs, billing, terms, vendor claims

Goal: Establish real baseline costs, the task mix, the compliance limits, and which numbers are vendor-reported.

Collect the raw material before writing any router code.
(1) Export 30 days of billing from the Anthropic and OpenAI consoles as CSV, with dollars and tokens by model.
(2) Pull the last 200 delegated tasks from the orchestrator's history: agent branches, task files or transcripts. Hand-label each with a class: rename, test-writing, data cleanup, UI tweak, docs, refactor or research.
(3) Quote the Anthropic Consumer Terms and Usage Policy clause on subscription credentials in third-party tools that made @tech.unicorn's setup non-compliant. Quote the equivalent OpenAI Codex terms.
(4) Build claims.csv for Qwen's 84.3 on OSWorld, the 17GB quant size, DeepSeek's 61.8 to 82.7, Friedberg's 80/20 flip, and @duck.tate's $7,000 and $12,000 plan values. Mark each one vendor-reported, third-party or independently verified.
(5) Read the Messages API docs and list every stop_reason value.

Expect: billing.csv, tasks_labeled.csv with 200 rows and class shares, compliance.md with quoted clauses, and claims.csv.

Audit before moving on: Billing totals must equal the console totals. If more than 15% of tasks fit no class, revise the taxonomy first. Fail if any credential value appears in any file. Check for key presence only.

Step 2 — Zero tier and router skeleton

Goal: Send deterministic work to the shell and put every tier behind one interface.

Write router/ in Python.
classify.py applies regex and AST rules first: a 'rename' touches identifiers only, and a 'test-writing' change only adds test files. A cheap model is the fallback and returns a class and a confidence score.
zero_tier.py parses package.json scripts, Makefile targets and scripts/*.sh. When a request maps to an existing command, such as 'run the tests' or 'build', it runs the command directly and logs tier=zero and cost=0, as in @shellonback's detector.
tiers.yaml maps tier names to endpoints. Frontier is Fable 5 via the API. Mid is Opus via the API or GPT-5.6 via the Codex CLI. Local is http://localhost:8080/v1.
Every model call records stop_reason. 'refusal' or 'max_tokens' marks the task failed.
The ledger table is tasks(id, ts, class, tier, shadow, model, in_tokens, out_tokens, cost_usd, latency_s, stop_reason, tests_pass, reviewer, verdict).

Expect: A working router CLI, ledger.sqlite, and unit tests for classification, zero-tier detection and refusal handling.

Audit before moving on: Replay the 200 labeled tasks through classify.py. Agreement with the hand labels must be 85% or better. The zero tier must have no false positives on tasks that need reasoning. A mocked refusal must be logged as a fail.

Step 3 — Local tier, benchmarked independently

Goal: Serve Qwen 27B on the 24GB card and check the vendor claims yourself.

Download a Qwen 27B Q4_K_M GGUF, or the Unsloth dynamic 4-bit quant, from Hugging Face and record its SHA-256.
Run llama-bench to get prompt and generation tokens per second. Find the largest context that fits in 24GB with the KV cache at q8_0.
Serve it with: llama-server -m <gguf> -c <ctx> -ngl 99 --port 8080.
Run 50 Terminal-Bench and 50 SWE-bench Verified tasks through the same agent harness and tool access the router uses, with oc for web reads. Run a frontier baseline on the same 100 tasks.
Compare the pass rates with Qwen's self-reported figures.
Record where the model drops reasoning across tool calls, and how much it degrades past 32k tokens. Log GPU memory headroom at the chosen context, so you know how much room is left for longer agent sessions. Note which failure types are tool-format errors rather than reasoning errors, because a better system prompt or grammar constraint can fix the former.

Expect: bench/llama_bench.txt, bench/results.csv with 100 tasks in local and frontier columns, and bench/notes.md.

Audit before moving on: Confirm the GGUF hash matches the published one. Rerun 10 tasks. If the pass rate swings by more than 10 points, use 3 seeds. Fail if the server logs show n_ctx overflow, meaning context was silently truncated.

Step 4 — Shadow mode with blind cross-vendor review

Goal: Run the local tier in shadow on two low-stakes classes and grade without bias.

Pick two classes with low blast radius and executable checks, such as test-writing and data cleanup.
For 14 days, send every task in those classes to both the incumbent and the local tier. Only the incumbent output ships.
The grading harness strips model names, tier labels, signature comments and whitespace tells, then shuffles the order.
The primary reviewer comes from a different vendor than the producer. This is @nateherkai's Claudex rule: never let one model plan, build and grade its own work.
A second reviewer double-grades 10% of the tasks, and you compute Cohen's kappa.
The verdict requires both tests_pass (exit code) and the reviewer's pass against the spec. Log rows with shadow=1. Seed the shuffle and store the mapping from blind ID to tier in a separate file the reviewers never see. Record reviewer cost per graded task, because step 6 needs it.

Expect: grading/ harness code, 60 or more shadow rows per class, and a kappa report.

Audit before moving on: If kappa is below 0.6, rewrite the rubric and regrade a sample before trusting any rate. Grep all grader prompts for model or tier names. Fail if any class has fewer than 30 shadow tasks.

Step 5 — Promotion engine with stated error rates

Goal: Replace '20 in a row' with promotion and demotion rules that have known error rates.

Implement promote.py.
For each class and tier, run Wald's SPRT on the pass-or-fail sequence with H0 p=0.85 and H1 p=0.95, alpha=0.05 and beta=0.10. Accepting H1 promotes the class one tier down.
Compute the Wilson 95% interval in parallel. Demote immediately when its upper bound falls below 0.90, which is @raycfu's 'below 90%' rule in statistical form.
Document why a streak is weak: 0 fails in 20 leaves a 95% upper bound of about 0.14 on the fail rate.
Promotion is per class, never global. Promoted classes keep a 10% audit sample graded by the frontier reviewer.
Add goals/, @raycfu's daily regression suite, which replays 10 frozen tasks per promoted class every morning via cron. Store every decision with its timestamp and the evidence count, so the report can show exactly when and why each class moved. Expose the thresholds in tiers.yaml rather than hard-coding them.

Expect: promote.py with tests, a per-class decision table, and goals/ with the regression suite and its cron entry.

Audit before moving on: Simulate sequences at p=0.80, 0.90 and 0.97. Empirical promotion rates must match alpha and beta within 2 points. Fail if any class was promoted with fewer than 30 graded tasks.

Step 6 — Cost ledger reconciled to billing

Goal: Measure dollars saved per class against real invoices.

For every task row, compute the cost from metered tokens at current list prices.
For the local tier, compute power as watts from nvidia-smi --query-gpu=power.draw, times latency, times the local $/kWh, and add hardware amortization over 36 months.
Reconcile the router's frontier and mid cost against the billing exports for the same days, to within 5%.
Per class, compute the counterfactual: the cost if every task ran on frontier, minus actual cost.
Include review spend. Reviews can erase the savings on cheap classes.
Treat @duck.tate's plan values and @tech.unicorn's $500-$2,000 estimate as claims to compare against, never as inputs. Store every price used, with a source URL and date, in prices.yaml so the numbers can be recomputed when list prices change. Show per-class savings both with and without review cost.

Expect: costs.csv by class and day, reconciliation.md with the variance against billing, and a savings table that includes review cost.

Audit before moving on: If the variance against billing is above 5%, find the missing calls (retries, untagged subagents) before reporting any savings. Fail if local cost omits power or amortization.

Step 7 — Validate against oracles and write the gap report

Goal: Deliver the per-class verdict, the falsifier result and the ranked gaps.

Run the oracle pass:
(a) Per class, the local pass rate with a Wilson CI against the incumbent, on executable tests.
(b) The independent benchmark reruns against the vendor-reported numbers.
(c) The billing reconciliation within 5%.
(d) Reviewer kappa of 0.6 or higher.
(e) The falsifier: does any class sustain a Wilson lower bound of 0.90 or higher on the local tier?
Write report.md with the sections Setup, Classes, Promotion Results, Independent Benchmarks, Costs, Falsifier, Compliance and Gaps.
If the falsifier fires, say plainly that you stay two-tier because the local floor is not there yet for this work. Rank the gaps by dollars at stake. Include one row per class showing what would change the verdict, for example 'needs 40 more graded tasks' or 'kappa too low to trust'. Recommend the next class to put in shadow mode.

Expect: report.md, a five-row oracle table, and a per-class verdict table with tier, n, pass rate, CI and $ saved.

Audit before moving on: Every promotion in the report must match promote.py output on the ledger. Mark any unreconciled savings figure as estimated. compliance.md must show no subscription-token use anywhere in the pipeline.

4 · Gap analysis and audit

You are an independent reviewer. Open report.md, ledger.sqlite, promote.py, grading/, bench/ and costs.csv.
1. Enumerate every claim: pass rates, promotions, benchmark comparisons, savings and compliance. Mark each one verified (with a SQL query or file reference), unverified, or false.
2. Recompute the per-class pass rates and Wilson intervals from ledger.sqlite and diff them against the report.
3. Rerun promote.py on the ledger and check that the promotions match.
4. Check blindness: grep the grader prompts for model and tier names, and recompute kappa.
5. Check refusals: count rows with stop_reason 'refusal' and confirm none is marked pass.
6. Check that savings include review spend and local power, and that they reconcile to billing.
7. Check compliance: no subscription OAuth tokens in configs, and no key-shaped strings in logs. Search by pattern and report counts without printing any match.
8. Rank the issues by impact. Fix the top three now. Report what you could not fix and why.
Return audit.md with the columns claim, status, evidence and fix, plus 'Remaining gaps' and an A-F grade.

Questions the agent must ask itself before it says done:

5 · What proves it right

6 · Failure modes

7 · Agent direction (unattended runs)

Start with the billing exports and task history. Without them, savings and class shares are guesses. Cache the GGUF, its hash and the llama-bench output, and do not re-download per run. Spawn one sub-agent for the independent benchmark rerun (step 3), which is long and isolated. Spawn another for the grading harness (step 4). Keep the promotion statistics and the final verdict in the main thread. Never read, print or copy API key values. Check only that the environment variables exist. Stop and ask the human before connecting any subscription account, before any promoted local-tier output ships to production, and if the GPU cannot fit Q4 with at least 16k context. Return router/, ledger.sqlite, grading/, bench/, costs.csv, report.md and audit.md. The final message is the per-class verdict table and the falsifier result.

Prompt system updated 2026-10-22 · all prompt systems · JSON

Deeper Dive generated 2026-10-22T23:23:01.158242 · Curated by Claude for Gabe (@6ab3) · dejaviewed.dev