Add API-backed dataset cost estimates - #382
Merged
Merged
Conversation
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 toPOST /tabpfn/estimate_cost, returning a typed result withestimated_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).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.