Skip to content

Commit 7025cc9

Browse files
authored
feat(config): add environment variable support for DEFAULT_MODEL_PARAMS (open-webui#23223)
1 parent 2d83d0f commit 7025cc9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

backend/open_webui/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,10 +1226,16 @@ def reachable(host: str, port: int) -> bool:
12261226
{},
12271227
)
12281228

1229+
try:
1230+
default_model_params = json.loads(os.environ.get('DEFAULT_MODEL_PARAMS', '{}'))
1231+
except Exception as e:
1232+
log.exception(f'Error loading DEFAULT_MODEL_PARAMS: {e}')
1233+
default_model_params = {}
1234+
12291235
DEFAULT_MODEL_PARAMS = PersistentConfig(
12301236
'DEFAULT_MODEL_PARAMS',
12311237
'models.default_params',
1232-
{},
1238+
default_model_params,
12331239
)
12341240

12351241
DEFAULT_USER_ROLE = PersistentConfig(

0 commit comments

Comments
 (0)