Skip to content

Add API-backed dataset cost estimates - #382

Merged
dianaprior merged 3 commits into
mainfrom
quota-cost-estimation
Sep 11, 2026
Merged

Add API-backed dataset cost estimates#382
dianaprior merged 3 commits into
mainfrom
quota-cost-estimation

Conversation

@dianaprior

Copy link
Copy Markdown
Contributor

Change Description

Adds estimate_cost(X_train, X_test, ...) so callers can check an operation's quota cost before running it. The helper sends only dataset dimensions and settings to POST /tabpfn/estimate_cost, returning a typed result with estimated_cost, pricing_version, and the resolved inputs. It does not upload feature values or consume quota.

Supports prediction, Thinking fit/predict, and cached prediction. Defaults are resolved by the server; cache fallback or different fitted estimator counts can change the final charge. The endpoint requires quota v3 to be enabled.

Server counterpart: https://github.com/PriorLabs/tabpfn-server/pull/1164 (endpoint commit 78435846).

from tabpfn_client import estimate_cost

quote = estimate_cost(X_train, X_test, model_version="v3")
print(quote.estimated_cost, quote.pricing_version)

Validation: all 275 client unit tests passed, including 17 new helper tests. Ruff, type checks, and direct client-to-server HTTP contract checks also passed locally.

New dependencies: None.

Mattermost reviewer ping: None; this PR is a draft.

Breaking changes

Does this PR break the API? No. The new helper requires the server counterpart above; existing client calls are unchanged.

Does this PR break the user interface? No.

@CLAassistant

CLAassistant commented Sep 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dianaprior
dianaprior marked this pull request as ready for review September 9, 2026 08:44
@dianaprior
dianaprior requested a review from a team as a code owner September 9, 2026 08:44

@safaricd safaricd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All clean - thanks!

@ggprior ggprior mentioned this pull request Sep 11, 2026
@dianaprior
dianaprior added this pull request to the merge queue Sep 11, 2026
Merged via the queue into main with commit aecc98a Sep 11, 2026
11 checks passed
@dianaprior
dianaprior deleted the quota-cost-estimation branch September 11, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants