[GH-ISSUE #9259] Environment Variables #54103

Closed
opened 2026-05-05 15:46:51 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ghost on GitHub (Feb 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9259

Hi,

Is there an accepted or most appropriate way to set environment variables before launching open-webui? I finally tracked down where the env variables are being set, all the way in the package itself /venv/lib/python3.11/site-packages/open-webui/env.py.

It's fairly common that CLI programs have you specify port and addresses as environmental variables. However I struggle to understand why I have such a hard time configuring packages such as these in an environment. Even if we ignore the pysqlite3 thing - which I really find it inappropriate people are editing their main.py which makes updating a monkey patch - I still find it really difficult given the documentation. backend/config.py doesn't exist (presumably documentation from a different version?).

The back end code is modularly loading the config, which is totally understandable. But when the expectation is to alter package versions, I really hesitate to pursue the tool further.

As I work through my experience, I can track things that would make the setup easier for all users. I think for one, because there is a separation of ENV variables that START the program (address, OLLAMA_HOST, etc) and variables that control the UI itself, there should be a config.json that can be accessed before serving the first time. Implicit behavior depending on if it is first run or not seems to do more harm than good - when the expectation is already one where everyone is looking for some sort of config.json.

Is this something I can help with? Or is this stuff "assumed" in certain contexts? If so, I apologize for wasting a post.

Thanks.

Originally created by @ghost on GitHub (Feb 3, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/9259 Hi, Is there an accepted or most appropriate way to set environment variables before launching open-webui? I finally tracked down where the env variables are being set, all the way in the package itself /venv/lib/python3.11/site-packages/open-webui/env.py. It's fairly common that CLI programs have you specify port and addresses as environmental variables. However I struggle to understand why I have such a hard time configuring packages such as these in an environment. Even if we ignore the pysqlite3 thing - which I really find it inappropriate people are editing their main.py which makes updating a monkey patch - I still find it really difficult given the documentation. backend/config.py doesn't exist (presumably documentation from a different version?). The back end code is modularly loading the config, which is totally understandable. But when the expectation is to alter package versions, I really hesitate to pursue the tool further. As I work through my experience, I can track things that would make the setup easier for all users. I think for one, because there is a separation of ENV variables that START the program (address, OLLAMA_HOST, etc) and variables that control the UI itself, there should be a config.json that can be accessed before serving the first time. Implicit behavior depending on if it is first run or not seems to do more harm than good - when the expectation is already one where everyone is looking for some sort of config.json. Is this something I can help with? Or is this stuff "assumed" in certain contexts? If so, I apologize for wasting a post. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#54103