Skip to content

demo: take all server-owned settings from get_settings, no client fallbacks - #468

Closed
eddiebergman-priorlabs wants to merge 2 commits into
mainfrom
eddie/settings-from-server-demo
Closed

eddiebergman-priorlabs wants to merge 2 commits into
mainfrom
eddie/settings-from-server-demo

Conversation

@eddiebergman-priorlabs

@eddiebergman-priorlabs eddiebergman-priorlabs commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Generated by Claude Code

Demo only. Do not merge. This PR shows how the client looks if the server owns every setting and the client keeps no fallbacks. get_settings() retries, then raises SettingsUnavailableError, so a client without settings fails at init(). All checks that the client skipped when it had no settings now always run.

What changes
  • get_settings() retries up to 4 times with exponential backoff on network errors, 5xx and 429. Then it raises. It no longer returns a stale value or None.
  • Callers no longer check for None. These checks now always run: dataset size, train and test limits, class count, inline test sets, AUTO predict mode, thinking timeout, explain batch size.
  • TABPFN_CLIENT_ASYNC_USE_ABOVE_TRAINSET_SIZE and TABPFN_CLIENT_ASYNC_POLL_TIMEOUT default to None. A value in the environment still wins. Otherwise the server value applies.
  • The client takes these values from the server instead of hardcoding them:
    • list_available_models() (replaces both _AVAILABLE_MODELS lists)
    • the versions that create_default_for_version() accepts (replaces the local ModelVersion check)
    • the cached-fit batch size in explain.py (replaces CACHED_FIT_BATCH_SIZE)
    • the minimum train rows in the main estimator (replaces MIN_TRAIN_ROWS)
    • the number of characters kept in each text value (replaces the hardcoded 2500 in _clean_text_features)
  • Removes FALLBACK_PREDICT_ROW_PAIRS_BUDGET, which had no callers.
  • The optional thinking and inline-test-set fields of GetSettingsResponse are now required.
Server fields this assumes (they do not exist yet)

api_models.py is generated code. I edited it by hand to add these fields:

  • ModelLimit.train_set_min_rows and ThinkingLimit.train_set_min_rows
  • text_max_chars (today max_chars_per_text=2_500 in the server's text embedder, dists/preprocessors/legacy/text.py)
  • kv_cache_predict_max_test_rows (today the server-only config PRIOR_KV_MAX_PREDICT_TEST_ROWS)
  • classifier_model_names and regressor_model_names
Not done
  • Unit tests are not updated. Their settings fixtures do not have the new required fields, so the tests fail at collection.
  • The hosted, SageMaker and Foundry estimators keep MIN_TRAIN_ROWS. They do not call get_settings().
  • model_limit_from_version() still uses the closest lower version for an unknown version. To remove this fallback, the server must send a map from model name to version.
  • Downstream packages such as tabpfn-time-series read _AVAILABLE_MODELS. This PR removes that attribute.

🤖 Generated with Claude Code

…llbacks

get_settings() retries, then raises SettingsUnavailableError. Callers
drop their None branches. Assumes server fields that do not exist yet:
train_set_min_rows, kv_cache_predict_max_test_rows and the per-task
model name lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eddiebergman-priorlabs

Copy link
Copy Markdown
Contributor Author

Closed, just used as a reference. Reconsider in the future

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.

1 participant