feat(run): report cost and stop a run at a budget
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
Direzione di ricerca
Start by searching internal/ for token fields in the result types, then read the retry loop in internal/evaluator/evaluator.go around line 362, since retried attempts must be counted too. Agree the design first: where prices come from in the user config, what counts as partial, and how the ceiling interacts with #350's planned count. Done means per-run, per-case and per-suite cost appear in results, and --max-cost stops new runs and exits non-zero.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem / motivation
It is hard to see what a suite will cost, and nothing stops a run that goes over budget.
--dry-runreports cases, not agent runs. With the code-stats example,skill-up run evals/eval.yaml --dry-run --baseline --iteration 5printsWould run 4 case(s). That is 40 agent runs (4 cases, 2 arms, 5 iterations), before any agent-judge or user-simulator calls.- Results record tokens, not money. I found no cost or price fields in
internal/. - Case timeouts and turn limits bound each case, but nothing caps what a whole suite spends.
Cost is a stated reason not to adopt. One team's assessment concluded "评测本身消耗模型调用费用,ROI 在当前规模下为负" (the evals' own model calls make the ROI negative at our scale) (assessment). It is also the first question before running evals in CI on every pull request.
Proposed solution
- Cost in results. Report it per run, per case and per suite, split into agent, agent judge and user simulator. Use the engine's own figure when it reports one (Claude Code's JSON result includes
total_cost_usd). Otherwise multiply tokens by a per-model price table in the user config, since prices change and differ by provider. Without a price, show tokens only, as today. Count every attempt, including retried ones: a retry replaces the earlier attempt's result (evaluator.go#L362), so pricing only the final results would undercount. - A budget ceiling:
--max-cost <amount>and aneval.yamlfield. Once the spent cost passes the limit, stop starting new runs and let running ones finish. Mark the result partial with the reason, and exit non-zero. - A token ceiling (
--max-tokens) for users without a price table.
Alternatives considered
- Provider dashboards. They show the bill after the fact, not per suite, and not in time to stop a run.
- A token ceiling only. That works without prices, but the same token count costs very different amounts across models.
Additional context
- #350 plans to report the planned case and iteration count before paid execution. This issue covers cost and the ceiling, and would build on that count.
compare --max-token-increase-percentalready gates token growth between two results.- Anthropic's plugin evals show a cost column and take
--max-cost-usd, which marks a run partial when hit (docs).
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 134
- Merge medio
- 1g 22h
- PR unite (30g)
- 61
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alibaba/skill-up
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
OpenSandbox runtime: expect.files_exist and file_contains fail because WorkspacePath is remoteForse già presa @bababoom721 l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
alibaba/skill-up#408 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
alibaba/skill-up#407 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
alibaba/skill-up#406 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alibaba/skill-up
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
fluxcd/notification-controller#1441 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
OneBusAway/maglev#2145 ·
I maintainer di solito rispondono entro 2 giorni
-
priority/medium status/ready type/chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
discobox-ai/discobox#1357 ·
I maintainer di solito rispondono entro 1 giorno
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itForse già presa @fzn0x l’ha presa oggi. Apertabug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
edit_file diff rendering panics on invalid UTF-8 textForse già presa @TDnorthgarden l’ha presa oggi. Apertaarea/tui
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
docker/docker-agent#4955 ·
I maintainer di solito rispondono entro 1 giorno