BUG Change of OpenAI connection doesn't stick after reboot #759

Closed
opened 2025-11-11 14:30:43 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @corticalstack on GitHub (Apr 29, 2024).

Bug Report

Description

Bug Summary:
Changed OpenAI API url/key from default https://api.openai.com/v1 to https://<external LiteLLM server>/v1.

On reboot of server, OpenAI API url/key reverted to api.openai.com

Environment

  • Open WebUI Version: v0.1.121
  • OS Ubuntu 22.04.3 LTS
  • Running as Docker container

Thanks

Originally created by @corticalstack on GitHub (Apr 29, 2024). # Bug Report ## Description **Bug Summary:** Changed OpenAI API url/key from default `https://api.openai.com/v1` to `https://<external LiteLLM server>/v1`. On reboot of server, OpenAI API url/key reverted to api.openai.com ## Environment - **Open WebUI Version:** v0.1.121 - **OS** Ubuntu 22.04.3 LTS - **Running as Docker container** Thanks
Author
Owner

@tjbck commented on GitHub (Apr 29, 2024):

Duplicate: #1022

@tjbck commented on GitHub (Apr 29, 2024): Duplicate: #1022
Author
Owner

@justinh-rahb commented on GitHub (Apr 29, 2024):

Adding this tutorial for persisting it with environment variables:
https://docs.openwebui.com/tutorial/openai

@justinh-rahb commented on GitHub (Apr 29, 2024): Adding this tutorial for persisting it with environment variables: https://docs.openwebui.com/tutorial/openai
Author
Owner

@corticalstack commented on GitHub (Apr 30, 2024):

That's awesome @justinh-rahb , can confirm works to stick openai connection after restart, setting openai api as follows in docker-compose for open-webui in Portainer, for external LiteLLM:

 environment:
      - OPENAI_API_BASE_URLS="http://<my ip>:4000/v1"
      - OPENAI_API_KEYS="sk-<my key>"

Thanks!

@corticalstack commented on GitHub (Apr 30, 2024): That's awesome @justinh-rahb , can confirm works to stick openai connection after restart, setting openai api as follows in docker-compose for open-webui in Portainer, for external LiteLLM: ``` environment: - OPENAI_API_BASE_URLS="http://<my ip>:4000/v1" - OPENAI_API_KEYS="sk-<my key>" ``` Thanks!
Author
Owner

@corticalstack commented on GitHub (May 1, 2024):

Incidentally @justinh-rahb , setting automatic1111 url/default model/image size also don't stick after reboot.

Might this also be solved by setting the appropriate environment variables? Would you know what those are?

Thanks!

@corticalstack commented on GitHub (May 1, 2024): Incidentally @justinh-rahb , setting automatic1111 url/default model/image size also don't stick after reboot. Might this also be solved by setting the appropriate environment variables? Would you know what those are? Thanks!
Author
Owner

@justinh-rahb commented on GitHub (May 1, 2024):

Incidentally @justinh-rahb , setting automatic1111 url/default model/image size also don't stick after reboot.

Might this also be solved by setting the appropriate environment variables? Would you know what those are?

Thanks!

These are all of the relevant envvars:

IMAGE_GENERATION_ENGINE=automatic1111|comfyui|openai
ENABLE_IMAGE_GENERATION=True|False
AUTOMATIC1111_BASE_URL=<your Automatic1111 URL>
COMFYUI_BASE_URL=<your ComfyUI URL>
IMAGES_OPENAI_API_BASE_URL=https://api.openai.com/v1
IMAGES_OPENAI_API_KEY=sk-1234
IMAGE_GENERATION_MODEL=dall-e-3|dall-e-2|sd-1.5|etc
IMAGE_SIZE=768x768
IMAGE_STEPS=50
@justinh-rahb commented on GitHub (May 1, 2024): > Incidentally @justinh-rahb , setting automatic1111 url/default model/image size also don't stick after reboot. > > Might this also be solved by setting the appropriate environment variables? Would you know what those are? > > Thanks! These are all of the relevant envvars: ```ini IMAGE_GENERATION_ENGINE=automatic1111|comfyui|openai ENABLE_IMAGE_GENERATION=True|False AUTOMATIC1111_BASE_URL=<your Automatic1111 URL> COMFYUI_BASE_URL=<your ComfyUI URL> IMAGES_OPENAI_API_BASE_URL=https://api.openai.com/v1 IMAGES_OPENAI_API_KEY=sk-1234 IMAGE_GENERATION_MODEL=dall-e-3|dall-e-2|sd-1.5|etc IMAGE_SIZE=768x768 IMAGE_STEPS=50 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#759