-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Since commit 1471884, settings in the database take precedence over .env values. Only if the DB stores empty values (None, "", []) does .env get used.
Commit a8b7554 changed it so that 0 and False are now also treated as "empty" and ignored.
The code in question is:
merged_dict: dict[str, Any] = dict(env_resolved.dict())
merged_dict.update(
{k: v for k, v in db_json.items() if v not in (None, "", []) and v}
)This results in inconsistent behaviour for the operator:
If the DB contains "fixed_pricing": true changing .env to: FIXED_PRICING=False does not actually change the setting. There is also no indication that FIXED_PRICING is still active. The same applies for numerical settings, for example FIXED_PER_1K_INPUT_TOKENS.
Also, to my knowledge there is no UI to change most of the settings yet (including FIXED_PRICING), which makes changing settings with non-empty values in the database impossible without modyfing the database directly.
Is this behaviour intentional? If so, what is the intention behind it and what is the intended way to change the settings stored in the database?