Problem: Complex tasks require careful planning but straightforward execution. Using an expensive model for all steps is wasteful; using a cheap model to plan produces poor plans.

Solution: Use a powerful model (GPT-4-class, Claude Sonnet 5) to generate a complete step-by-step plan, then execute each step with a cheaper, faster model (GPT-4o-mini, Claude Haiku 4.5).

Implementation:

  1. Plan: Call the planner model with: "Generate a detailed step-by-step plan to [goal]. Return as a JSON array of steps."
  2. Store plan: Persist the plan; allow human review if needed
  3. Execute: For each step, call the executor model with the step description + context from previous steps
  4. Replan trigger: If a step fails or produces unexpected results, call the planner model to revise the remaining plan

Trade-Offs:

  • Pro: 50-70% cost reduction vs using the expensive model for all steps
  • Pro: Plan is inspectable and modifiable before execution
  • Con: Planner-executor mismatch: planner may assume capabilities the executor lacks
  • Con: Replanning adds latency

When To Use: Research tasks, code generation with multiple files, data analysis pipelines, content creation workflows. When to avoid: Simple tasks where a single prompt suffices; tasks with highly dynamic, unpredictable steps.