If you then set the "OPENAI_API_KEY" environment variable in Docker compose, it will not overwrite the existing config.json api_keys empty value "".
Steps to Reproduce:
Enter an OpenAI API Key in the webui save, then delete it. Enter OPENAI_API_KEY in docker compose environment variables restart the container, launch web ui and check "Settings -> Connections -> OpenAI API". The API key is blank and no OpenAI models have been loaded.
Expected Behavior:
For the environment variable to be ingested into the config by open-webui and overwrite whatever is currently configured in config.json.
Actual Behavior:
OpenAI API key is blank in the UI.
Environment
Open WebUI Version: v0.1.124
Ollama (if applicable): n/a
Operating System: Docker
Browser (if applicable): Firefox 124.0.1
Reproduction Details
Confirmation:
I have read and followed all the instructions provided in the README.md.
I am on the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
[n/a] I have included the Docker container logs.
Logs and Screenshots
Browser Console Logs:
see above
Docker Container Logs:
n/a
Screenshots (if applicable):
n/a
Installation Method
Docker
Additional Information
see above
Originally created by @nopoz on GitHub (May 15, 2024).
# Bug Report
## Description
If you've manually set the OpenAI API Key before and then erased it in the UI, the config.json looks like this:
```
{
"ollama": {
"base_urls": [
"http://ollama:11434"
]
},
"openai": {
"api_base_urls": [
"https://api.openai.com/v1"
],
"api_keys": [
""
]
}
}
```
If you then set the "OPENAI_API_KEY" environment variable in Docker compose, it will not overwrite the existing config.json api_keys empty value `""`.
**Steps to Reproduce:**
Enter an OpenAI API Key in the webui save, then delete it. Enter OPENAI_API_KEY in docker compose environment variables restart the container, launch web ui and check "Settings -> Connections -> OpenAI API". The API key is blank and no OpenAI models have been loaded.
Compose Example:
```
version: '3.3'
services:
ollama-webui:
container_name: ollama-webui
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- USE_CUDA_DOCKER=True
- PORT=${WEB_UI_PORT}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_API_BASE_URL=https://api.openai.com/v1
depends_on:
- ollama
volumes:
- "ollama-webui:/app/backend/data"
ports:
- ${WEB_UI_PORT}:${WEB_UI_PORT}
restart: unless-stopped
image: ghcr.io/open-webui/open-webui:git-db158fc-cuda
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
```
Verifying "OPENAI_API_KEY" env variable inside container:
```
$ docker exec -t -i ollama-webui /bin/bash
root@d8a96155eab8:/app/backend# env
OPENAI_API_KEY=<redacted>
```
The Browser Debug network request when loading the settings page:
request:
`https://<my host>/openai/api/keys`
response:
`{"OPENAI_API_KEYS":[""]}`
**Workaround:**
Manually edit out the OpenAI configuration from config.json and restart the container.
Example config.json:
```
{
"ollama": {
"base_urls": [
"http://ollama:11434"
]
}
}
```
**Expected Behavior:**
For the environment variable to be ingested into the config by open-webui and overwrite whatever is currently configured in config.json.
**Actual Behavior:**
OpenAI API key is blank in the UI.
## Environment
- **Open WebUI Version:** v0.1.124
- **Ollama (if applicable):** n/a
- **Operating System:** Docker
- **Browser (if applicable):** Firefox 124.0.1
## Reproduction Details
**Confirmation:**
- [X] I have read and followed all the instructions provided in the README.md.
- [X] I am on the latest version of both Open WebUI and Ollama.
- [X] I have included the browser console logs.
- [n/a] I have included the Docker container logs.
## Logs and Screenshots
**Browser Console Logs:**
see above
**Docker Container Logs:**
n/a
**Screenshots (if applicable):**
n/a
## Installation Method
Docker
## Additional Information
see above
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @nopoz on GitHub (May 15, 2024).
Bug Report
Description
If you've manually set the OpenAI API Key before and then erased it in the UI, the config.json looks like this:
If you then set the "OPENAI_API_KEY" environment variable in Docker compose, it will not overwrite the existing config.json api_keys empty value
"".Steps to Reproduce:
Enter an OpenAI API Key in the webui save, then delete it. Enter OPENAI_API_KEY in docker compose environment variables restart the container, launch web ui and check "Settings -> Connections -> OpenAI API". The API key is blank and no OpenAI models have been loaded.
Compose Example:
Verifying "OPENAI_API_KEY" env variable inside container:
The Browser Debug network request when loading the settings page:
request:
https://<my host>/openai/api/keysresponse:
{"OPENAI_API_KEYS":[""]}Workaround:
Manually edit out the OpenAI configuration from config.json and restart the container.
Example config.json:
Expected Behavior:
For the environment variable to be ingested into the config by open-webui and overwrite whatever is currently configured in config.json.
Actual Behavior:
OpenAI API key is blank in the UI.
Environment
Open WebUI Version: v0.1.124
Ollama (if applicable): n/a
Operating System: Docker
Browser (if applicable): Firefox 124.0.1
Reproduction Details
Confirmation:
Logs and Screenshots
Browser Console Logs:
see above
Docker Container Logs:
n/a
Screenshots (if applicable):
n/a
Installation Method
Docker
Additional Information
see above