Skip to content

Allow per-stage model and reasoning selection #29

Description

@jzillmann

Problem

One model and one reasoning effort apply to every stage of a run. Stage 7 (packet review) dominates the token spend, so the strong model is paid for on work that does not need it.

Measured across runs of 0.5.6 on diffs of 9, 40 and 96 hunks (run.json / telemetry token counts):

stage share of total tokens
planning 1-2%
packet review 85-93%
verification 5-15%

Totals scale with the diff: ~0.9M tokens for 9 hunks, ~4.1M for 40, ~8M for 96. The Anthropic lane at opus/high reasoning uses about 1.7x the tokens of the openai-codex lane for the same diff.

Because the model is global, the only cost control available is to downgrade the packet review as well, which is the one stage where quality is the product.

Proposal

Allow the model and the reasoning effort to be selected per stage, falling back to the current global setting when a stage is not named:

[llm]
model = "..."            # default, unchanged

[llm.stages.plan]
model = "<cheaper model>"
reasoning = "low"

[llm.stages.verify]
reasoning = "medium"

Planning and composition look like the clear candidates for a cheaper model: they are structural work over text the pipeline already produced, and they are 1-2% and a few percent of the spend respectively. Verification is the interesting middle case - it is the main false-positive filter, so the value of a separate knob there is that it can be measured rather than assumed.

Why it matters

Per-stage selection turns "which model do I trust with this repository" into a per-stage question with a measurable answer, instead of one global decision that is paid for on every packet. It is also the prerequisite for anyone to publish a cost/quality curve for the tool.

Related but independent: #11 (grouping more related hunks) reduces the number of packet calls. The two levers compose - fewer calls, and the right model per call.

Happy to test a branch against a range of diff sizes and report tokens, wall time and finding deltas per stage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions