Home / Guides

Guides to AI cost estimation before merge

Class1 estimates the monthly cost impact of an AI code change inside the pull request, before it becomes a bill. These guides explain the method — probabilistic forecasting, fit-for-purpose model selection, and calibration against real actuals — and define the vocabulary.

Why estimate before merge

The expensive decision is the architecture, and it is made at review time.

Most AI cost tools are observability dashboards: they chart money that has already been spent. By the time a spike shows up, the callsite, the model choice and the retry policy are already in production and expensive to reverse. Class1 moves the question earlier, to the moment a change is proposed, and answers the only one that matters before merge: what does this do to next month's bill?

Because the answer is a forecast under uncertainty, it is a distribution, not a point. Class1 reports P50 and P90 (and P95 when a budget owner wants a stricter ceiling), decomposes the drivers, and attaches an estimate class that says how much the number should be trusted given the evidence behind it. A gate can fail a pull request whose P90 monthly delta exceeds a declared budget, and it never blocks a change that does not raise cost.

AI cost estimation before deployment The category page: forecast AI cost from the diff, before architecture becomes production spend. Glossary of AI cost terms Plain-language definitions: P50/P90, estimate class, cost per completed task, FOCUS, and more. The PR cost gate How the pull-request comment and the budget policy gate actually work. Platform internals The cost engine, takeoff scanner, Blue Book ledger, and footprint layers underneath. Frozen rate basis Why a reproducible, effective-dated price and capability basis is what makes an estimate credible. Footprint per pull request Carbon, water and materials as a second currency, from the same Monte Carlo draws.

How the estimate stays honest

Confidence is reported separately from the dollar figure, and it has to be earned.

A P90 number can be mathematically sharp and still rest on immature inputs, so Class1 reports the conditional risk band and the estimate class as two different facts. A brand-new install ships at Class 5 and only moves toward Class 1 as real estimate-to-actual pairs accumulate through reconciliation against actual bills.

The basis is frozen and effective-dated, so the same diff yields the same estimate, and as that basis ages the accuracy band widens by design. If you want the evidence behind the numbers, the trust page lists the tests, assumptions and open gaps, and the ledger shows the frozen price, spec, capability and actuals data.