Six settings in sherpa_ai/config/__init__.py are defined and documented but never read anywhere in sherpa_ai/. Most look like wiring gaps rather than dead code — the feature exists, but the setting that should control it was never connected, so setting the env var silently does nothing.
Found while removing TEMPERATURE (genuinely dead, removed in #509).
| Setting |
Default |
Why it looks unfinished |
ENABLE_COST_TRACKING |
true |
DAILY_COST_LIMIT and COST_ALERT_THRESHOLD are both read in 3 places, so cost tracking works — but its on/off switch is never checked. Cost tracking can't be disabled. |
MODEL_PRICING_CONFIG_PATH |
None |
PricingConfig.__init__(config_path=None) already handles a path, and _load_pricing_config reads it. Nothing passes cfg.MODEL_PRICING_CONFIG_PATH in. (MODEL_PRICING_JSON works fine.) |
FILE_SIZE_LIMIT |
2097152 |
FILE_TOKEN_LIMIT is enforced; the size limit next to it isn't. |
DAILY_LIMIT_REACHED_MESSAGE |
long default message |
A user-facing message for exceeding DAILY_TOKEN_LIMIT (which is enforced), but nothing ever displays it. |
AWS_ACCESS_KEY |
None |
backup.py calls boto3.client("s3") with no credentials. Also these names are non-standard — boto3 reads AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY, so setting these has no effect by either route. |
AWS_SECRET_KEY |
None |
as above |
Suggestions
MODEL_PRICING_CONFIG_PATH — smallest fix: default the parameter to the config value, e.g. config_path or cfg.MODEL_PRICING_CONFIG_PATH in PricingConfig.__init__.
ENABLE_COST_TRACKING — check it before cost tracking runs, or drop it if cost tracking is meant to be always-on.
FILE_SIZE_LIMIT — enforce it where FILE_TOKEN_LIMIT is enforced, or drop it.
DAILY_LIMIT_REACHED_MESSAGE — return it where the daily token limit is hit, or drop it.
AWS_ACCESS_KEY / AWS_SECRET_KEY — simplest is to delete both and let boto3 use its standard credential chain, which is what actually happens today. If explicit credentials are wanted, rename to the standard names and pass them to boto3.client().
Each is independent, so they can be taken one at a time. Deleting is a fine outcome for any of them — the point is that right now they read as supported configuration and aren't.
Note LOG_LEVEL is not in this list: it is used, at config/__init__.py:95.
Six settings in
sherpa_ai/config/__init__.pyare defined and documented but never read anywhere insherpa_ai/. Most look like wiring gaps rather than dead code — the feature exists, but the setting that should control it was never connected, so setting the env var silently does nothing.Found while removing
TEMPERATURE(genuinely dead, removed in #509).ENABLE_COST_TRACKINGtrueDAILY_COST_LIMITandCOST_ALERT_THRESHOLDare both read in 3 places, so cost tracking works — but its on/off switch is never checked. Cost tracking can't be disabled.MODEL_PRICING_CONFIG_PATHNonePricingConfig.__init__(config_path=None)already handles a path, and_load_pricing_configreads it. Nothing passescfg.MODEL_PRICING_CONFIG_PATHin. (MODEL_PRICING_JSONworks fine.)FILE_SIZE_LIMIT2097152FILE_TOKEN_LIMITis enforced; the size limit next to it isn't.DAILY_LIMIT_REACHED_MESSAGEDAILY_TOKEN_LIMIT(which is enforced), but nothing ever displays it.AWS_ACCESS_KEYNonebackup.pycallsboto3.client("s3")with no credentials. Also these names are non-standard — boto3 readsAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, so setting these has no effect by either route.AWS_SECRET_KEYNoneSuggestions
MODEL_PRICING_CONFIG_PATH— smallest fix: default the parameter to the config value, e.g.config_path or cfg.MODEL_PRICING_CONFIG_PATHinPricingConfig.__init__.ENABLE_COST_TRACKING— check it before cost tracking runs, or drop it if cost tracking is meant to be always-on.FILE_SIZE_LIMIT— enforce it whereFILE_TOKEN_LIMITis enforced, or drop it.DAILY_LIMIT_REACHED_MESSAGE— return it where the daily token limit is hit, or drop it.AWS_ACCESS_KEY/AWS_SECRET_KEY— simplest is to delete both and let boto3 use its standard credential chain, which is what actually happens today. If explicit credentials are wanted, rename to the standard names and pass them toboto3.client().Each is independent, so they can be taken one at a time. Deleting is a fine outcome for any of them — the point is that right now they read as supported configuration and aren't.
Note
LOG_LEVELis not in this list: it is used, atconfig/__init__.py:95.