mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 15:53:59 -06:00
[GH-ISSUE #12393] feat: load initial data on startup via json files (e.g. workspace models / user groups / ...) #32110
Reference in New Issue
Block a user
Originally created by @MaxStroh on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12393
Check Existing Issues
Problem Description
We are running OpenWebUI in Kubernetes and with PostgresDB and would like to enhance the Infrastructure as Code behaviour of OpenWebUI.
To ensure, that everything relevant is set up, when we start with a fresh new instance (or in case we have to fully reset an existing environment), we would like to automatically import data that ist not configurable otherwise.
Some exemplary Use Cases:
models.jsonto already set up the access assignments of groups to our custom models (workspace models)Desired Solution you'd like
config.jsonfile. If on startup (e.g. in an init container) aconfig.jsonexists in theDATA_DIR, it will be loaded into the db and the settings are added or resetted/updates to the values defined in ourconfig.json- which is perfect from the point of view of an IaC principle (see https://github.com/open-webui/open-webui/blob/main/backend/open_webui/config.py#L104-L108)workspace-models.jsoninto theDATA_DIRautomatically loads/updates these models into the db on startupuser-groups.jsoninto theDATA_DIRautomatically loads/updates the defined user groups into the db on startupworkspace-models.jsonAlternatives Considered
GROUPS_TO_CREATE=["IT", "Marketing", ...]psql(we are using PostgresDB), but these kind of scripts will easily break when changes are made on the tables we want to fillAdditional Context
@rgaricano commented on GitHub (Apr 3, 2025):
yes, this will do config more modular & reproducible,
another in the middle solution is have a preconfigurated database (a db copy after first configs), & then replace it at first start of new installations.