部署及安装 0.1 Help

环境变量说明

Open WebUI 提供了大量环境变量,可让您自定义和配置应用程序的各个方面。此页面可作为所有可用环境变量的综合参考,提供其类型、默认值和说明。随着新变量的引入,此页面将更新以反映不断增长的配置选项。

关于 PersistentConfig 环境

后端

以下环境变量用于backend/open_webui/config.py提供 Open WebUI 启动配置。请注意,某些变量可能具有不同的默认值,具体取决于您是直接运行 Open WebUI 还是通过 Docker 运行。有关日志记录环境变量的更多信息,请参阅我们的日志记录文档)。

ENV

  • 类型: str (enum: dev, prod)

  • 选项:

    • dev - 启用 FastAPI API 文档 /docs

    • prod - 自动配置多个环境变量

  • 默认:

    • 后端源码部署 默认: dev

    • Docker部署 默认: prod

  • 描述: 环境设置.

CUSTOM_NAME

  • 类型: str

  • 描述: 设置 WEBUI_NAME 但轮询 api.openwebui.com 以获取元数据。

WEBUI_NAME

  • 类型: str

  • 默认: Open WebUI

  • 描述: 设置主 WebUI 名称。 (Open WebUI) 如果被覆盖则附加。

WEBUI_URL

  • 类型: str

  • 默认: http://localhost:3000

  • 描述: 指定可访问 Open WebUI 的 URL。当前用于搜索引擎支持。

  • Persistence: This environment variable is a PersistentConfig variable.

PORT

  • 类型: int

  • 默认: 8080

  • 描述: 设置运行 Open WebUI 的端口。

ENABLE_SIGNUP

  • 类型: bool

  • 默认: True

  • 描述: 切换用户帐户创建。

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_LOGIN_FORM

  • 类型: bool

  • 默认: True

  • 描述: 切换电子邮件、密码、登录和“或”(仅当ENABLE_OAUTH_SIGNUP设置为 True 时)元素。

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_REALTIME_CHAT_SAVE

  • 类型: bool

  • 默认: False

  • 描述: When enabled, the system saves each chunk of streamed chat data to the database in real time to ensure maximum data persistency. This feature provides robust data recovery and allows accurate session tracking. However, the tradeoff is increased latency, as saving to the database introduces a delay. Disabling this feature can improve performance and reduce delays, but it risks potential data loss in the event of a system failure or crash. Use based on your application's requirements and acceptable tradeoffs.

ENABLE_ADMIN_EXPORT

  • 类型: bool

  • 默认: True

  • 描述: Controls whether admin users can export data.

ENABLE_ADMIN_CHAT_ACCESS

  • 类型: bool

  • 默认: True

  • 描述: Enables admin users to access all chats.

ENABLE_CHANNELS

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables channel support.

  • Persistence: This environment variable is a PersistentConfig variable.

ADMIN_EMAIL

  • 类型: str

  • 描述: Sets the admin email shown by SHOW_ADMIN_DETAILS

  • Persistence: This environment variable is a PersistentConfig variable.

SHOW_ADMIN_DETAILS

  • 类型: bool

  • 默认: True

  • 描述: Toggles whether to show admin user details in the interface.

  • Persistence: This environment variable is a PersistentConfig variable.

BYPASS_MODEL_ACCESS_CONTROL

  • 类型: bool

  • 默认: False

  • 描述: Bypasses model access control.

DEFAULT_MODELS

  • 类型: str

  • 默认: empty string (' '), since None is set as default

  • 描述: Sets a default Language Model.

  • Persistence: This environment variable is a PersistentConfig variable.

DEFAULT_USER_ROLE

  • 类型: str (enum: pending, user, admin)

  • 选项:

    • 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.

  • 默认: pending

  • 描述: Sets the default role assigned to new users.

  • Persistence: This environment variable is a PersistentConfig variable.

DEFAULT_LOCALE

  • 类型: str

  • 默认: en

  • 描述: Sets the default locale for the application.

  • Persistence: This environment variable is a PersistentConfig variable.

WEBHOOK_URL

  • 类型: str

  • 描述: Sets a webhook for integration with Discord/Slack/Microsoft Teams.

  • Persistence: This environment variable is a PersistentConfig variable.

WEBUI_BUILD_HASH

  • 类型: str

  • 默认: dev-build

  • 描述: Used for identifying the Git SHA of the build for releases.

WEBUI_BANNERS

  • 类型: list of dict

  • 默认: []

  • 描述: List of banners to show to users. Format of banners are:

[ { "id": "string", "type": "string [info, success, warning, error]", "title": "string", "content": "string", "dismissible": "False", "timestamp": 1000 } ]
  • Persistence: This environment variable is a PersistentConfig variable.

JWT_EXPIRES_IN

  • 类型: int

  • 默认: -1

  • 描述: Sets the JWT expiration time in seconds. Valid time units: s, m, h, d, w or -1 for no expiration.

  • Persistence: This environment variable is a PersistentConfig variable.

USE_CUDA_DOCKER

  • 类型: bool

  • 默认: False

  • 描述: Builds the Docker image with NVIDIA CUDA support. Enables GPU acceleration for local Whisper and embeddings.

AIOHTTP Client

AIOHTTP_CLIENT_TIMEOUT

  • 类型: int

  • 默认: 300

  • 描述: Specifies the timeout duration in seconds for the aiohttp client. This impacts things such as connections to Ollama and OpenAI endpoints.

AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST

  • 类型: int

  • 描述: Sets the timeout in seconds for fetching the OpenAI model list. This can be useful in cases where network latency requires a longer timeout duration to successfully retrieve the model list.

Directories

DATA_DIR

  • 类型: str

  • 默认: ./data

  • 描述: Specifies the base directory for data storage, including uploads, cache, vector database, etc.

FONTS_DIR

  • 类型: str

  • 描述: Specifies the directory for fonts.

FRONTEND_BUILD_DIR

  • 类型: str

  • 默认: ../build

  • 描述: Specifies the location of the built frontend files.

STATIC_DIR

  • 类型: str

  • 默认: ./static

  • 描述: Specifies the directory for static files, such as the favicon.

Ollama

ENABLE_OLLAMA_API

  • 类型: bool

  • 默认: True

  • 描述: Enables the use of Ollama APIs.

  • Persistence: This environment variable is a PersistentConfig variable.

OLLAMA_BASE_URL (OLLAMA_API_BASE_URL is depreciated)

  • 类型: str

  • 默认: http://localhost:11434

  • Docker 默认:

    • If K8S_FLAG is set: http://ollama-service.open-webui.svc.cluster.local:11434

    • If USE_OLLAMA_DOCKER=True: http://localhost:11434

    • Else http://host.docker.internal:11434

  • 描述: Configures the Ollama backend URL.

OLLAMA_BASE_URLS

  • 类型: str

  • 描述: Configures load-balanced Ollama backend hosts, separated by ;. See OLLAMA_BASE_URL. Takes precedence overOLLAMA_BASE_URL.

  • Example: http://host-one:11434;http://host-two:11434

  • Persistence: This environment variable is a PersistentConfig variable.

USE_OLLAMA_DOCKER

  • 类型: bool

  • 默认: False

  • 描述: Builds the Docker image with a bundled Ollama instance.

K8S_FLAG

  • 类型: bool

  • 默认: False

  • 描述: If set, assumes Helm chart deployment and sets OLLAMA_BASE_URL to http://ollama-service.open-webui.svc.cluster.local:11434

OpenAI

ENABLE_OPENAI_API

  • 类型: bool

  • 默认: True

  • 描述: Enables the use of OpenAI APIs.

  • Persistence: This environment variable is a PersistentConfig variable.

OPENAI_API_BASE_URL

  • 类型: str

  • 默认: https://api.openai.com/v1

  • 描述: Configures the OpenAI base API URL.

  • Persistence: This environment variable is a PersistentConfig variable.

OPENAI_API_BASE_URLS

  • 类型: str

  • 描述: Supports balanced OpenAI base API URLs, semicolon-separated.

  • Example: http://host-one:11434;http://host-two:11434

  • Persistence: This environment variable is a PersistentConfig variable.

OPENAI_API_KEY

  • 类型: str

  • 描述: Sets the OpenAI API key.

  • Example: sk-124781258123

  • Persistence: This environment variable is a PersistentConfig variable.

OPENAI_API_KEYS

  • 类型: str

  • 描述: Supports multiple OpenAI API keys, semicolon-separated.

  • Example: sk-124781258123;sk-4389759834759834

  • Persistence: This environment variable is a PersistentConfig variable.

Tasks

TASK_MODEL

  • 类型: str

  • 描述: 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 PersistentConfig variable.

TASK_MODEL_EXTERNAL

  • 类型: str

  • 描述: 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 PersistentConfig variable.

TITLE_GENERATION_PROMPT_TEMPLATE

  • 类型: str

  • 描述: Prompt to use when generating chat titles.

  • 默认: The value of DEFAULT_TITLE_GENERATION_PROMPT_TEMPLATE environment variable.

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 PersistentConfig variable.

TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE

  • 类型: str

  • 描述: Prompt to use when calling tools.

  • 默认: The value of DEFAULT_TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE environment variable.

Template:

Available Tools: {{TOOLS}}\nReturn an empty string if no tools match the query. If a function tool matches, construct and return a JSON object in the format {\"name\": \"functionName\", \"parameters\": {\"requiredFunctionParamKey\": \"requiredFunctionParamValue\"}} using the appropriate tool and its parameters. Only return the object and limit the response to the JSON object without additional text.
  • Persistence: This environment variable is a PersistentConfig variable.

Autocomplete

ENABLE_AUTOCOMPLETE_GENERATION

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables autocomplete generation.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH

  • 类型: int

  • 默认: -1

  • 描述: Sets the maximum input length for autocomplete generation.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE

  • 类型: str

  • 默认: The value of DEFAULT_AUTOCOMPLETE_GENERATION_PROMPT_TEMPLATE environment variable.

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:
  • 描述: Sets the prompt template for autocomplete generation.

  • Persistence: This environment variable is a PersistentConfig variable.

Evaluation Arena Model

ENABLE_EVALUATION_ARENA_MODELS

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables evaluation arena models.

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_MESSAGE_RATING

  • 类型: bool

  • 默认: True

  • 描述: Enables message rating feature.

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_COMMUNITY_SHARING

  • 类型: bool

  • 默认: True

  • 描述: Controls whether users are shown the share to community button.

  • Persistence: This environment variable is a PersistentConfig variable.

Tags Generation

ENABLE_TAGS_GENERATION

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables tags generation.

  • Persistence: This environment variable is a PersistentConfig variable.

TAGS_GENERATION_PROMPT_TEMPLATE

  • 类型: str

  • 默认: The value of DEFAULT_TAGS_GENERATION_PROMPT_TEMPLATE environment variable.

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>
  • 描述: Sets the prompt template for tags generation.

  • Persistence: This environment variable is a PersistentConfig variable.

API Key Endpoint Restrictions

ENABLE_API_KEY_ENDPOINT_RESTRICTIONS

  • 类型: bool

  • 默认: False

  • 描述: Enables API key endpoint restrictions for added security and configurability.

  • Persistence: This environment variable is a PersistentConfig variable.

API_KEY_ALLOWED_ENDPOINTS

  • 类型: str

  • 描述: Specifies a comma-separated list of allowed API endpoints when API key endpoint restrictions are enabled.

  • Persistence: This environment variable is a PersistentConfig variable.

安全变量

ENABLE_FORWARD_USER_INFO_HEADERS

  • type: bool

  • 默认: False

  • 描述: Forwards user information (name, id, email, and role) as X-headers to OpenAI API. If enabled, the following headers are forwarded:

    • X-OpenWebUI-User-Name

    • X-OpenWebUI-User-Id

    • X-OpenWebUI-User-Email

    • X-OpenWebUI-User-Role

ENABLE_RAG_LOCAL_WEB_FETCH

  • 类型: bool

  • 默认: False

  • 描述: Enables local web fetching for RAG. Enabling this allows Server Side Request Forgery attacks against local network resources.

ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION

  • 类型: bool

  • 默认: True

  • 描述: Bypass SSL Verification for RAG on Websites.

  • Persistence: This environment variable is a PersistentConfig variable.

  • 类型: str (enum: lax, strict, none)

  • 选项:

    • lax - Sets the SameSite attribute to lax, allowing session cookies to be sent with requests initiated by third-party websites.

    • strict - Sets the SameSite attribute to strict, blocking session cookies from being sent with requests initiated by third-party websites.

    • none - Sets the SameSite attribute to none, allowing session cookies to be sent with requests initiated by third-party websites, but only over HTTPS.

  • 默认: lax

  • 描述: Sets the SameSite attribute for session cookies.

  • 类型: bool

  • 默认: False

  • 描述: Sets the Secure attribute for session cookies if set to True.

  • 类型: str (enum: lax, strict, none)

  • 选项:

    • lax - Sets the SameSite attribute to lax, allowing auth cookies to be sent with requests initiated by third-party websites.

    • strict - Sets the SameSite attribute to strict, blocking auth cookies from being sent with requests initiated by third-party websites.

    • none - Sets the SameSite attribute to none, allowing auth cookies to be sent with requests initiated by third-party websites, but only over HTTPS.

  • 默认: lax

  • 描述: Sets the SameSite attribute for auth cookies.

  • 类型: bool

  • 默认: False

  • 描述: Sets the Secure attribute for auth cookies if set to True.

WEBUI_AUTH

  • 类型: bool

  • 默认: True

  • 描述: This setting enables or disables authentication.

WEBUI_SECRET_KEY

  • 类型: str

  • 默认: t0p-s3cr3t

  • Docker 默认: Randomly generated on first start

  • 描述: Overrides the randomly generated string used for JSON Web Token.

OFFLINE_MODE

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables offline mode.

RESET_CONFIG_ON_START

  • 类型: bool

  • 默认: False

  • 描述: Resets the config.json file on startup.

SAFE_MODE

  • 类型: bool

  • 默认: False

  • 描述: Enables safe mode, which disables potentially unsafe features, deactivating all functions.

CORS_ALLOW_ORIGIN

  • 类型: str

  • 默认: *

  • 描述: Sets the allowed origins for Cross-Origin Resource Sharing (CORS).

RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE

  • 类型: bool

  • 默认: False

  • 描述: Determines whether or not to allow custom models defined on the Hub in their own modeling files.

RAG_RERANKING_MODEL_TRUST_REMOTE_CODE

  • 类型: bool

  • 默认: False

  • 描述: Determines whether or not to allow custom models defined on the Hub in their own modeling files for reranking.

RAG_EMBEDDING_MODEL_AUTO_UPDATE

  • 类型: bool

  • 默认: True

  • 描述: Toggles automatic update of the Sentence-Transformer model.

RAG_RERANKING_MODEL_AUTO_UPDATE

  • 类型: bool

  • 默认: True

  • 描述: Toggles automatic update of the reranking model.

WHISPER_MODEL_AUTO_UPDATE

  • 类型: bool

  • 默认: False

  • 描述: Toggles automatic update of the Whisper model.

检索增强生成 (RAG)

VECTOR_DB

  • 类型: str

  • 选项:

  • chroma, milvus, qdrant, opensearch, pgvector

  • 默认: chroma

  • 描述: Specifies which vector database system to use. This setting determines which vector storage system will be used for managing embeddings.

RAG_EMBEDDING_ENGINE

  • 类型: str (enum: ollama, openai)

  • 选项:

    • Leave empty for 默认 (SentenceTransformers) - Uses SentenceTransformers for embeddings.

    • ollama - Uses the Ollama API for embeddings.

    • openai - Uses the OpenAI API for embeddings.

  • 描述: Selects an embedding engine to use for RAG.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_EMBEDDING_MODEL

  • 类型: str

  • 默认: sentence-transformers/all-MiniLM-L6-v2

  • 描述: Sets a model for embeddings. Locally, a Sentence-Transformer model is used.

  • Persistence: This environment variable is a PersistentConfig variable.

  • 类型: bool

  • 默认: False

  • 描述: Enables the use of ensemble search with BM25 + ChromaDB, with reranking using sentence_transformers models.

  • Persistence: This environment variable is a PersistentConfig variable.

CONTENT_EXTRACTION_ENGINE

  • 类型: str (tika)

  • 选项:

    • Leave empty to use default

    • tika - Use a local Apache Tika server

  • 描述: Sets the content extraction engine to use for document ingestion.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_TOP_K

  • 类型: int

  • 默认: 3

  • 描述: Sets the default number of results to consider when using RAG.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_RELEVANCE_THRESHOLD

  • 类型: float

  • 默认: 0.0

  • 描述: Sets the relevance threshold to consider for documents when used with reranking.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_TEMPLATE

  • 类型: str

  • 默认: The value of DEFAULT_RAG_TEMPLATE environment variable.

Template:

### Task: Respond to the user query using the provided context, incorporating inline citations in the format [source_id] **only when the <source_id> tag is explicitly provided** in the context. ### Guidelines: - If you don't know the answer, clearly state that. - If uncertain, ask the user for clarification. - Respond in the same language as the user's query. - If the context is unreadable or of poor quality, inform the user and provide the best possible answer. - If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding. - **Only include inline citations using [source_id] when a <source_id> tag is explicitly provided in the context.** - Do not cite if the <source_id> tag is not provided in the context. - Do not use XML tags in your response. - Ensure citations are concise and directly related to the information provided. ### Example of Citation: If the user asks about a specific topic and the information is found in "whitepaper.pdf" with a provided <source_id>, the response should include the citation like so: * "According to the study, the proposed method increases efficiency by 20% [whitepaper.pdf]." If no <source_id> is present, the response should omit the citation. ### Output: Provide a clear and direct response to the user's query, including inline citations in the format [source_id] only when the <source_id> tag is present in the context. <context> {{CONTEXT}} </context> <user_query> {{QUERY}} </user_query>
  • 描述: Template to use when injecting RAG documents into chat completion

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_TEXT_SPLITTER

  • 类型: str

  • 选项: character, token

  • 默认: character

  • 描述: Sets the text splitter for RAG models.

  • Persistence: This environment variable is a PersistentConfig variable.

TIKTOKEN_CACHE_DIR

  • 类型: str

  • 默认: {CACHE_DIR}/tiktoken

  • 描述: Sets the directory for TikiToken cache.

TIKTOKEN_ENCODING_NAME

  • 类型: str

  • 默认: cl100k_base

  • 描述: Sets the encoding name for TikiToken.

  • Persistence: This environment variable is a PersistentConfig variable.

CHUNK_SIZE

  • 类型: int

  • 默认: 1000

  • 描述: Sets the document chunk size for embeddings.

  • Persistence: This environment variable is a PersistentConfig variable.

CHUNK_OVERLAP

  • 类型: int

  • 默认: 100

  • 描述: Specifies how much overlap there should be between chunks.

  • Persistence: This environment variable is a PersistentConfig variable.

PDF_EXTRACT_IMAGES

  • 类型: bool

  • 默认: False

  • 描述: Extracts images from PDFs using OCR when loading documents.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_FILE_MAX_SIZE

  • 类型: int

  • 描述: Sets the maximum size of a file in megabytes that can be uploaded for document ingestion.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_FILE_MAX_COUNT

  • 类型: int

  • 描述: Sets the maximum number of files that can be uploaded at once for document ingestion.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_RERANKING_MODEL

  • 类型: str

  • 描述: Sets a model for reranking results. Locally, a Sentence-Transformer model is used.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_OPENAI_API_BASE_URL

  • 类型: str

  • 默认: ${OPENAI_API_BASE_URL}

  • 描述: Sets the OpenAI base API URL to use for RAG embeddings.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_OPENAI_API_KEY

  • 类型: str

  • 默认: ${OPENAI_API_KEY}

  • 描述: Sets the OpenAI API key to use for RAG embeddings.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_EMBEDDING_OPENAI_BATCH_SIZE

  • 类型: int

  • 默认: 1

  • 描述: Sets the batch size for OpenAI embeddings.

RAG_EMBEDDING_BATCH_SIZE

  • 类型: int

  • 默认: 1

  • 描述: Sets the batch size for embedding in RAG (Retrieval-Augmented Generator) models.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_OLLAMA_API_KEY

  • 类型: str

  • 描述: Sets the API key for Ollama API used in RAG models.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_OLLAMA_BASE_URL

  • 类型: str

  • 描述: Sets the base URL for Ollama API used in RAG models.

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_RETRIEVAL_QUERY_GENERATION

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables retrieval query generation.

  • Persistence: This environment variable is a PersistentConfig variable.

QUERY_GENERATION_PROMPT_TEMPLATE

  • 类型: str

  • 默认: The value of DEFAULT_QUERY_GENERATION_PROMPT_TEMPLATE environment variable.

Template:

### Task: Analyze the chat history to determine the necessity of generating search queries, in the given language. By default, **prioritize generating 1-3 broad and relevant search queries** unless it is absolutely certain that no additional information is required. The aim is to retrieve comprehensive, updated, and valuable information even with minimal uncertainty. If no search is unequivocally needed, return an empty list. ### Guidelines: - Respond **EXCLUSIVELY** with a JSON object. Any form of extra commentary, explanation, or additional text is strictly prohibited. - When generating search queries, respond in the format: { "queries": ["query1", "query2"] }, ensuring each query is distinct, concise, and relevant to the topic. - If and only if it is entirely certain that no useful results can be retrieved by a search, return: { "queries": [] }. - Err on the side of suggesting search queries if there is **any chance** they might provide useful or updated information. - Be concise and focused on composing high-quality search queries, avoiding unnecessary elaboration, commentary, or assumptions. - Today's date is: {{CURRENT_DATE}}. - Always prioritize providing actionable and broad queries that maximize informational coverage. ### Output: Strictly return in JSON format: { "queries": ["query1", "query2"] } ### Chat History: <chat_history> {{MESSAGES:END:6}} </chat_history>
  • 描述: Sets the prompt template for query generation.

  • Persistence: This environment variable is a PersistentConfig variable.

Apache Tika

TIKA_SERVER_URL

  • 类型: str

  • 默认: http://localhost:9998

  • 描述: Sets the URL for the Apache Tika server.

  • Persistence: This environment variable is a PersistentConfig variable.

ChromaDB

CHROMA_TENANT

  • 类型: str

  • 默认: the value of chromadb.DEFAULT_TENANT (a constant in the chromadb module)

  • 描述: Sets the tenant for ChromaDB to use for RAG embeddings.

CHROMA_DATABASE

  • 类型: str

  • 默认: the value of chromadb.DEFAULT_DATABASE (a constant in the chromadb module)

  • 描述: Sets the database in the ChromaDB tenant to use for RAG embeddings.

CHROMA_HTTP_HOST

  • 类型: str

  • 描述: Specifies the hostname of a remote ChromaDB Server. Uses a local ChromaDB instance if not set.

CHROMA_HTTP_PORT

  • 类型: int

  • 默认: 8000

  • 描述: Specifies the port of a remote ChromaDB Server.

CHROMA_HTTP_HEADERS

  • 类型: str

  • 描述: Comma-separated list of HTTP headers to include with every ChromaDB request.

  • Example: Authorization=Bearer heuhagfuahefj,User-Agent=OpenWebUI.

CHROMA_HTTP_SSL

  • 类型: bool

  • 默认: False

  • 描述: Controls whether or not SSL is used for ChromaDB Server connections.

CHROMA_CLIENT_AUTH_PROVIDER

  • 类型: str

  • 描述: Specifies auth provider for remote ChromaDB Server.

  • Example: chromadb.auth.basic_authn.BasicAuthClientProvider

CHROMA_CLIENT_AUTH_CREDENTIALS

  • 类型: str

  • 描述: Specifies auth credentials for remote ChromaDB Server.

  • Example: username:password

Google Drive

ENABLE_GOOGLE_DRIVE_INTEGRATION

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables Google Drive integration. If set to true, and GOOGLE_DRIVE_CLIENT_ID & GOOGLE_DRIVE_API_KEY are both configured, Google Drive will appear as an upload option in the chat UI.

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_DRIVE_CLIENT_ID

  • 类型: str

  • 描述: Sets the client ID for Google Drive (client must be configured with Drive API and Picker API enabled).

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_DRIVE_API_KEY

  • 类型: str

  • 描述: Sets the API key for Google Drive integration.

  • Persistence: This environment variable is a PersistentConfig variable.

Milvus

MILVUS_URI

  • 类型: str

  • 默认: ${DATA_DIR}/vector_db/milvus.db

  • 描述: Specifies the URI for connecting to the Milvus vector database. This can point to a local or remote Milvus server based on the deployment configuration.

MILVUS_DB

  • 类型: str

  • 默认: default

  • 描述: Specifies the database to connect to within a milvus instance

MILVUS_TOKEN

  • 类型: str

  • 默认: None

  • 描述: Specifies the connection token for Milvus, optional.

OpenSearch

OPENSEARCH_CERT_VERIFY

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables OpenSearch certificate verification.

OPENSEARCH_PASSWORD

  • 类型: str

  • 描述: Sets the password for OpenSearch.

OPENSEARCH_SSL

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables SSL for OpenSearch.

OPENSEARCH_URI

  • 类型: str

  • 默认: https://localhost:9200

  • 描述: Sets the URI for OpenSearch.

OPENSEARCH_USERNAME

  • 类型: str

  • 描述: Sets the username for OpenSearch.

PGVector

PGVECTOR_DB_URL

  • 类型: str

  • 默认: The value of DATABASE_URL environment variable

  • 描述: Sets the database URL for model storage.

Qdrant

QDRANT_API_KEY

  • 类型: str

  • 描述: Sets the API key for Qdrant.

QDRANT_URI

  • 类型: str

  • 描述: Sets the URI for Qdrant.

联网搜索

  • 类型: bool

  • 默认: False

  • 描述: Enable web search toggle

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_SEARCH_QUERY_GENERATION

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables search query generation.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_WEB_SEARCH_RESULT_COUNT

  • 类型: int

  • 默认: 3

  • 描述: Maximum number of search results to crawl.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_WEB_SEARCH_CONCURRENT_REQUESTS

  • 类型: int

  • 默认: 10

  • 描述: Number of concurrent requests to crawl web pages returned from search results.

  • Persistence: This environment variable is a PersistentConfig variable.

RAG_WEB_SEARCH_ENGINE

  • 类型: str (enum: searxng, google_pse, brave, kagi, mojeek, serpstack, serper, serply, searchapi, duckduckgo, tavily, jina, bing)

  • 选项:

  • Persistence: This environment variable is a PersistentConfig variable.

SEARXNG_QUERY_URL

  • 类型: str

  • 描述: The SearXNG search API URL supporting JSON output. <query> is replaced with the search query. Example: http://searxng.local/search?q=<query>

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_PSE_API_KEY

  • 类型: str

  • 描述: Sets the API key for the Google Programmable Search Engine (PSE) service.

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_PSE_ENGINE_ID

  • 类型: str

  • 描述: The engine ID for the Google Programmable Search Engine (PSE) service.

  • Persistence: This environment variable is a PersistentConfig variable.

BRAVE_SEARCH_API_KEY

  • 类型: str

  • 描述: Sets the API key for the Brave Search API.

  • Persistence: This environment variable is a PersistentConfig variable.

KAGI_SEARCH_API_KEY

  • 类型: str

  • 描述: Sets the API key for Kagi Search API.

  • Persistence: This environment variable is a PersistentConfig variable.

MOJEEK_SEARCH_API_KEY

  • 类型: str

  • 描述: Sets the API key for Mojeek Search API.

  • Persistence: This environment variable is a PersistentConfig variable.

SERPSTACK_API_KEY

  • 类型: str

  • 描述: Sets the API key for Serpstack search API.

  • Persistence: This environment variable is a PersistentConfig variable.

SERPSTACK_HTTPS

  • 类型: bool

  • 默认: True

  • 描述: Configures the use of HTTPS for Serpstack requests. Free tier requests are restricted to HTTP only.

  • Persistence: This environment variable is a PersistentConfig variable.

SERPER_API_KEY

  • 类型: str

  • 描述: Sets the API key for Serper search API.

  • Persistence: This environment variable is a PersistentConfig variable.

SERPLY_API_KEY

  • 类型: str

  • 描述: Sets the API key for Serply search API.

  • Persistence: This environment variable is a PersistentConfig variable.

SEARCHAPI_API_KEY

  • 类型: str

  • 描述: Sets the API key for SearchAPI.

  • Persistence: This environment variable is a PersistentConfig variable.

SEARCHAPI_ENGINE

  • 类型: str

  • 描述: Sets the SearchAPI engine.

  • Persistence: This environment variable is a PersistentConfig variable.

TAVILY_API_KEY

  • 类型: str

  • 描述: Sets the API key for Tavily search API.

  • Persistence: This environment variable is a PersistentConfig variable.

JINA_API_KEY

  • 类型: str

  • 描述: Sets the API key for Jina.

  • Persistence: This environment variable is a PersistentConfig variable.

BING_SEARCH_V7_ENDPOINT

  • 类型: str

  • 描述: Sets the endpoint for Bing Search API.

  • Persistence: This environment variable is a PersistentConfig variable.

BING_SEARCH_V7_SUBSCRIPTION_KEY

  • 类型: str

  • 默认: https://api.bing.microsoft.com/v7.0/search

  • 描述: Sets the subscription key for Bing Search API.

  • Persistence: This environment variable is a PersistentConfig variable.

YouTube Loader

YOUTUBE_LOADER_PROXY_URL

  • 类型: str

  • 描述: Sets the proxy URL for YouTube loader.

  • Persistence: This environment variable is a PersistentConfig variable.

YOUTUBE_LOADER_LANGUAGE

  • 类型: str

  • 默认: en

  • 描述: Sets the language to use for YouTube video loading.

  • Persistence: This environment variable is a PersistentConfig variable.

音频

Whisper Speech-to-Text (Local)

WHISPER_MODEL

  • 类型: str

  • 默认: base

  • 描述: Sets the Whisper model to use for Speech-to-Text. The backend used is faster_whisper with quantization to int8.

  • Persistence: This environment variable is a PersistentConfig variable.

WHISPER_MODEL_DIR

  • 类型: str

  • 默认: ${DATA_DIR}/cache/whisper/models

  • 描述: Specifies the directory to store Whisper model files.

Speech-to-Text (OpenAI)

AUDIO_STT_ENGINE

  • 类型: str (enum: openai)

  • 选项:

    • Leave empty to use local Whisper engine for Speech-to-Text.

    • openai - Uses OpenAI engine for Speech-to-Text.

  • 描述: Specifies the Speech-to-Text engine to use.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_STT_MODEL

  • 类型: str

  • 默认: whisper-1

  • 描述: Specifies the Speech-to-Text model to use for OpenAI-compatible endpoints.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_STT_OPENAI_API_BASE_URL

  • 类型: str

  • 默认: ${OPENAI_API_BASE_URL}

  • 描述: Sets the OpenAI-compatible base URL to use for Speech-to-Text.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_STT_OPENAI_API_KEY

  • 类型: str

  • 默认: ${OPENAI_API_KEY}

  • 描述: Sets the OpenAI API key to use for Speech-to-Text.

  • Persistence: This environment variable is a PersistentConfig variable.

文本转语音

AUDIO_TTS_API_KEY

  • 类型: str

  • 描述: Sets the API key for Text-to-Speech.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_TTS_ENGINE

  • 类型: str (enum: azure, elevenlabs, openai, transformers)

  • 选项:

    • Leave empty to use built-in WebAPI engine for Text-to-Speech.

    • azure - Uses Azure engine for Text-to-Speech.

    • elevenlabs - Uses ElevenLabs engine for Text-to-Speech

    • openai - Uses OpenAI engine for Text-to-Speech.

    • transformers - Uses SentenceTransformers for Text-to-Speech.

  • 描述: Specifies the Text-to-Speech engine to use.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_TTS_MODEL

  • 类型: str

  • 默认: tts-1

  • 描述: Specifies the OpenAI text-to-speech model to use.

  • Persistence: This environment variable is a PersistentConfig variable.

Azure Text-to-Speech

AUDIO_TTS_AZURE_SPEECH_OUTPUT_FORMAT

  • 类型: str

  • 描述: Sets the output format for Azure Text to Speech.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_TTS_AZURE_SPEECH_REGION

  • 类型: str

  • 描述: Sets the region for Azure Text to Speech.

  • Persistence: This environment variable is a PersistentConfig variable.

OpenAI Text-to-Speech

AUDIO_TTS_OPENAI_API_BASE_URL

  • 类型: str

  • 默认: ${OPENAI_API_BASE_URL}

  • 描述: Sets the OpenAI-compatible base URL to use for text-to-speech.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_TTS_OPENAI_API_KEY

  • 类型: str

  • 默认: ${OPENAI_API_KEY}

  • 描述: Sets the API key to use for text-to-speech.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_TTS_SPLIT_ON

  • 类型: str

  • 默认: punctuation

  • 描述: Sets the OpenAI text-to-speech split on to use.

  • Persistence: This environment variable is a PersistentConfig variable.

AUDIO_TTS_VOICE

  • 类型: str

  • 默认: alloy

  • 描述: Sets the OpenAI text-to-speech voice to use.

  • Persistence: This environment variable is a PersistentConfig variable.

图像生成

ENABLE_IMAGE_GENERATION

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables image generation features.

  • Persistence: This environment variable is a PersistentConfig variable.

IMAGE_GENERATION_ENGINE

  • 类型: str (enum: openai, comfyui, automatic1111)

  • 选项:

    • openai - Uses OpenAI DALL-E for image generation.

    • comfyui - Uses ComfyUI engine for image generation.

    • automatic1111 - Uses Automatic1111 engine for image generation (default).

  • 默认: openai

  • 描述: Specifies the engine to use for image generation.

  • Persistence: This environment variable is a PersistentConfig variable.

IMAGE_GENERATION_MODEL

  • 类型: str

  • 描述: 默认 model to use for image generation

  • Persistence: This environment variable is a PersistentConfig variable.

IMAGE_SIZE

  • 类型: str

  • 默认: 512x512

  • 描述: Sets the default image size to generate.

  • Persistence: This environment variable is a PersistentConfig variable.

IMAGE_STEPS

  • 类型: int

  • 默认: 50

  • 描述: Sets the default iteration steps for image generation. Used for ComfyUI and AUTOMATIC1111.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOMATIC1111

AUTOMATIC1111_API_AUTH

  • 类型: str

  • 描述: Sets the Automatic1111 API authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOMATIC1111_BASE_URL

  • 类型: str

  • 描述: Specifies the URL to Automatic1111's Stable Diffusion API.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOMATIC1111_CFG_SCALE

  • 类型: float

  • 描述: Sets the scale for Automatic1111 inference.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOMATIC1111_SAMPLER

  • 类型: str

  • 描述: Sets the sampler for Automatic1111 inference.

  • Persistence: This environment variable is a PersistentConfig variable.

AUTOMATIC1111_SCHEDULER

  • 类型: str

  • 描述: Sets the scheduler for Automatic1111 inference.

  • Persistence: This environment variable is a PersistentConfig variable.

ComfyUI

COMFYUI_BASE_URL

  • 类型: str

  • 描述: Specifies the URL to the ComfyUI image generation API.

  • Persistence: This environment variable is a PersistentConfig variable.

COMFYUI_API_KEY

  • 类型: str

  • 描述: Sets the API key for ComfyUI.

  • Persistence: This environment variable is a PersistentConfig variable.

COMFYUI_WORKFLOW

  • 类型: str

  • 默认:

{ "3": { "inputs": { "seed": 0, "steps": 20, "cfg": 8, "sampler_name": "euler", "scheduler": "normal", "denoise": 1, "model": [ "4", 0 ], "positive": [ "6", 0 ], "negative": [ "7", 0 ], "latent_image": [ "5", 0 ] }, "class_type": "KSampler", "_meta": { "title": "KSampler" } }, "4": { "inputs": { "ckpt_name": "model.safetensors" }, "class_type": "CheckpointLoaderSimple", "_meta": { "title": "Load Checkpoint" } }, "5": { "inputs": { "width": 512, "height": 512, "batch_size": 1 }, "class_type": "EmptyLatentImage", "_meta": { "title": "Empty Latent Image" } }, "6": { "inputs": { "text": "Prompt", "clip": [ "4", 1 ] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Prompt)" } }, "7": { "inputs": { "text": "", "clip": [ "4", 1 ] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Prompt)" } }, "8": { "inputs": { "samples": [ "3", 0 ], "vae": [ "4", 2 ] }, "class_type": "VAEDecode", "_meta": { "title": "VAE Decode" } }, "9": { "inputs": { "filename_prefix": "ComfyUI", "images": [ "8", 0 ] }, "class_type": "SaveImage", "_meta": { "title": "Save Image" } } }
  • 描述: Sets the ComfyUI workflow.

  • Persistence: This environment variable is a PersistentConfig variable.

OpenAI DALL-E

IMAGES_OPENAI_API_BASE_URL

  • 类型: str

  • 默认: ${OPENAI_API_BASE_URL}

  • 描述: Sets the OpenAI-compatible base URL to use for DALL-E image generation.

  • Persistence: This environment variable is a PersistentConfig variable.

IMAGES_OPENAI_API_KEY

  • 类型: str

  • 默认: ${OPENAI_API_KEY}

  • 描述: Sets the API key to use for DALL-E image generation.

  • Persistence: This environment variable is a PersistentConfig variable.

OAuth

ENABLE_OAUTH_SIGNUP

  • 类型: bool

  • 默认: False

  • 描述: Enables account creation when sighting up via OAuth. Distinct from ENABLE_SIGNUP.

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_API_KEY

  • 类型: bool

  • 默认: True

  • 描述: Enables API key authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_OAUTH_ROLE_MANAGEMENT

  • 类型: bool

  • 默认: False

  • 描述: Enables role management to oauth delegation.

  • Persistence: This environment variable is a PersistentConfig variable.

ENABLE_OAUTH_GROUP_MANAGEMENT

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables OAUTH group management.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_MERGE_ACCOUNTS_BY_EMAIL

  • 类型: bool

  • 默认: False

  • 描述: If enabled, merges OAuth accounts with existing accounts using the same email address. This is considered unsafe as not all OAuth providers will verify email addresses and can lead to potential account takeovers.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_USERNAME_CLAIM

  • 类型: str

  • 默认: name

  • 描述: Set username claim for OpenID.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_EMAIL_CLAIM

  • 类型: str

  • 默认: email

  • 描述: Set email claim for OpenID.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_PICTURE_CLAIM

  • 类型: str

  • 默认: picture

  • 描述: Set picture (avatar) claim for OpenID.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_GROUP_CLAIM

  • 类型: str

  • 默认: groups

  • 描述: Specifies the group claim for OAUTH authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_ROLES_CLAIM

  • 类型: str

  • 默认: roles

  • 描述: Sets the roles claim to look for in the OIDC token.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_SCOPES

  • 类型: str

  • 默认: openid email profile

  • 描述: Sets the scope for OIDC authentication. openid and email are required.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_ALLOWED_DOMAINS

  • 类型: str

  • 默认: *

  • 描述: Specifies the allowed domains for OAUTH authentication. (e.g. "example1.com,example2.com").

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_ALLOWED_ROLES

  • 类型: str

  • 默认: user,admin

  • 描述: Sets the roles that are allowed access to the platform.

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_ADMIN_ROLES

  • 类型: str

  • 默认: admin

  • 描述: Sets the roles that are considered administrators.

  • Persistence: This environment variable is a PersistentConfig variable.

WEBUI_AUTH_TRUSTED_EMAIL_HEADER

  • 类型: str

  • 描述: Defines the trusted request header for authentication.

WEBUI_AUTH_TRUSTED_NAME_HEADER

  • 类型: str

  • 描述: Defines the trusted request header for the username of anyone registering with the WEBUI_AUTH_TRUSTED_EMAIL_HEADER header.

Google

See https://support.google.com/cloud/answer/6158849?hl=en

GOOGLE_CLIENT_ID

  • 类型: str

  • 描述: Sets the client ID for Google OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_CLIENT_SECRET

  • 类型: str

  • 描述: Sets the client secret for Google OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_OAUTH_SCOPE

  • 类型: str

  • 默认: openid email profile

  • 描述: Sets the scope for Google OAuth authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

GOOGLE_REDIRECT_URI

  • 类型: str

  • 默认: <backend>/oauth/google/callback

  • 描述: Sets the redirect URI for Google OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

Microsoft

See https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app

MICROSOFT_CLIENT_ID

  • 类型: str

  • 描述: Sets the client ID for Microsoft OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

MICROSOFT_CLIENT_SECRET

  • 类型: str

  • 描述: Sets the client secret for Microsoft OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

MICROSOFT_CLIENT_TENANT_ID

  • 类型: str

  • 描述: Sets the tenant ID for Microsoft OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

MICROSOFT_OAUTH_SCOPE

  • 类型: str

  • 默认: openid email profile

  • 描述: Sets the scope for Microsoft OAuth authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

MICROSOFT_REDIRECT_URI

  • 类型: str

  • 默认: <backend>/oauth/microsoft/callback

  • 描述: Sets the redirect URI for Microsoft OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

Github

See https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps

GITHUB_CLIENT_ID

  • 类型: str

  • 描述: Sets the client ID for Github OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

GITHUB_CLIENT_SECRET

  • 类型: str

  • 描述: Sets the client secret for Github OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

GITHUB_OAUTH_SCOPE

  • 类型: str

  • 默认: user:email

  • 描述: Sets the scope for Github OAuth authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

GITHUB_CLIENT_REDIRECT_URI

  • 类型: str

  • 默认: <backend>/oauth/github/callback

  • 描述: Sets the redirect URI for Github OAuth

  • Persistence: This environment variable is a PersistentConfig variable.

OpenID (OIDC)

OAUTH_CLIENT_ID

  • 类型: str

  • 描述: Sets the client ID for OIDC

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_CLIENT_SECRET

  • 类型: str

  • 描述: Sets the client secret for OIDC

  • Persistence: This environment variable is a PersistentConfig variable.

OPENID_PROVIDER_URL

  • 类型: str

  • 描述: Path to the .well-known/openid-configuration endpoint

  • Persistence: This environment variable is a PersistentConfig variable.

OAUTH_PROVIDER_NAME

  • 类型: str

  • 默认: SSO

  • 描述: Sets the name for the OIDC provider.

  • Persistence: This environment variable is a PersistentConfig variable.

OPENID_REDIRECT_URI

  • 类型: str

  • 默认: <backend>/oauth/oidc/callback

  • 描述: Sets the redirect URI for OIDC

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP

ENABLE_LDAP

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables LDAP authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_APP_DN

  • 类型: str

  • 描述: Sets the distinguished name for LDAP application.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_APP_PASSWORD

  • 类型: str

  • 描述: Sets the password for LDAP application.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_ATTRIBUTE_FOR_USERNAME

  • 类型: str

  • 描述: Sets the attribute to use as username for LDAP authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_ATTRIBUTE_FOR_MAIL

  • 类型: str

  • 描述: Sets the attribute to use as mail for LDAP authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_CA_CERT_FILE

  • 类型: str

  • 描述: Sets the path to LDAP CA certificate file.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_CIPHERS

  • 类型: str

  • 默认: ALL

  • 描述: Sets the ciphers to use for LDAP connection.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_SEARCH_BASE

  • 类型: str

  • 描述: Sets the base to search for LDAP authentication.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_SEARCH_FILTERS

  • 类型: str

  • 描述: Sets the filter to use for LDAP search.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_SERVER_HOST

  • 类型: str

  • 默认: localhost

  • 描述: Sets the hostname of LDAP server.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_SERVER_LABEL

  • 类型: str

  • 描述: Sets the label of LDAP server.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_SERVER_PORT

  • 类型: int

  • 默认: 389

  • 描述: Sets the port number of LDAP server.

  • Persistence: This environment variable is a PersistentConfig variable.

LDAP_USE_TLS

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables TLS for LDAP connection.

  • Persistence: This environment variable is a PersistentConfig variable.

工作区权限

USER_PERMISSIONS_WORKSPACE_MODELS_ACCESS

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables user permission to access workspace models.

  • Persistence: This environment variable is a PersistentConfig variable.

USER_PERMISSIONS_WORKSPACE_KNOWLEDGE_ACCESS

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables user permission to access workspace knowledge.

  • Persistence: This environment variable is a PersistentConfig variable.

USER_PERMISSIONS_WORKSPACE_PROMPTS_ACCESS

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables user permission to access workspace prompts.

  • Persistence: This environment variable is a PersistentConfig variable.

USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS

  • 类型: bool

  • 默认: False

  • 描述: Enables or disables user permission to access workspace tools.

  • Persistence: This environment variable is a PersistentConfig variable.

聊天权限

USER_PERMISSIONS_CHAT_FILE_UPLOAD

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables user permission to upload files to chats.

  • Persistence: This environment variable is a PersistentConfig variable.

USER_PERMISSIONS_CHAT_DELETE

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables user permission to delete chats.

  • Persistence: This environment variable is a PersistentConfig variable.

USER_PERMISSIONS_CHAT_EDIT

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables user permission to edit chats.

  • Persistence: This environment variable is a PersistentConfig variable.

USER_PERMISSIONS_CHAT_TEMPORARY

  • 类型: bool

  • 默认: True

  • 描述: Enables or disables user permission to create temporary chats.

  • Persistence: This environment variable is a PersistentConfig variable.

其他环境变量

These variables are not specific to Open WebUI but can still be valuable in certain contexts.

Cloud Storage

STORAGE_PROVIDER

  • 类型: str

  • 选项:

    • s3 - uses S3 client library and related environment variables mentioned in Amazon S3 Storage

    • gcs - uses GCS client library and related environment variables mentioned in Google Cloud Storage

  • 默认: empty string (' '), which defaults to local

  • 描述: Sets the storage provider.

Amazon S3 Storage

S3_ACCESS_KEY_ID

  • 类型: str

  • 描述: Sets the access key ID for S3 storage.

S3_BUCKET_NAME

  • 类型: str

  • 描述: Sets the bucket name for S3 storage.

S3_ENDPOINT_URL

  • 类型: str

  • 描述: Sets the endpoint URL for S3 storage.

S3_KEY_PREFIX

  • 类型: str

  • 描述: Sets the key prefix for a S3 object.

S3_REGION_NAME

  • 类型: str

  • 描述: Sets the region name for S3 storage.

S3_SECRET_ACCESS_KEY

  • 类型: str

  • 描述: Sets the secret access key for S3 storage.

Google Cloud Storage

GOOGLE_APPLICATION_CREDENTIALS_JSON

  • 类型: str

  • 描述: Contents of Google Application Credentials JSON file.

    • Optional - if not provided, credentials will be taken from the environment. User credentials if run locally and Google Metadata server if run on a Google Compute Engine.

    • File can be generated for a service account following this guide

GCS_BUCKET_NAME

  • 类型: str

  • 描述: Sets the bucket name for Google Cloud Storage. Bucket must already exist.

Database Pool

DATABASE_URL

  • 类型: str

  • 默认: sqlite:///${DATA_DIR}/webui.db

  • 描述: Specifies the database URL to connect to.

DATABASE_POOL_SIZE

  • 类型: int

  • 默认: 0

  • 描述: Specifies the size of the database pool. A value of 0 disables pooling.

DATABASE_POOL_MAX_OVERFLOW

  • 类型: int

  • 默认: 0

  • 描述: Specifies the database pool max overflow.

DATABASE_POOL_TIMEOUT

  • 类型: int

  • 默认: 30

  • 描述: Specifies the database pool timeout in seconds to get a connection.

DATABASE_POOL_RECYCLE

  • 类型: int

  • 默认: 3600

  • 描述: Specifies the database pool recycle time in seconds.

Redis

ENABLE_WEBSOCKET_SUPPORT

  • 类型: bool

  • 默认: False

  • 描述: Enables websocket support in Open WebUI (used with Redis).

WEBSOCKET_MANAGER

  • 类型: str

  • 默认: redis

  • 描述: Specifies the websocket manager to use (in this case, Redis).

WEBSOCKET_REDIS_URL (

REDIS_URL exists for potential future use cases. In practice, it is recommended to set both.)

  • 类型: str

  • 默认: redis://localhost:6379/0

  • 描述: Specifies the URL of the Redis instance for websocket communication.

代理设置

Open WebUI supports using proxies for HTTP and HTTPS retrievals. To specify proxy settings, Open WebUI uses the following environment variables:

http_proxy

  • 类型: str

  • 描述: Sets the URL for the HTTP proxy.

https_proxy

  • 类型: str

  • 描述: Sets the URL for the HTTPS proxy.

no_proxy

  • 类型: str

  • 描述: Lists domain extensions (or IP addresses) for which the proxy should not be used, separated by commas. For example, setting no_proxy to '.mit.edu' ensures that the proxy is bypassed when accessing documents from MIT.

Last modified: 12 March 2025