> ## Documentation Index
> Fetch the complete documentation index at: https://gump.build/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cheap2Sota

> Start with a cheap model, escalate to SOTA only on failure.

# Cheap2Sota

Start cheap. Escalate only on failure.

## When to use

For most everyday tasks. The workflow starts with the cheapest agent and only escalates to more powerful models if gates fail. Ideal for keeping costs low without sacrificing reliability.

```bash theme={null}
gump run cheap2sota --spec spec.md
```

## The workflow

```yaml theme={null}
name: cheap2sota
max_budget: 8.00

steps:
  - name: decompose
    type: split
    get:
      prompt: |
        Decompose {spec} into independent tasks.
        Each task must be implementable and testable in isolation.
    run:
      agent: claude-sonnet
    gate: [schema]
    each:
      - name: impl
        type: code
        get:
          prompt: |
            Implement: {task.description}
            Files: {task.files}
        run:
          agent: qwen
          guard:
            max_turns: 60
        gate: [compile, test]
        retry:
          - attempt: 3
            agent: claude-haiku
          - attempt: 4
            agent: claude-sonnet
          - attempt: 5
            agent: claude-opus
          - exit: 6

  - name: quality
    gate: [compile, lint, test]
```

## How it works

Gump starts by asking Claude Sonnet to decompose the spec into independent tasks. Each task is then implemented by Qwen, the cheapest agent in the pool.

If the gates (compile + test) fail, Gump retries with the same agent first — sometimes a second attempt with the error context is enough. From attempt 3, Gump escalates progressively: Claude Haiku, then Sonnet, then Opus. Each retry receives the failed diff and the gate stderr as context.

The final gate (compile + lint + test) checks the overall integrity after all tasks.

## Typical metrics

Most tasks pass on the first or second attempt with Qwen. On a 3–5 task spec, average cost is $0.50–$2.00 with no escalation, and $3–$5 with one or two escalations. Duration: 1–3 minutes.

## Customize

<AccordionGroup>
  <Accordion title="Use an even cheaper first agent">
    Replace `qwen` with `opencode`.
  </Accordion>

  <Accordion title="Review the plan before building">
    Add `hitl: before_gate` on the `decompose` step.
  </Accordion>

  <Accordion title="Lower the budget for simple tasks">
    Reduce `max_budget` to `3.00`.
  </Accordion>

  <Accordion title="Enforce test coverage">
    Add `coverage: 80` to the `quality` gate.
  </Accordion>

  <Accordion title="Keep session across retries">
    By default, sessions are kept across retries. If you want a fresh start on escalation, add `session: new` to the escalation entries (automatic when agent changes).
  </Accordion>
</AccordionGroup>
