Flows category icon
Harness Engineering
Advanced

Cost Control: Model Routing and Effort Tiers

Route work to the cheapest model that can do it and match reasoning effort to task difficulty - with quality guardrails.

4 steps12 verify checks90-120 minutesWorks with: emergent · chatgpt · claude · cursor
Start Guided Walkthrough

The Route

0/4 verified

Context Pack

Paste this first. It briefs the AI on requirements, constraints, and the Definition of Done before your first build prompt.

Context Pack
PROJECT CONTEXT:
My agent runs every subtask - trivial or gnarly - on the most expensive model at full effort, and the bill shows it. Harness evolution analyses show mature systems route by task class and tune effort tiers, without letting quality quietly rot.

GOAL:
Implement model routing and effort tiers in the harness: task classification, per-class model/effort assignment, budget tracking, and quality-guarded rollout.

REQUIREMENTS:
- A task/subtask classification the router can act on (main reasoning, summarization, classification, repair, sub-agent research)
- Per-class routing config: model + effort/reasoning tier + token limits
- Escalation paths: failed cheap attempts retry on stronger settings
- Per-session and per-task cost tracking visible in logs and summaries
- A quality-guard eval comparing routed vs premium-everything on a fixed task set

CONSTRAINTS:
- Routing is config, not scattered conditionals - one table rules all call sites
- Quality regressions beyond an agreed threshold roll the class back to the stronger setting

DEFINITION OF DONE:
- Auxiliary calls (summaries, classifications) run on the economy tier
- A cheap-tier failure escalates automatically and logs the escalation
- Session summaries report cost by class, model, and tier
- The quality-guard eval shows acceptable deltas for every routed class

COMMON FAILURES TO AVOID:
- Premium models summarizing tool output at 20x the needed cost
- Cheap models silently degrading main-task quality with no eval to notice
- Routing logic duplicated across call sites, drifting independently
- No escalation, so cheap-tier failures just become task failures

Paste this into your AI builder first. It teaches the AI what you want before you give it the build prompt.

Related routes

More Harness Engineering flows that share ground with this one.

Flows category icon
Harness Engineering

Assemble Tool Prompts Dynamically per Environment

Stop shipping one static mega-prompt: generate tool prompts from environment conditions, inject blocks only when features are on, and dedupe config to save tokens.

01Identify conditional blocks
02Build the prompt generator
03Dedupe and budget every block

+1 more steps to Done

Best forproduction-grade builds with strict verification

4 steps90-120 minutesAdvanced
Flows category icon
Harness Engineering

Design Layered Tool Prompts with Preference Chains

Structure your tool prompts the way the leading harness does: preference chains up front, usage constraints in the middle, NEVER-guarded safety protocols at the end.

01Audit the current tool prompt
02Write the preference chain
03Write usage constraints and safety protocols

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate
Flows category icon
Harness Engineering

Design the Permission Approval UX

Design approval prompts users actually read: diffs, risk framing, scoped grants, and pacing that prevents approval fatigue.

01Audit the current approval moments
02Rebuild the prompt content
03Make friction proportional to risk

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate

Made with Emergent