Environment Variable Configuration
Overview
Open WebUI provides a large range of environment variables that allow you to customize and configure various aspects of the application. This page serves as a comprehensive reference for all available environment variables, providing their types, default values, and descriptions. As new variables are introduced, this page will be updated to reflect the growing configuration options.
This page is up-to-date with Open WebUI release version v0.8.5, but is still a work in progress to later include more accurate descriptions, listing out options available for environment variables, defaults, and improving descriptions.
Important Note on PersistentConfig Environment Variables
When launching Open WebUI for the first time, all environment variables are treated equally and can be used to configure the application. However, for environment variables marked as PersistentConfig, their values are persisted and stored internally.
After the initial launch, if you restart the container, PersistentConfig environment variables will no longer use the external environment variable values. Instead, they will use the internally stored values.
In contrast, regular environment variables will continue to be updated and applied on each subsequent restart.
You can update the values of PersistentConfig environment variables directly from within Open WebUI, and these changes will be stored internally. This allows you to manage these configuration settings independently of the external environment variables.
Please note that PersistentConfig environment variables are clearly marked as such in the documentation below, so you can be aware of how they will behave.
To disable this behavior and force Open WebUI to always use your environment variables (ignoring the database), set ENABLE_PERSISTENT_CONFIG to False.
CRITICAL WARNING: When ENABLE_PERSISTENT_CONFIG is False, you may still be able to edit settings in the Admin UI. However, these changes are NOT saved permanently. They will persist only for the current session and will be lost when you restart the container, as the system will revert to the values defined in your environment variables.
Troubleshooting Ignored Environment Variables 🛠️
If you change an environment variable (like ENABLE_SIGNUP=True) but don't see the change reflected in the UI (e.g., the "Sign Up" button is still missing), it's likely because a value has already been persisted in the database from a previous run or a persistent Docker volume.
Option 1: Using ENABLE_PERSISTENT_CONFIG (Temporary Fix)
Set ENABLE_PERSISTENT_CONFIG=False in your environment. This forces Open WebUI to read your variables directly. Note that UI-based settings changes will not persist across restarts in this mode.
Option 2: Update via Admin UI (Recommended)
The simplest and safest way to change PersistentConfig settings is directly through the Admin Panel within Open WebUI. Even if an environment variable is set, changes made in the UI will take precedence and be saved to the database.
Option 3: Manual Database Update (Last Resort / Lock-out Recovery)
If you are locked out or cannot access the UI, you can manually update the SQLite database via Docker:
docker exec -it open-webui sqlite3 /app/backend/data/webui.db "UPDATE config SET data = json_set(data, '$.ENABLE_SIGNUP', json('true'));"
(Replace ENABLE_SIGNUP and true with the specific setting and value needed.)
Option 4: Resetting for a Fresh Install
If you are performing a clean installation and want to ensure all environment variables are fresh:
- Stop the container.
- Remove the persistent volume:
docker volume rm open-webui. - Restart the container.
Warning: Removing the volume will delete all user data, including chats and accounts.
App/Backend
The following environment variables are used by backend/open_webui/config.py to provide Open WebUI startup
configuration. Please note that some variables may have different default values depending on
whether you're running Open WebUI directly or via Docker. For more information on logging
environment variables, see our logging documentation.
General
WEBUI_URL
- Type:
str - Default:
http://localhost:3000 - Description: Specifies the URL where your Open WebUI installation is reachable. Needed for search engine support and OAuth/SSO.
- Persistence: This environment variable is a
PersistentConfigvariable.
This variable has to be set before you start using OAuth/SSO for authentication. Since this is a persistent config environment variable, you can only change it through one of the following options:
- Temporarily disabling persistent config using
ENABLE_PERSISTENT_CONFIG - Changing
WEBUI_URLin the admin panel > settings and changing "WebUI URL".
Failure to set WEBUI_URL before using OAuth/SSO will result in failure to log in.
ENABLE_SIGNUP
- Type:
bool - Default:
True - Description: Toggles user account creation.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_SIGNUP_PASSWORD_CONFIRMATION
- Type:
bool - Default:
False - Description: If set to True, a "Confirm Password" field is added to the sign-up page to help users avoid typos when creating their password.
WEBUI_ADMIN_EMAIL
- Type:
str - Default: Empty string (' ')
- Description: Specifies the email address for an admin account to be created automatically on first startup when no users exist. This enables headless/automated deployments without manual account creation. When combined with
WEBUI_ADMIN_PASSWORD, the admin account is created during application startup, andENABLE_SIGNUPis automatically disabled to prevent unauthorized account creation.
This variable is designed for automated/containerized deployments where manual admin account creation is impractical. The admin account is only created if:
- No users exist in the database (fresh installation)
- Both
WEBUI_ADMIN_EMAILandWEBUI_ADMIN_PASSWORDare configured
After the admin account is created, sign-up is automatically disabled for security. You can re-enable it later via the Admin Panel if needed.
WEBUI_ADMIN_PASSWORD
- Type:
str - Default: Empty string (' ')
- Description: Specifies the password for the admin account to be created automatically on first startup when no users exist. Must be used in conjunction with
WEBUI_ADMIN_EMAIL. The password is securely hashed before storage using the same mechanism as manual account creation.
Security Considerations
- Use a strong, unique password for production deployments
- Consider using secrets management (Docker secrets, Kubernetes secrets, environment variable injection) rather than storing the password in plain text configuration files
- After initial setup, change the admin password through the UI for enhanced security
- Never commit this value to version control
WEBUI_ADMIN_NAME
- Type:
str - Default:
Admin - Description: Specifies the display name for the automatically created admin account. This is used when
WEBUI_ADMIN_EMAILandWEBUI_ADMIN_PASSWORDare configured for headless admin creation.
ENABLE_LOGIN_FORM
- Type:
bool - Default:
True - Description: Toggles email, password, sign-in and "or" (only when
ENABLE_OAUTH_SIGNUPis set to True) elements. - Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_PASSWORD_AUTH
- Type:
bool - Default:
True - Description: Allows both password and SSO authentication methods to coexist when set to True. When set to False, it disables all password-based login attempts on the /signin and /ldap endpoints, enforcing strict SSO-only authentication. Disable this setting in production environments with fully configured SSO to prevent credential-based account takeover attacks; keep it enabled if you require password authentication as a backup or have not yet completed SSO configuration. Should never be disabled if OAUTH/SSO is not being used.
This SHOULD be set to False if you only use SSO/OAUTH for Login and expose your Open WebUI publicly as to prevent password based logins.
This should only ever be set to False when ENABLE_OAUTH_SIGNUP
is also being used and set to True. Never disable this if OAUTH/SSO is not being used. Failure to do so will result in the inability to login.
DEFAULT_LOCALE
- Type:
str - Default:
en - Description: Sets the default locale for the application.
- Persistence: This environment variable is a
PersistentConfigvariable.
DEFAULT_MODELS
- Type:
str - Default: Empty string (' '), since
None. - Description: Sets a default Language Model.
- Persistence: This environment variable is a
PersistentConfigvariable.
DEFAULT_PINNED_MODELS
- Type:
str - Default: Empty string (' ')
- Description: Comma-separated list of model IDs to pin by default for new users who haven't customized their pinned models. This provides a pre-selected set of frequently used models in the model selector for new accounts.
- Example:
gpt-4,claude-3-opus,llama-3-70b - Persistence: This environment variable is a
PersistentConfigvariable.
DEFAULT_MODEL_METADATA
- Type:
dict(JSON object) - Default:
{} - Description: Sets global default metadata (capabilities and other model info) for all models. These defaults act as a baseline — per-model overrides always take precedence. For capabilities, the defaults and per-model values are merged (per-model wins on conflicts). For other metadata fields, the default is only applied if the model has no value set. Configurable via Admin Settings → Models.
- Persistence: This environment variable is a
PersistentConfigvariable. Stored at config keymodels.default_metadata.
DEFAULT_MODEL_PARAMS
- Type:
dict(JSON object) - Default:
{} - Description: Sets global default parameters (temperature, top_p, max_tokens, seed, etc.) for all models. These defaults are applied as a baseline at chat completion time — per-model parameter overrides always take precedence. Configurable via Admin Settings → Models.
- Persistence: This environment variable is a
PersistentConfigvariable. Stored at config keymodels.default_params.
DEFAULT_USER_ROLE
- Type:
str - Options:
pending- New users are pending until their accounts are manually activated by an admin.user- New users are automatically activated with regular user permissions.admin- New users are automatically activated with administrator permissions.
- Default:
pending - Description: Sets the default role assigned to new users.
- Persistence: This environment variable is a
PersistentConfigvariable.
DEFAULT_GROUP_ID
- Type:
str - Default: Empty string (' ')
- Description: Sets the default group ID to assign to new users upon registration.
- Persistence: This environment variable is a
PersistentConfigvariable.
DEFAULT_GROUP_SHARE_PERMISSION
- Type:
str - Options:
members,true,false - Default:
members - Description: Controls the default "Who can share to this group" setting for newly created groups.
membersmeans only group members can share to the group,truemeans anyone can share, andfalsemeans no one can share to the group. This applies both to groups created manually and groups created automatically (e.g. via SCIM or OAuth group sync). Existing groups are not affected — this only sets the initial default for new groups.
PENDING_USER_OVERLAY_TITLE
- Type:
str - Default: Empty string (' ')
- Description: Sets a custom title for the pending user overlay.
- Persistence: This environment variable is a
PersistentConfigvariable.
PENDING_USER_OVERLAY_CONTENT
- Type:
str - Default: Empty string (' ')
- Description: Sets a custom text content for the pending user overlay.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_CHANNELS
- Type:
bool - Default:
False - Description: Enables or disables channel support.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_FOLDERS
- Type:
bool - Default:
True - Description: Enables or disables the folders feature, allowing users to organize their chats into folders in the sidebar.
- Persistence: This environment variable is a
PersistentConfigvariable.
FOLDER_MAX_FILE_COUNT
- Type:
int - Default:
("") empty string - Description: Sets the maximum number of files processing allowed per folder.
- Persistence: This environment variable is a
PersistentConfigvariable. It can be configured in the Admin Panel > Settings > General > Folder Max File Count. Default is none (empty string) which is unlimited.
ENABLE_NOTES
- Type:
bool - Default:
True - Description: Enables or disables the notes feature, allowing users to create and manage personal notes within Open WebUI.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_MEMORIES
- Type:
bool - Default:
True - Description: Enables or disables the memory feature, allowing models to store and retrieve long-term information about users.
- Persistence: This environment variable is a
PersistentConfigvariable.
WEBHOOK_URL
- Type:
str - Description: Sets a webhook for integration with Discord/Slack/Microsoft Teams.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_ADMIN_EXPORT
- Type:
bool - Default:
True - Description: Controls whether admins can export data, chats and the database in the admin panel. Database exports only work for SQLite databases for now.
ENABLE_ADMIN_CHAT_ACCESS
- Type:
bool - Default:
True - Description: Enables admin users to directly access the chats of other users. When disabled, admins can no longer accesss user's chats in the admin panel. If you disable this, consider disabling
ENABLE_ADMIN_EXPORTtoo, if you are using SQLite, as the exports also contain user chats.
ENABLE_ADMIN_ANALYTICS
- Type:
bool - Default:
True - Description: Controls whether the Analytics tab is visible and accessible in the admin panel. When set to
False, the analytics API router is not mounted and the tab is hidden from the admin navigation. Useful for deployments where analytics data collection or display is not desired. Requires a restart to take effect.
BYPASS_ADMIN_ACCESS_CONTROL
- Type:
bool - Default:
True - Description: When disabled, admin users are treated like regular users for workspace access (models, knowledge, prompts, tools, and notes) and only see items they have explicit permission to access through the existing access control system. This also applies to the visibility of models in the model selector - admins will be treated as regular users: base models and custom models they do not have explicit permission to access, will be hidden. If set to
True(Default), admins have access to all created items in the workspace area (including other users' notes) and all models in the model selector, regardless of access permissions. This environment variable deprecatesENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS. If you are still usingENABLE_ADMIN_WORKSPACE_CONTENT_ACCESSyou should switch toBYPASS_ADMIN_ACCESS_CONTROL.
ENABLE_USER_WEBHOOKS
- Type:
bool - Default:
True - Description: Enables or disables user webhooks.
- Persistence: This environment variable is a
PersistentConfigvariable.
RESPONSE_WATERMARK
- Type:
str - Default: Empty string (' ')
- Description: Sets a custom text that will be included when you copy a message in the chat. e.g.,
"This text is AI generated"-> will add "This text is AI generated" to every message, when copied. - Persistence: This environment variable is a
PersistentConfigvariable.
THREAD_POOL_SIZE
- Type:
int - Default:
0 - Description: Sets the thread pool size for FastAPI/AnyIO blocking calls. By default (when set to
0) FastAPI/AnyIO use40threads. In case of large instances and many concurrent users, it may be needed to increaseTHREAD_POOL_SIZEto prevent blocking.
If you are running larger instances, you WILL NEED to set this to a higher value like multiple hundreds if not thousands (e.g. 1000) otherwise your app may get stuck the default pool size (which is 40 threads) is full and will not react anymore.
ENABLE_CUSTOM_MODEL_FALLBACK
- Type:
bool - Default:
False - Description: Controls whether custom models should fall back to a default model if their assigned base model is missing. When set to
True, if a custom model's base model is not found, the system will use the first model from the configuredDEFAULT_MODELSlist instead of returning an error.
SHOW_ADMIN_DETAILS
- Type:
bool - Default:
True - Description: Toggles whether to show admin user details in the interface.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_PUBLIC_ACTIVE_USERS_COUNT
- Type:
bool - Default:
True - Description: Controls whether the active user count is visible to all users or restricted to administrators only. When set to
False, only admin users can see how many users are currently active, reducing backend load and addressing privacy concerns in large deployments. - Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_USER_STATUS
- Type:
bool - Default:
True - Description: Globally enables or disables user status functionality. When disabled, the status UI (including blinking active/away indicators and status messages) is hidden across the application, and user status API endpoints are restricted.
- Persistence: This environment variable is a
PersistentConfigvariable. It can be toggled in the Admin Panel > Settings > General > User Status.
ENABLE_EASTER_EGGS
- Type:
bool - Default:
True - Description: Enables or disables easter egg features in the UI, such as special themes (e.g., the "Her" theme option in the theme selector). Set to
Falseto hide these optional novelty features from users.
ADMIN_EMAIL
- Type:
str - Description: Sets the admin email shown by
SHOW_ADMIN_DETAILS - Persistence: This environment variable is a
PersistentConfigvariable.
ENV
- Type:
str - Options:
dev- Enables the FastAPI API documentation on/docsprod- Automatically configures several environment variables
- Default:
- Backend Default:
dev - Docker Default:
prod
- Backend Default:
- Description: Environment setting.
ENABLE_PERSISTENT_CONFIG
- Type:
bool - Default:
True - Description: Controls whether the system prioritizes configuration saved in the database over environment variables.
True(Default): Values saved in the database (via the Admin UI) take precedence. If a value is set in the UI, the environment variable is ignored for that setting.False: Environment variables take precedence. The system will not load configuration from the database at startup if an environment variable is present (or it will use the default).- CRITICAL WARNING: When set to
False, you can still seemingly "change" settings in the Admin UI. These changes will apply to the current running session but will be lost upon restart. The system will revert to the values defined in your environment variables (or defaults) every time it boots up. - Use Case: Set this to
Falseif you want to strictly manage configuration via adocker-compose.yamlor.envfile and prevent UI changes from persisting across restarts.
- CRITICAL WARNING: When set to
CUSTOM_NAME
- Type:
str - Description: Sets
WEBUI_NAMEbut polls api.openwebui.com for metadata.
WEBUI_NAME
- Type:
str - Default:
Open WebUI - Description: Sets the main WebUI name. Appends
(Open WebUI)if overridden.
PORT
- Type:
int - Default:
8080 - Description: Sets the port to run Open WebUI from.
If you're running the application via Python and using the open-webui serve command, you cannot set the port using the PORT configuration. Instead, you must specify it directly as a command-line argument using the --port flag. For example:
open-webui serve --port 9999
This will run the Open WebUI on port 9999. The PORT environment variable is disregarded in this mode.
ENABLE_REALTIME_CHAT_SAVE
- Type:
bool - Default:
False - Description: When enabled, the system saves each individual chunk of streamed chat data to the database in real time.
It is strongly recommended to NEVER enable this setting in production or multi-user environments.
Enabling ENABLE_REALTIME_CHAT_SAVE causes every single token generated by the LLM to trigger a separate database write operation. In a multi-user environment, this will:
- Exhaust Database Connection Pools: Rapid-fire writes will quickly consume all available database connections, leading to "QueuePool limit reached" errors and application-wide freezes.
- Severe Performance Impact: The overhead of thousands of database transactions per minute will cause massive latency for all users.
- Hardware Strain: It creates immense I/O pressure on your storage system.
Keep this set to False (the default). Chats are still saved automatically once generation is complete. This setting is only intended for extreme debugging scenarios or single-user environments where sub-second persistence of every token is more important than stability.
ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION
- Type:
bool - Default:
False - Description: When set to true, it automatically uploads base64-encoded images exceeding 1KB in markdown and converts them into image file URLs to reduce the size of response text. Some multimodal models directly output images as Base64 strings within the Markdown content. This results in larger response bodies, placing strain on CPU, network, Redis, and database resources.
CHAT_RESPONSE_STREAM_DELTA_CHUNK_SIZE
- Type:
int - Default:
1 - Description: Sets a system-wide minimum value for the number of tokens to batch together before sending them to the client during a streaming response. This allows an administrator to enforce a baseline level of performance and stability across the entire system by preventing excessively small chunk sizes that can cause high CPU load. The final chunk size used for a response will be the highest value set among this global variable, the model's advanced parameters, or the per-chat settings. The default is 1, which applies no minimum batching at the global level.
CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE
- Type:
int - Default: Empty string (' '), which disables the limit (equivalent to None)
- Description: Sets the maximum buffer size in bytes for handling stream response chunks. When a single chunk exceeds this limit, the system returns an empty JSON object and skips subsequent oversized data until encountering normally-sized chunks. This prevents memory issues when dealing with extremely large responses from certain providers (e.g., models like gemini-2.5-flash-image or services returning extensive web search data exceeding). Set to an empty string or a negative value to disable chunk size limitations entirely. Recommended values are 16-20 MB (
16777216) or larger depending on the image size of the image generation model (4K images may need even more).
It is recommended to set this to a high single-digit or low double-digit value if you run Open WebUI with high concurrency, many users, and very fast streaming models.
ENABLE_RESPONSES_API_STATEFUL
- Type:
bool - Default:
False - Description: Enables stateful session handling for the Responses API by forwarding
previous_response_idto the upstream endpoint. When enabled, Open WebUI anchors each response to the previous one, allowing the upstream provider to maintain conversation state server-side.
Only enable this if your upstream Responses API endpoint supports stateful sessions (i.e., server-side response storage with previous_response_id anchoring). Most proxies and third-party endpoints are stateless and will break if this is enabled. This is intended for direct connections to providers like OpenAI that natively support the Responses API with session state.
BYPASS_MODEL_ACCESS_CONTROL
- Type:
bool - Default:
False - Description: Bypasses model access control. When set to
true, all users (and admins alike) will have access to all models, regardless of the model's privacy setting (Private, Public, Shared with certain groups). This is useful for smaller or individual Open WebUI installations where model access restrictions may not be needed.
WEBUI_BUILD_HASH
- Type:
str - Default:
dev-build - Description: Used for identifying the Git SHA of the build for releases.
WEBUI_BANNERS
- Type:
listofdict - Default:
[] - Description: List of banners to show to users. The format for banners are:
[{"id": "string", "type": "string [info, success, warning, error]", "title": "string", "content": "string", "dismissible": false, "timestamp": 1000}]
- Persistence: This environment variable is a
PersistentConfigvariable.
When setting this environment variable in a .env file, make sure to escape the quotes by wrapping the entire value in double quotes and using escaped quotes (\") for the inner quotes. Example:
WEBUI_BANNERS="[{\"id\": \"1\", \"type\": \"warning\", \"title\": \"Your messages are stored.\", \"content\": \"Your messages are stored and may be reviewed by human people. LLM's are prone to hallucinations, check sources.\", \"dismissible\": true, \"timestamp\": 1000}]"
USE_CUDA_DOCKER
- Type:
bool - Default:
False - Description: Builds the Docker image with NVIDIA CUDA support. Enables GPU acceleration for local Whisper and embeddings.
DOCKER
- Type:
bool - Default:
False - Description: Indicates whether Open WebUI is running inside a Docker container. Used internally for environment detection.
USE_CUDA
- Type:
bool - Default:
False - Description: Controls whether to use CUDA acceleration for local models. When set to
true, attempts to detect and use available NVIDIA GPUs. The code reads the environment variableUSE_CUDA_DOCKERto set this internal boolean variable.
DEVICE_TYPE
- Type:
str - Default:
cpu - Description: Specifies the device type for model execution. Automatically set to
cudaif CUDA is available and enabled, ormpsfor Apple Silicon.
EXTERNAL_PWA_MANIFEST_URL
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: When defined as a fully qualified URL (e.g., https://path/to/manifest.webmanifest), requests sent to /manifest.json will use the external manifest file. When not defined, the default manifest.json file will be used.
ENABLE_TITLE_GENERATION
- Type:
bool - Default:
True - Description: Enables or disables chat title generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
LICENSE_KEY
- Type:
str - Default:
None - Description: Specifies the license key to use (for Enterprise users only).
- Persistence: This environment variable is a
PersistentConfigvariable.
SSL_ASSERT_FINGERPRINT
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the SSL assert fingerprint to use.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_COMPRESSION_MIDDLEWARE
- Type:
bool - Default:
True - Description: Enables gzip compression middleware for HTTP responses, reducing bandwidth usage and improving load times.
DEFAULT_PROMPT_SUGGESTIONS
- Type:
listofdict - Default:
[](which means to use the built-in default prompt suggestions) - Description: Sets global default prompt suggestions shown to users when starting a new chat. These apply when no model-specific prompt suggestions are configured. Prompt suggestions can also be configured per-model via the Model Editor (see Prompt Suggestions), or globally for all models using the Global Model Defaults feature. The format is:
[{"title": ["Title part 1", "Title part 2"], "content": "prompt"}]
AIOHTTP Client
AIOHTTP_CLIENT_TIMEOUT
- Type:
int - Default:
300 - Description: Specifies the timeout duration in seconds for the AIOHTTP client. This impacts things such as connections to Ollama and OpenAI endpoints.
This is the maximum amount of time the client will wait for a response before timing out.
If set to an empty string (' '), the timeout will be set to None, effectively disabling the timeout and
allowing the client to wait indefinitely.
AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST
- Type:
int - Default:
10 - Description: Sets the timeout in seconds for fetching the model list from Ollama and OpenAI endpoints. This affects how long Open WebUI waits for each configured endpoint when loading available models.
Lower the timeout (e.g., 3) if:
- You have multiple endpoints configured and want faster failover when one is unreachable
- You prefer the UI to load quickly even if some slow endpoints are skipped
Increase the timeout (e.g., 30) if:
- Your model servers are slow to respond (e.g., cold starts, large model loading)
- You're connecting over high-latency networks
- You're using providers like OpenRouter that may have variable response times
Connection URLs configured via the Admin Settings UI are persisted in the database and take precedence over environment variables. If you save an unreachable URL and the UI becomes unresponsive, you may need to use one of these recovery options:
RESET_CONFIG_ON_START=true- Resets database config to environment variable values on next startupENABLE_PERSISTENT_CONFIG=false- Always use environment variables (UI changes won't persist)
See the Model List Loading Issues troubleshooting guide for detailed recovery steps.
AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST
- Type:
int - Description: Sets the timeout in seconds for fetching the model list. This can be useful in cases where network latency requires a longer timeout duration to successfully retrieve the model list.
AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER
- Type:
int - Default: Inherits
AIOHTTP_CLIENT_TIMEOUTwhen unset - Description: Sets the timeout in seconds for executing tool server API calls (OpenAPI/MCP proxy calls made by Open WebUI). Use this to control how long Open WebUI waits for actual tool execution responses.
If this variable is unset or invalid, Open WebUI falls back to AIOHTTP_CLIENT_TIMEOUT.
AIOHTTP_CLIENT_SESSION_SSL
- Type:
bool - Default:
True - Description: Controls SSL/TLS verification for AIOHTTP client sessions when connecting to external APIs (e.g., Ollama Embeddings).
AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER_DATA
- Type:
int - Default:
10 - Description: Sets the timeout in seconds for retrieving tool server metadata/configuration (for example, loading server data/spec information).
AIOHTTP_CLIENT_SESSION_TOOL_SERVER_SSL
- Type:
bool - Default:
True - Description: Controls SSL/TLS verification specifically for tool server connections via AIOHTTP client.
REQUESTS_VERIFY
- Type:
bool - Default:
True - Description: Controls SSL/TLS verification for synchronous
requests(e.g., Tika, External Reranker). Set toFalseto bypass certificate verification for self-signed certificates.
Directories
DATA_DIR
- Type:
str - Default:
./data - Description: Specifies the base directory for data storage, including uploads, cache, vector database, etc.
FONTS_DIR
- Type:
str - Description: Specifies the directory for fonts.
FRONTEND_BUILD_DIR
- Type:
str - Default:
../build - Description: Specifies the location of the built frontend files.
STATIC_DIR
- Type:
str - Default:
./static - Description: Specifies the directory for static files, such as the favicon.
Logging
GLOBAL_LOG_LEVEL
- Type:
str - Default:
INFO - Description: Sets the global logging level for all Open WebUI components. Valid values:
DEBUG,INFO,WARNING,ERROR,CRITICAL.
LOG_FORMAT
- Type:
str - Default: Not set (plain-text logging)
- Description: Controls the log output format. Set to
jsonto switch all stdout logging to single-line JSON objects, suitable for log aggregators like Loki, Fluentd, CloudWatch, and Datadog. When set tojson, the ASCII startup banner is also suppressed to keep the log stream parseable. Any other value (or unset) uses the default plain-text format. See the JSON Logging documentation for details on log fields and examples.
ENABLE_AUDIT_STDOUT
- Type:
bool - Default:
False - Description: Controls whether audit logs are output to stdout (console). Useful for containerized environments where logs are collected from stdout.
ENABLE_AUDIT_LOGS_FILE
- Type:
bool - Default:
True - Description: Controls whether audit logs are written to a file. When enabled, logs are written to the location specified by
AUDIT_LOGS_FILE_PATH.
AUDIT_LOGS_FILE_PATH
- Type:
str - Default:
${DATA_DIR}/audit.log - Description: Configures where the audit log file is stored. Enables storing logs in separate volumes or custom locations for better organization and persistence.
- Example:
/var/log/openwebui/audit.log,/mnt/logs/audit.log
AUDIT_LOG_FILE_ROTATION_SIZE
- Type:
str - Default:
10MB - Description: Specifies the maximum size of the audit log file before rotation occurs (e.g.,
10MB,100MB,1GB).
AUDIT_UVICORN_LOGGER_NAMES
- Type:
str - Default:
uvicorn.access - Description: Comma-separated list of logger names to capture for audit logging. Defaults to Uvicorn's access logger.
AUDIT_LOG_LEVEL
- Type:
str - Default:
NONE - Options:
NONE,METADATA,REQUEST,REQUEST_RESPONSE - Description: Controls the verbosity level of audit logging.
METADATAlogs basic request info,REQUESTincludes request bodies,REQUEST_RESPONSEincludes both requests and responses.
MAX_BODY_LOG_SIZE
- Type:
int - Default:
2048 - Description: Sets the maximum size in bytes for request/response bodies in audit logs. Bodies larger than this are truncated.
AUDIT_EXCLUDED_PATHS
- Type:
str - Default:
/chats,/chat,/folders - Description: Comma-separated list of URL paths to exclude from audit logging (blacklist mode). Paths are matched without leading slashes against
/api/and/api/v1/prefixed routes. Ignored whenAUDIT_INCLUDED_PATHSis set.
AUDIT_INCLUDED_PATHS
- Type:
str - Default: Empty string (disabled)
- Description: Comma-separated list of URL paths to include in audit logging (whitelist mode). When set, only matching paths are audited and
AUDIT_EXCLUDED_PATHSis ignored. Paths are matched without leading slashes against/api/and/api/v1/prefixed routes. Auth endpoints (signin, signout, signup) are always logged regardless of filtering mode.
By default, audit logging uses blacklist mode — all paths are logged except those in AUDIT_EXCLUDED_PATHS. If you set AUDIT_INCLUDED_PATHS, it switches to whitelist mode — only the specified paths are logged. If both are set, whitelist mode takes precedence and a warning is logged at startup.
Ollama
ENABLE_OLLAMA_API
- Type:
bool - Default:
True - Description: Enables the use of Ollama APIs.
- Persistence: This environment variable is a
PersistentConfigvariable.
OLLAMA_BASE_URL (OLLAMA_API_BASE_URL is deprecated)
- Type:
str - Default:
http://localhost:11434 - Docker Default:
- If
K8S_FLAGis set:http://ollama-service.open-webui.svc.cluster.local:11434 - If
USE_OLLAMA_DOCKER=True:http://localhost:11434 - Else
http://host.docker.internal:11434
- If
- Description: Configures the Ollama backend URL.
OLLAMA_BASE_URLS
- Type:
str - Description: Configures load-balanced Ollama backend hosts, separated by
;. SeeOLLAMA_BASE_URL. Takes precedence overOLLAMA_BASE_URL. - Example:
http://host-one:11434;http://host-two:11434 - Persistence: This environment variable is a
PersistentConfigvariable.
USE_OLLAMA_DOCKER
- Type:
bool - Default:
False - Description: Builds the Docker image with a bundled Ollama instance.
K8S_FLAG
- Type:
bool - Default:
False - Description: If set, assumes Helm chart deployment and sets
OLLAMA_BASE_URLtohttp://ollama-service.open-webui.svc.cluster.local:11434
OpenAI
ENABLE_OPENAI_API
- Type:
bool - Default:
True - Description: Enables the use of OpenAI APIs.
- Persistence: This environment variable is a
PersistentConfigvariable.
OPENAI_API_BASE_URL
- Type:
str - Default:
https://api.openai.com/v1 - Description: Configures the OpenAI base API URL.
- Persistence: This environment variable is a
PersistentConfigvariable.
OPENAI_API_BASE_URLS
- Type:
str - Description: Supports balanced OpenAI base API URLs, semicolon-separated.
- Example:
http://host-one:11434;http://host-two:11434 - Persistence: This environment variable is a
PersistentConfigvariable.
OPENAI_API_KEY
- Type:
str - Description: Sets the OpenAI API key.
- Example:
sk-124781258123 - Persistence: This environment variable is a
PersistentConfigvariable.
OPENAI_API_KEYS
- Type:
str - Description: Supports multiple OpenAI API keys, semicolon-separated.
- Example:
sk-124781258123;sk-4389759834759834 - Persistence: This environment variable is a
PersistentConfigvariable.
Tasks
TASK_MODEL
- Type:
str - Description: The default model to use for tasks such as title and web search query generation when using Ollama models.
- Persistence: This environment variable is a
PersistentConfigvariable.
TASK_MODEL_EXTERNAL
- Type:
str - Description: The default model to use for tasks such as title and web search query generation when using OpenAI-compatible endpoints.
- Persistence: This environment variable is a
PersistentConfigvariable.
TITLE_GENERATION_PROMPT_TEMPLATE
- Type:
str - Description: Prompt to use when generating chat titles.
- Default: The value of
DEFAULT_TITLE_GENERATION_PROMPT_TEMPLATEenvironment variable.
DEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE:
### Task:
Generate a concise, 3-5 word title with an emoji summarizing the chat history.
### Guidelines:
- The title should clearly represent the main theme or subject of the conversation.
- Use emojis that enhance understanding of the topic, but avoid quotation marks or special formatting.
- Write the title in the chat's primary language; default to English if multilingual.
- Prioritize accuracy over excessive creativity; keep it clear and simple.
### Output:
JSON format: { "title": "your concise title here" }
### Examples:
- { "title": "📉 Stock Market Trends" },
- { "title": "🍪 Perfect Chocolate Chip Recipe" },
- { "title": "Evolution of Music Streaming" },
- { "title": "Remote Work Productivity Tips" },
- { "title": "Artificial Intelligence in Healthcare" },
- { "title": "🎮 Video Game Development Insights" }
### Chat History:
<chat_history>
{{MESSAGES:END:2}}
</chat_history>
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_FOLLOW_UP_GENERATION
- Type:
bool - Default:
True - Description: Enables or disables follow up generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
FOLLOW_UP_GENERATION_PROMPT_TEMPLATE
- Type:
str - Description: Prompt to use for generating several relevant follow-up questions.
- Default: The value of
DEFAULT_FOLLOW_UP_GENERATION_PROMPT_TEMPLATEenvironment variable.
DEFAULT_FOLLOW_UP_GENERATION_PROMPT_TEMPLATE:
### Task:
Suggest 3-5 relevant follow-up questions or prompts that the user might naturally ask next in this conversation as a **user**, based on the chat history, to help continue or deepen the discussion.
### Guidelines:
- Write all follow-up questions from the user’s point of view, directed to the assistant.
- Make questions concise, clear, and directly related to the discussed topic(s).
- Only suggest follow-ups that make sense given the chat content and do not repeat what was already covered.
- If the conversation is very short or not specific, suggest more general (but relevant) follow-ups the user might ask.
- Use the conversation's primary language; default to English if multilingual.
- Response must be a JSON array of strings, no extra text or formatting.
### Output:
JSON format: { "follow_ups": ["Question 1?", "Question 2?", "Question 3?"] }
### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>"
- Persistence: This environment variable is a
PersistentConfigvariable.
TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE
- Type:
str - Description: Prompt to use when calling tools.
- Default: The value of
DEFAULT_TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATEenvironment variable.
DEFAULT_TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE:
Available Tools: {{TOOLS}}
Your task is to choose and return the correct tool(s) from the list of available tools based on the query. Follow these guidelines:
- Return only the JSON object, without any additional text or explanation.
- If no tools match the query, return an empty array:
{
"tool_calls": []
}
- If one or more tools match the query, construct a JSON response containing a "tool_calls" array with objects that include:
- "name": The tool's name.
- "parameters": A dictionary of required parameters and their corresponding values.
The format for the JSON response is strictly:
{
"tool_calls": [
{"name": "toolName1", "parameters": {"key1": "value1"}},
{"name": "toolName2", "parameters": {"key2": "value2"}}
]
}
- Persistence: This environment variable is a
PersistentConfigvariable.
Code Execution
ENABLE_CODE_EXECUTION
- Type:
bool - Default:
True - Description: Enables or disables code execution.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_EXECUTION_ENGINE
- Type:
str - Default:
pyodide - Description: Specifies the code execution engine to use.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_EXECUTION_JUPYTER_URL
- Type:
str - Default:
None - Description: Specifies the Jupyter URL to use for code execution.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_EXECUTION_JUPYTER_AUTH
- Type:
str - Default:
None - Description: Specifies the Jupyter authentication method to use for code execution.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_EXECUTION_JUPYTER_AUTH_TOKEN
- Type:
str - Default:
None - Description: Specifies the Jupyter authentication token to use for code execution.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_EXECUTION_JUPYTER_AUTH_PASSWORD
- Type:
str - Default:
None - Description: Specifies the Jupyter authentication password to use for code execution.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_EXECUTION_JUPYTER_TIMEOUT
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the timeout for Jupyter code execution.
- Persistence: This environment variable is a
PersistentConfigvariable.
Code Interpreter
ENABLE_CODE_INTERPRETER
- Type:
bool - Default:
True - Description: Enables or disables code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_ENGINE
- Type:
str - Default:
pyodide - Description: Specifies the code interpreter engine to use.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_BLACKLISTED_MODULES
- Type:
str(comma-separated list of module names) - Default: None
- Description: Specifies a comma-separated list of Python modules that are blacklisted and cannot be imported or used within the code interpreter. This enhances security by preventing access to potentially sensitive or system-level functionalities.
CODE_INTERPRETER_PROMPT_TEMPLATE
- Type:
str - Default:
None - Description: Specifies the prompt template to use for code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_JUPYTER_URL
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the Jupyter URL to use for code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_JUPYTER_AUTH
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the Jupyter authentication method to use for code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_JUPYTER_AUTH_TOKEN
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the Jupyter authentication token to use for code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the Jupyter authentication password to use for code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
CODE_INTERPRETER_JUPYTER_TIMEOUT
- Type:
str - Default: Empty string (' '), since
Noneis set as default. - Description: Specifies the timeout for the Jupyter code interpreter.
- Persistence: This environment variable is a
PersistentConfigvariable.
Direct Connections (OpenAPI/MCPO Tool Servers)
ENABLE_DIRECT_CONNECTIONS
- Type:
bool - Default:
True - Description: Enables or disables direct connections.
- Persistence: This environment variable is a
PersistentConfigvariable.
TOOL_SERVER_CONNECTIONS
- Type:
str(JSON array) - Default:
[] - Description: Specifies a JSON array of tool server connection configurations. Each connection should define the necessary parameters to connect to external tool servers that implement the OpenAPI/MCPO protocol. The JSON must be properly formatted or it will fallback to an empty array.
- Example:
[
{
"type": "openapi",
"url": "example-url",
"spec_type": "url",
"spec": "",
"path": "openapi.json",
"auth_type": "none",
"key": "",
"config": { "enable": true },
"info": {
"id": "",
"name": "example-server",
"description": "MCP server description."
}
}
]
- Persistence: This environment variable is a
PersistentConfigvariable.
The JSON data structure of TOOL_SERVER_CONNECTIONS might evolve over time as new features are added.
Terminal Server
TERMINAL_SERVER_CONNECTIONS
- Type:
str(JSON array) - Default:
[] - Description: Specifies a JSON array of Open Terminal server connection configurations. Each connection defines the parameters needed to connect to an Open Terminal instance. Unlike user-level tool server connections, these are admin-configured and proxied through Open WebUI, which means the terminal URL and API key are never exposed to the browser. Supports group-based access control via
access_grants. - Example:
[
{
"id": "unique-id",
"url": "http://open-terminal:8000",
"key": "your-api-key",
"name": "Dev Terminal",
"auth_type": "bearer",
"config": {
"access_grants": []
}
}
]
- Persistence: This environment variable is a
PersistentConfigvariable.
The JSON data structure of TERMINAL_SERVER_CONNECTIONS might evolve over time as new features are added.
Autocomplete
ENABLE_AUTOCOMPLETE_GENERATION
- Type:
bool - Default:
True - Description: Enables or disables autocomplete generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
When enabling ENABLE_AUTOCOMPLETE_GENERATION, ensure that you also configure AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH and AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE accordingly.
AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH
- Type:
int - Default:
-1 - Description: Sets the maximum input length for autocomplete generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE
- Type:
str - Default: The value of the
DEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATEenvironment variable.
DEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE:
### Task:
You are an autocompletion system. Continue the text in `<text>` based on the **completion type** in `<type>` and the given language.
### **Instructions**:
1. Analyze `<text>` for context and meaning.
2. Use `<type>` to guide your output:
- **General**: Provide a natural, concise continuation.
- **Search Query**: Complete as if generating a realistic search query.
3. Start as if you are directly continuing `<text>`. Do **not** repeat, paraphrase, or respond as a model. Simply complete the text.
4. Ensure the continuation:
- Flows naturally from `<text>`.
- Avoids repetition, overexplaining, or unrelated ideas.
5. If unsure, return: `{ "text": "" }`.
### **Output Rules**:
- Respond only in JSON format: `{ "text": "<your_completion>" }`.
### **Examples**:
#### Example 1:
Input:
<type>General</type>
<text>The sun was setting over the horizon, painting the sky</text>
Output:
{ "text": "with vibrant shades of orange and pink." }
#### Example 2:
Input:
<type>Search Query</type>
<text>Top-rated restaurants in</text>
Output:
{ "text": "New York City for Italian cuisine." }
---
### Context:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
<type>{{TYPE}}</type>
<text>{{PROMPT}}</text>
#### Output:
- Description: Sets the prompt template for autocomplete generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
Evaluation Arena Model
ENABLE_EVALUATION_ARENA_MODELS
- Type:
bool - Default:
True - Description: Enables or disables evaluation arena models.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_MESSAGE_RATING
- Type:
bool - Default:
True - Description: Enables message rating feature.
- Persistence: This environment variable is a
PersistentConfigvariable.
ENABLE_COMMUNITY_SHARING
- Type:
bool - Default:
True - Description: Controls whether users can share content with the Open WebUI Community and access community resources. When enabled, this setting shows the following UI elements across the application:
- Prompts Workspace: "Made by Open WebUI Community" section with a link to discover community prompts, and a "Share" button in the prompt menu dropdown
- Tools Workspace: "Made by Open WebUI Community" section with a link to discover community tools, and a "Share" button in the tool menu dropdown
- Models Workspace: "Made by Open WebUI Community" section with a link to discover community model presets, and a "Share" button in the model menu dropdown
- Functions Admin: "Made by Open WebUI Community" section with a link to discover community functions
- Share Chat Modal: "Share to Open WebUI Community" button when sharing a chat conversation
- Evaluation Feedbacks: "Share to Open WebUI Community" button for contributing feedback history to the community leaderboard
- Stats Sync Modal: Enables syncing usage statistics with the community
- Persistence: This environment variable is a
PersistentConfigvariable.
When ENABLE_COMMUNITY_SHARING is set to False, all community sharing buttons and community resource discovery sections will be hidden from the UI. Users will still be able to export content locally, but the option to share directly to the Open WebUI Community will not be available.
Tags Generation
ENABLE_TAGS_GENERATION
- Type:
bool - Default:
True - Description: Enables or disables tag generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
TAGS_GENERATION_PROMPT_TEMPLATE
- Type:
str - Default: The value of
DEFAULT_TAGS_GENERATION_PROMPT_TEMPLATEenvironment variable.
DEFAULT_TAGS_GENERATION_PROMPT_TEMPLATE:
### Task:
Generate 1-3 broad tags categorizing the main themes of the chat history, along with 1-3 more specific subtopic tags.
### Guidelines:
- Start with high-level domains (e.g., Science, Technology, Philosophy, Arts, Politics, Business, Health, Sports, Entertainment, Education)
- Consider including relevant subfields/subdomains if they are strongly represented throughout the conversation
- If content is too short (less than 3 messages) or too diverse, use only ["General"]
- Use the chat's primary language; default to English if multilingual
- Prioritize accuracy over specificity
### Output:
JSON format: { "tags": ["tag1", "tag2", "tag3"] }
### Chat History:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
- Description: Sets the prompt template for tag generation.
- Persistence: This environment variable is a
PersistentConfigvariable.
API Key Endpoint Restrictions
ENABLE_API_KEYS
- Type:
bool - Default:
False - Description: Enables the API key creation feature, allowing users to generate API keys for programmatic access to Open WebUI.
- Persistence: This environment variable is a
PersistentConfigvariable.
This variable replaces the deprecated ENABLE_API_KEY environment variable.
For API Key creation (and the API keys themselves) to work:
- Enable API keys globally using this setting (
ENABLE_API_KEYS) - For non-admin users, grant the "API Keys" permission via Default Permissions or User Groups
Note: Administrators can generate API keys whenever ENABLE_API_KEYS is enabled, even without features.api_keys. See the Authentication Setup for API Key guide for detailed setup instructions.
ENABLE_API_KEYS_ENDPOINT_RESTRICTIONS
- Type:
bool - Default:
False - Description: Enables API key endpoint restrictions for added security and configurability, allowing administrators to limit which endpoints can be accessed using API keys.
- Persistence: This environment variable is a
PersistentConfigvariable.
This variable replaces the deprecated ENABLE_API_KEY_ENDPOINT_RESTRICTIONS environment variable.
API_KEYS_ALLOWED_ENDPOINTS
- Type:
str - Description: Specifies a comma-separated list of allowed API endpoints when API key endpoint restrictions are enabled.
- Example:
/api/v1/messages,/api/v1/channels,/api/v1/chat/completions - Persistence: This environment variable is a
PersistentConfigvariable.
The value of API_KEYS_ALLOWED_ENDPOINTS should be a comma-separated list of endpoint URLs, such as /api/v1/messages, /api/v1/channels.
This variable replaces the deprecated API_KEY_ALLOWED_ENDPOINTS environment variable.
Model Caching
ENABLE_BASE_MODELS_CACHE
- Type:
bool - Default:
False - Description: When enabled, caches the list of base models from connected Ollama and OpenAI-compatible endpoints in memory. This reduces the number of API calls made to external model providers when loading the model selector, improving performance particularly for deployments with many users or slow connections to model endpoints. Can also be configured from Admin Panel > Settings > Connections > "Cache Base Model List".
- Persistence: This environment variable is a
PersistentConfigvariable.
How the cache works:
- Initialization: When enabled, base models are fetched and cached during application startup.
- Storage: The cache is stored in application memory (
app.state.BASE_MODELS). - Cache Hit: Subsequent requests for models return the cached list without contacting external endpoints.
- Cache Refresh: The cache is refreshed when:
- The application restarts
- The connection settings are saved in the Admin Panel > Settings > Connections (clicking the Save button on the bottom right will trigger a refresh and update the cache with the newly fetched models)
- No TTL: There is no automatic time-based expiration.
Enable this setting in production environments where model lists are relatively stable. For development environments or when frequently adding/removing models from Ollama, you may prefer to leave it disabled for real-time model discovery.
MODELS_CACHE_TTL
- Type:
int - Default:
1 - Description: Sets the cache time-to-live in seconds for model list responses from OpenAI and Ollama endpoints. This reduces API calls by caching the available models list for the specified duration. Set to empty string to disable caching entirely.
This caches the external model lists retrieved from configured OpenAI-compatible and Ollama API endpoints (not Open WebUI's internal model configurations). Higher values improve performance by reducing redundant API requests to external providers but may delay visibility of newly added or removed models on those endpoints. A value of 0 disables caching and forces fresh API calls each time.
In high-traffic scenarios, increasing this value (e.g., to 300 seconds) can significantly reduce load on external API endpoints while still providing reasonably fresh model data.
Open WebUI has two model caching mechanisms that work independently:
| Setting | Type | Default | Refresh Trigger |
|---|---|---|---|
ENABLE_BASE_MODELS_CACHE | In-memory | False | App restart OR Admin Save |
MODELS_CACHE_TTL | TTL-based | 1 second | Automatic after TTL expires |
For maximum performance, enable both: ENABLE_BASE_MODELS_CACHE=True with MODELS_CACHE_TTL=300.
JWT_EXPIRES_IN
- Type:
str - Default:
4w - Description: Sets the JWT expiration time in seconds. Valid time units:
s,m,h,d,wor-1for no expiration. - Persistence: This environment variable is a
PersistentConfigvariable.
Setting JWT_EXPIRES_IN to -1 disables JWT expiration, making issued tokens valid forever. This is extremely dangerous in production and exposes your system to severe security risks if tokens are leaked or compromised.
Always set a reasonable expiration time in production environments (e.g., 3600s, 1h, 7d etc.) to limit the lifespan of authentication tokens.
NEVER use -1 in a production environment.
If you have already deployed with JWT_EXPIRES_IN=-1, you can rotate or change your WEBUI_SECRET_KEY to immediately invalidate all existing tokens.