Cost estimation v1#2489
Conversation
So we aren't confused about input_tokens vs. total_input_tokens
- Can generate a report for the user
Before, the override was completely erasing the base estimate description. If you only overrode comment_tokens, there was no way of telling how the answer tokens were computed.
- Add file token averages to question breakdown table, when applicable - Make estimates more comprehensible
Different models should have their own calibrated output estimates.
This is especially useful since we don't have good upfront thinking token estimation.
|
@greptileai review |
Greptile SummaryThis PR introduces a first-pass cost estimation system for EDSL jobs, adding a new
Confidence Score: 3/5The cost computation itself is correct, but the markdown summary table presents unweighted token totals alongside reach-weighted costs in a way that will produce misleading results for any job with skip logic. The core reach-weighting on cost_usd is correctly implemented. However, summary_by_model() sums raw, unweighted token counts while summing reach-weighted costs into the same table, meaning the displayed 'Total input × Input $/M' arithmetic won't match 'Total cost' whenever branch_weights are supplied. This is the primary output surface users will rely on to understand and audit their estimates. edsl/jobs/cost_estimation/job_cost_estimate.py — specifically the summary_by_model() method and the resulting to_markdown() 'Cost by model' table Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
JCE[JobCostEstimator.estimate_cost] --> RP[_compute_reach_probabilities\nforward propagation]
JCE --> IL[generate_interviews]
IL --> IQ[per question: get prompts via FetchInvigilator]
IQ --> QE[QuestionEstimator.estimate\nper question-type formula]
IQ --> FSE[FileStoreEstimator.estimate\nimage / PDF / text / audio]
FSE --> IMG[ImageEstimator\nOpenAI tile/patch · Anthropic · Google]
FSE --> PDF[PdfEstimator\nOpenAI · Anthropic · Google]
QE --> FE[QuestionTokenEstimate\nprompt + file + memory + answer + comment + thinking]
FSE --> FE
FE --> OV[apply TokenOverride\nmost-specific match wins]
OV --> COST[cost_usd = compute_cost × reach]
RP --> COST
COST --> JCR[JobCostEstimate\n.total_cost_usd · .detail · .to_markdown]
style COST fill:#f9f,stroke:#333
style JCR fill:#bbf,stroke:#333
Reviews (8): Last reviewed commit: "Fix chars_per_token inconsistency with P..." | Re-trigger Greptile |
- Fix potential ZeroDivisionError with Google estimator - Fix percentile function; add regression tests - Fix branch weight description in docstrings - Fix reference to non-existent "assumptions" attribute in docstring - Remove debug logs
- Fix potential ZeroDivisionError with OpenAI estimator - Fix memory plan + branch weight combination issue; add regression test
No description provided.