lesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightlesson 4 of 4 · the model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is rightthe model picker — when sonnet is wrong and haiku is right
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving.
Final drill. Synthesize the model picker AND its cost into one
function: cost_aware_routing(tasks).
Takes a list of task dicts (same shape as step 7:
kind, volume_per_day, latency_ms_max, criticality).
Returns a dict:
routes: dict mapping each task'skindto the chosen model ("haiku","sonnet", or"opus").total_cost: float, total estimated daily cost across all tasks, rounded to 2 decimal places.
Use the same routing rules from step 7:
volume_per_day >= 10000→"haiku", unlesscriticality == "high"→"sonnet".volume_per_day < 100ANDcriticality == "high"→"opus".- Default →
"sonnet".
Cost math: assume each call averages 1000 tokens. Blended prices per million tokens:
- haiku: $3.00
- sonnet: $6.00
- opus: $15.00
Daily cost for one task = volume_per_day * 1000 * (rate / 1_000_000),
which simplifies to volume_per_day * rate / 1000.
Five tasks run. Expected output:
ticket_tagger -> haiku
support_summary -> sonnet
contract_review -> opus
fraud_alert -> sonnet
architect_review -> opus
total daily cost: $300.09