diff --git a/docs/api/index.md b/docs/api/index.md deleted file mode 100644 index 37dd185..0000000 --- a/docs/api/index.md +++ /dev/null @@ -1,202 +0,0 @@ ---- -sidebar_position: 400 -title: "๐Ÿ”— API Endpoints" ---- - -This guide provides essential information on how to interact with the API endpoints effectively to achieve seamless integration and automation using our models. Please note that this is an experimental setup and may undergo future updates for enhancement. - -## Authentication -To ensure secure access to the API, authentication is required ๐Ÿ›ก๏ธ. You can authenticate your API requests using the Bearer Token mechanism. Obtain your API key from **Settings > Account** in the Open WebUI, or alternatively, use a JWT (JSON Web Token) for authentication. - -## Notable API Endpoints - -### ๐Ÿ“œ Retrieve All Models -- **Endpoint**: `GET /api/models` -- **Description**: Fetches all models created or added via Open WebUI. -- **Example**: - ```bash - curl -H "Authorization: Bearer YOUR_API_KEY" http://localhost:3000/api/models - ``` - -### ๐Ÿ’ฌ Chat Completions -- **Endpoint**: `POST /api/chat/completions` -- **Description**: Serves as an OpenAI API compatible chat completion endpoint for models on Open WebUI including Ollama models, OpenAI models, and Open WebUI Function models. -- **Example**: - ```bash - curl -X POST http://localhost:3000/api/chat/completions \ - -H "Authorization: Bearer YOUR_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "llama3.1", - "messages": [ - { - "role": "user", - "content": "Why is the sky blue?" - } - ] - }' - ``` - -### ๐Ÿงฉ Retrieval Augmented Generation (RAG) - -The Retrieval Augmented Generation (RAG) feature allows you to enhance responses by incorporating data from external sources. Below, you will find the methods for managing files and knowledge collections via the API, and how to use them in chat completions effectively. - -#### Uploading Files - -To utilize external data in RAG responses, you first need to upload the files. The content of the uploaded file is automatically extracted and stored in a vector database. - -- **Endpoint**: `POST /api/v1/files/` -- **Curl Example**: - ```bash - curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Accept: application/json" \ - -F "file=@/path/to/your/file" http://localhost:3000/api/v1/files/ - ``` -- **Python Example**: - ```python - import requests - - def upload_file(token, file_path): - url = 'http://localhost:3000/api/v1/files/' - headers = { - 'Authorization': f'Bearer {token}', - 'Accept': 'application/json' - } - files = {'file': open(file_path, 'rb')} - response = requests.post(url, headers=headers, files=files) - return response.json() - ``` - -#### Adding Files to Knowledge Collections - -After uploading, you can group files into a knowledge collection or reference them individually in chats. - -- **Endpoint**: `POST /api/v1/knowledge/{id}/file/add` -- **Curl Example**: - ```bash - curl -X POST http://localhost:3000/api/v1/knowledge/{knowledge_id}/file/add \ - -H "Authorization: Bearer YOUR_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{"file_id": "your-file-id-here"}' - ``` -- **Python Example**: - ```python - import requests - - def add_file_to_knowledge(token, knowledge_id, file_id): - url = f'http://localhost:3000/api/v1/knowledge/{knowledge_id}/file/add' - headers = { - 'Authorization': f'Bearer {token}', - 'Content-Type': 'application/json' - } - data = {'file_id': file_id} - response = requests.post(url, headers=headers, json=data) - return response.json() - ``` - -#### Using Files and Collections in Chat Completions - -You can reference both individual files or entire collections in your RAG queries for enriched responses. - -##### Using an Individual File in Chat Completions - -This method is beneficial when you want to focus the chat model's response on the content of a specific file. - -- **Endpoint**: `POST /api/chat/completions` -- **Curl Example**: - ```bash - curl -X POST http://localhost:3000/api/chat/completions \ - -H "Authorization: Bearer YOUR_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "gpt-4-turbo", - "messages": [ - {"role": "user", "content": "Explain the concepts in this document."} - ], - "files": [ - {"type": "file", "id": "your-file-id-here"} - ] - }' - ``` - -- **Python Example**: - ```python - import requests - - def chat_with_file(token, model, query, file_id): - url = 'http://localhost:3000/api/chat/completions' - headers = { - 'Authorization': f'Bearer {token}', - 'Content-Type': 'application/json' - } - payload = { - 'model': model, - 'messages': [{'role': 'user', 'content': query}], - 'files': [{'type': 'file', 'id': file_id}] - } - response = requests.post(url, headers=headers, json=payload) - return response.json() - ``` - -##### Using a Knowledge Collection in Chat Completions - -Leverage a knowledge collection to enhance the response when the inquiry may benefit from a broader context or multiple documents. - -- **Endpoint**: `POST /api/chat/completions` -- **Curl Example**: - ```bash - curl -X POST http://localhost:3000/api/chat/completions \ - -H "Authorization: Bearer YOUR_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "model": "gpt-4-turbo", - "messages": [ - {"role": "user", "content": "Provide insights on the historical perspectives covered in the collection."} - ], - "files": [ - {"type": "collection", "id": "your-collection-id-here"} - ] - }' - ``` - -- **Python Example**: - ```python - import requests - - def chat_with_collection(token, model, query, collection_id): - url = 'http://localhost:3000/api/chat/completions' - headers = { - 'Authorization': f'Bearer {token}', - 'Content-Type': 'application/json' - } - payload = { - 'model': model, - 'messages': [{'role': 'user', 'content': query}], - 'files': [{'type': 'collection', 'id': collection_id}] - } - response = requests.post(url, headers=headers, json=payload) - return response.json() - ``` - -These methods enable effective utilization of external knowledge via uploaded files and curated knowledge collections, enhancing chat applications' capabilities using the Open WebUI API. Whether using files individually or within collections, you can customize the integration based on your specific needs. - -## Advantages of Using Open WebUI as a Unified LLM Provider -Open WebUI offers a myriad of benefits, making it an essential tool for developers and businesses alike: -- **Unified Interface**: Simplify your interactions with different LLMs through a single, integrated platform. -- **Ease of Implementation**: Quick start integration with comprehensive documentation and community support. - -## Swagger Documentation Links -Access detailed API documentation for different services provided by Open WebUI: - -| Application | Documentation Path | -|-------------|-------------------------| -| Main | `/docs` | -| WebUI | `/api/v1/docs` | -| Ollama | `/ollama/docs` | -| OpenAI | `/openai/docs` | -| Images | `/images/api/v1/docs` | -| Audio | `/audio/api/v1/docs` | -| RAG | `/retrieval/api/v1/docs`| - -Each documentation portal offers interactive examples, schema descriptions, and testing capabilities to enhance your understanding and ease of use. - -By following these guidelines, you can swiftly integrate and begin utilizing the Open WebUI API. Should you encounter any issues or have questions, feel free to reach out through our Discord Community or consult the FAQs. Happy coding! ๐ŸŒŸ diff --git a/docs/getting-started/advanced-topics/EnvConfig.md b/docs/getting-started/advanced-topics/EnvConfig.md deleted file mode 100644 index e27bafe..0000000 --- a/docs/getting-started/advanced-topics/EnvConfig.md +++ /dev/null @@ -1,1146 +0,0 @@ ---- -sidebar_position: 4 -title: "๐ŸŒ Environment Variables" ---- - -## Overview - -Open WebUI provides a 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, including their types, default values, and descriptions. - -:::info -Last updated: v0.3.20 -::: - -## App/Backend - -The following environment variables are used by `backend/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](Logging#appbackend). - -### General - -#### `ENV` - -- Type: `str` (enum: `dev`, `prod`) -- Options: - - `dev` - Enables the FastAPI API docs on `/docs` - - `prod` - Automatically configures several environment variables -- Default: - - **Backend Default**: `dev` - - **Docker Default**: `prod` -- Description: Environment setting. - -#### `WEBUI_AUTH` - -- Type: `bool` -- Default Setting: `True` -- Description: This setting enables or disables authentication. - -:::danger -If set to `False`, authentication will be disabled for your Open WebUI instance. However, it's -important to note that turning off authentication is only possible for fresh installations without -any existing users. If there are already users registered, you cannot disable authentication -directly. Ensure that no users are present in the database, if you intend to turn off `WEBUI_AUTH`. -::: - -#### `WEBUI_NAME` - -- Type: `str` -- Default: `Open WebUI` -- Description: Sets the main WebUI name. Appends `(Open WebUI)` if overridden. - -#### `WEBUI_URL` - -- Type: `str` -- Default: `http://localhost:3000` -- Description: Specifies the URL where the Open WebUI is reachable. Currently used for search engine support. - -#### `AIOHTTP_CLIENT_TIMEOUT` - -- Type: `int` -- Default: `300` -- Description: Specifies the timeout duration in seconds for the aiohttp client. - -:::info -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. -::: - -#### `DATA_DIR` - -- Type: `str` -- Default: `./data` -- Description: Specifies the base directory for data storage, including uploads, cache, vector database, etc. - -#### `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. - -#### `CUSTOM_NAME` - -- Type: `str` -- Description: Sets `WEBUI_NAME` but polls **api.openwebui.com** for metadata. - -#### `ENABLE_SIGNUP` - -- Type: `bool` -- Default: `True` -- Description: Toggles user account creation. - -#### `ENABLE_LOGIN_FORM` - -- Type: `bool` -- Default: `True` -- Description: Toggles email, password, sign in and "or" (only when `ENABLE_OAUTH_SIGNUP` is set to True) elements. - -:::danger -This should **only** ever be set to `False` when [ENABLE_OAUTH_SIGNUP](EnvConfig) -is also being used and set to `True`. Failure to do so will result in the inability to login. -::: - -#### `ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION` - -- Type: `bool` -- Default: `True` -- Description: Bypass SSL Verification for RAG on Websites. - -#### `DEFAULT_MODELS` - -- Type: `str` -- Description: Sets a default Language Model. - -#### `DEFAULT_USER_ROLE` - -- Type: `str` (enum: `pending`, `user`, `admin`) -- 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. - -#### `USER_PERMISSIONS_CHAT_DELETION` - -- Type: `bool` -- Default: `True` -- Description: Toggles user permission to delete chats. - -#### `USER_PERMISSIONS_CHAT_EDITING` - -- Type: `bool` -- Default: `True` -- Description: Toggles user permission to edit chats. - -#### `USER_PERMISSIONS_CHAT_TEMPORARY` - -- Type: `bool` -- Default: `True` -- Description: Toggles user permission to create temporary chats. - -#### `ENABLE_MODEL_FILTER` - -- Type: `bool` -- Default: `False` -- Description: Toggles Language Model filtering. - -#### `MODEL_FILTER_LIST` - -- Type: `str` -- Description: Sets the Language Model filter list, semicolon-separated -- Example: `llama3.1:instruct;gemma2:latest` - -#### `WEBHOOK_URL` - -- Type: `str` -- Description: Sets a webhook for integration with Slack/Microsoft Teams. - -#### `ENABLE_ADMIN_EXPORT` - -- Type: `bool` -- Default: `True` -- Description: Controls whether admin users can export data. - -#### `ENABLE_ADMIN_CHAT_ACCESS` - -- Type: `bool` -- Default: `True` -- Description: Enables admin users to access all chats. - -#### `ENABLE_COMMUNITY_SHARING` - -- Type: `bool` -- Default: `True` -- Description: Controls whether users are shown the share to community button. - -#### `ENABLE_MESSAGE_RATING` - -- Type: `bool` -- Default: `True` -- Description: Enables message rating feature. - -#### `WEBUI_BUILD_HASH` - -- Type: `str` -- Default: `dev-build` -- Description: Used for identifying the Git SHA of the build for releases. - -#### `WEBUI_BANNERS` - -- Type: `list` of `dict` -- Default: `[]` -- Description: List of banners to show to users. Format of banners are: - -```json -[{"id": "string","type": "string [info, success, warning, error]","title": "string","content": "string","dismissible": False,"timestamp": 1000}] -``` - -#### `WEBUI_AUTH_TRUSTED_EMAIL_HEADER` - -- Type: `str` -- Description: Defines the trusted request header for authentication. See [SSO docs](/tutorials/features/sso). - -#### `WEBUI_AUTH_TRUSTED_NAME_HEADER` - -- Type: `str` -- Description: Defines the trusted request header for the username of anyone registering with the -`WEBUI_AUTH_TRUSTED_EMAIL_HEADER` header. See [SSO docs](/tutorials/features/sso). - -#### `WEBUI_SECRET_KEY` - -- Type: `str` -- Default: `t0p-s3cr3t` -- Docker Default: Randomly generated on first start -- Description: Overrides the randomly generated string used for JSON Web Token. - -#### `JWT_EXPIRES_IN` - -- Type: `int` -- Default: `-1` -- Description: Sets the JWT expiration time in seconds. A value of -1 disables expiration. - -#### `USE_CUDA_DOCKER` - -- Type: `bool` -- Default: `False` -- Description: Builds the Docker image with NVIDIA CUDA support. Enables GPU acceleration -for local Whisper and embeddings. - -#### `DATABASE_URL` - -- Type: `str` -- Default: `sqlite:///${DATA_DIR}/webui.db` -- Description: Specifies the database URL to connect to. - -:::info -Supports SQLite and Postgres. Changing the URL does not migrate data between databases. -Documentation on URL scheme available [here](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls). -::: - -#### `DATABASE_POOL_SIZE` - -- Type: `int` -- Default: `0` -- Description: Specifies the size of the database pool. A value of `0` disables pooling. - -#### `DATABASE_POOL_MAX_OVERFLOW` - -- Type: `int` -- Default: `0` -- Description: Specifies the database pool max overflow. - -:::info -More information about this setting can be found [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.max_overflow). -::: - -#### `DATABASE_POOL_TIMEOUT` - -- Type: `int` -- Default: `30` -- Description: Specifies the database pool timeout in seconds to get a connection. - -:::info -More information about this setting can be found [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.timeout). -::: - -#### `DATABASE_POOL_RECYCLE` - -- Type: `int` -- Default: `3600` -- Description: Specifies the database pool recycle time in seconds. - -:::info -More information about this setting can be found [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#setting-pool-recycle). -::: - -#### `PORT` - -- Type: `int` -- Default: `8080` -- Description: Sets the port to run Open WebUI from. - -#### `RESET_CONFIG_ON_START` - -- Type: `bool` -- Default: `False` -- Description: Resets the `config.json` file on startup. - -#### `DEFAULT_LOCALE` - -- Type: `str` -- Default: `en` -- Description: Sets the default locale for the application. - -#### `FUNCTIONS_DIR` - -- Type: `str` -- Default: `./functions` -- Description: Specifies the directory for custom functions. - -#### `SHOW_ADMIN_DETAILS` - -- Type: `bool` -- Default: `True` -- Description: Toggles whether to show admin user details in the interface. - -#### `ADMIN_EMAIL` - -- Type: `str` -- Description: Sets the admin email shown by `SHOW_ADMIN_DETAILS` - -#### `SAFE_MODE` - -- Type: `bool` -- Default: `False` -- Description: Enables safe mode, which disables potentially unsafe features. - -#### `WEBUI_SESSION_COOKIE_SAME_SITE` - -- Type: `str` (enum: `lax`, `strict`, `none`) -- Options: - - `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. -- Default: `lax` -- Description: Sets the `SameSite` attribute for session cookies. - -#### `WEBUI_SESSION_COOKIE_SECURE` - -- Type: `bool` -- Default: `False` -- Description: Sets the `Secure` attribute for session cookies if set to `True`. - -#### `AIOHTTP_CLIENT_TIMEOUT` - -- Type: `int` -- Description: Sets the timeout in seconds for internal aiohttp connections. This impacts things -such as connections to Ollama and OpenAI endpoints. - -#### `FONTS_DIR` - -- Type: `str` -- Description: Specifies the directory for fonts. - -### Ollama - -#### `ENABLE_OLLAMA_API` - -- Type: `bool` -- Default: `True` -- Description: Enables the use of Ollama APIs. - -#### `OLLAMA_BASE_URL` - -- Type: `str` -- Default: `http://localhost:11434` -- Docker Default: - - 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` -- Description: Configures the Ollama backend URL. - -#### `OLLAMA_BASE_URLS` - -- Type: `str` -- Description: Configures load-balanced Ollama backend hosts, separated by `;`. See -[`OLLAMA_BASE_URL`](#ollama_base_url). Takes precedence over[`OLLAMA_BASE_URL`](#ollama_base_url). - -#### `USE_OLLAMA_DOCKER` - -- Type: `bool` -- Default: `False` -- Description: Builds the Docker image with a bundled Ollama instance. - -#### `K8S_FLAG` - -- Type: `bool` -- Description: If set, assumes Helm chart deployment and sets [`OLLAMA_BASE_URL`](#ollama_base_url) to `http://ollama-service.open-webui.svc.cluster.local:11434` - -### OpenAI - -#### `ENABLE_OPENAI_API` - -- Type: `bool` -- Default: `True` -- Description: Enables the use of OpenAI APIs. - -#### `OPENAI_API_BASE_URL` - -- Type: `str` -- Default: `https://api.openai.com/v1` -- Description: Configures the OpenAI base API URL. - -#### `OPENAI_API_BASE_URLS` - -- Type: `str` -- Description: Supports balanced OpenAI base API URLs, semicolon-separated. -- Example: `http://host-one:11434;http://host-two:11434` - -#### `OPENAI_API_KEY` - -- Type: `str` -- Description: Sets the OpenAI API key. - -#### `OPENAI_API_KEYS` - -- Type: `str` -- Description: Supports multiple OpenAI API keys, semicolon-separated. -- Example: `sk-124781258123;sk-4389759834759834` - -### 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. - -#### `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. - -#### `TITLE_GENERATION_PROMPT_TEMPLATE` - -- Type: `str` -- Description: Prompt to use when generating chat titles. -- Default: - -``` -Create a concise, 3-5 word title with an emoji as a title for the prompt in the given language. Suitable Emojis for the summary can be used to enhance understanding but avoid quotation marks or special formatting. RESPOND ONLY WITH THE TITLE TEXT. - -Examples of titles: -๐Ÿ“‰ Stock Market Trends -๐Ÿช Perfect Chocolate Chip Recipe -Evolution of Music Streaming -Remote Work Productivity Tips -Artificial Intelligence in Healthcare -๐ŸŽฎ Video Game Development Insights - -Prompt: {{prompt:middletruncate:8000}} -``` - -#### `SEARCH_QUERY_GENERATION_PROMPT_TEMPLATE` - -- Type: `str` -- Description: Prompt to use when generating search queries. -- Default: - -``` -Assess the need for a web search based on the current question and prior interactions, but lean towards suggesting a Google search query if uncertain. Generate a Google search query even when the answer might be straightforward, as additional information may enhance comprehension or provide updated data. If absolutely certain that no further information is required, return an empty string. Default to a search query if unsure or in doubt. Today's date is {{CURRENT_DATE}}. - -Current Question: -{{prompt:end:4000}} - -Interaction History: -{{MESSAGES:END:6}} -``` - -#### `TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE` - -- Type: `str` -- Description: Prompt to use when calling tools. -- Default: - -``` -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. -``` - -#### `CORS_ALLOW_ORIGIN` - -- Type: `str` -- Default: `*` -- Description: Sets the allowed origins for Cross-Origin Resource Sharing (CORS). - -### RAG - -#### `DOCS_DIR` - -- Type: `str` -- Default: `${DATA_DIR}/docs` -- Description: Specifies the directory scanned for documents to add to the RAG database when triggered. - -#### `VECTOR_DB` - -- Type: `str` -- Default: `chroma` -- Description: Specifies which vector database system to use, either 'chroma' for ChromaDB or 'milvus' for Milvus. This setting determines which vector storage system will be used for managing embeddings. - -#### `CHROMA_TENANT` - -- Type: `str` -- Default: `default_tenant` -- Description: Sets the tenant for ChromaDB to use for RAG embeddings. - -#### `CHROMA_DATABASE` - -- Type: `str` -- Default: `default_database` -- Description: Sets the database in the ChromaDB tenant to use for RAG embeddings. - -#### `CHROMA_HTTP_HOST` - -- Type: `str` -- Description: Specifies the hostname of a remote ChromaDB Server. Uses a local ChromaDB instance if not set. - -#### `CHROMA_HTTP_PORT` - -- Type: `int` -- Default: `8000` -- Description: Specifies the port of a remote ChromaDB Server. - -#### `CHROMA_HTTP_HEADERS` - -- Type: `str` -- Description: Comma-separated list of HTTP headers to include with every ChromaDB request. -- Example: `Authorization=Bearer heuhagfuahefj,User-Agent=OpenWebUI`. - -#### `CHROMA_HTTP_SSL` - -- Type: `bool` -- Default: `False` -- Description: Controls whether or not SSL is used for ChromaDB Server connections. - -#### `MILVUS_URI` - -- Type: `str` -- Default: `${DATA_DIR}/vector_db/milvus.db` -- Description: 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. - -#### `RAG_TOP_K` - -- Type: `int` -- Default: `5` -- Description: Sets the default number of results to consider when using RAG. - -#### `RAG_RELEVANCE_THRESHOLD` - -- Type: `float` -- Default: `0.0` -- Description: Sets the relevance threshold to consider for documents when used with reranking. - -#### `ENABLE_RAG_HYBRID_SEARCH` - -- Type: `bool` -- Default: `False` -- Description: Enables the use of ensemble search with `BM25` + `ChromaDB`, with reranking using -`sentence_transformers` models. - -#### `ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION` - -- Type: `bool` -- Default: `True` -- Description: Enables TLS certification verification when browsing web pages for RAG. - -#### `RAG_EMBEDDING_ENGINE` - -- Type: `str` (enum: `ollama`, `openai`) -- Options: - - Leave empty for `Default (SentenceTransformers)` - Uses SentenceTransformers for embeddings. - - `ollama` - Uses the Ollama API for embeddings. - - `openai` - Uses the OpenAI API for embeddings. -- Description: Selects an embedding engine to use for RAG. - -#### `PDF_EXTRACT_IMAGES` - -- Type: `bool` -- Default: `False` -- Description: Extracts images from PDFs using OCR when loading documents. - -#### `RAG_EMBEDDING_MODEL` - -- Type: `str` -- Default: `sentence-transformers/all-MiniLM-L6-v2` -- Description: Sets a model for embeddings. Locally, a Sentence-Transformer model is used. - -#### `RAG_EMBEDDING_MODEL_AUTO_UPDATE` - -- Type: `bool` -- Default: `False` -- Description: Toggles automatic update of the Sentence-Transformer model. - -#### `RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE` - -- Type: `bool` -- Default: `False` -- Description: Determines whether or not to allow custom models defined on the Hub in their own modeling files. - -#### `RAG_TEMPLATE` - -- Type: `str` -- Default: - -``` -You are given a user query, some textual context and rules, all inside xml tags. You have to answer the query based on the context while respecting the rules. - - -[context] - - - -- If you don't know, just say so. -- If you are not sure, ask for clarification. -- Answer in the same language as the user query. -- If the context appears unreadable or of poor quality, tell the user then answer as best as you can. -- If the answer is not in the context but you think you know the answer, explain that to the user then answer with your own knowledge. -- Answer directly and without using xml tags. - - - -[query] - -``` - -- Description: Template to use when injecting RAG documents into chat completion - -#### `RAG_RERANKING_MODEL` - -- Type: `str` -- Description: Sets a model for reranking results. Locally, a Sentence-Transformer model is used. - -#### `RAG_RERANKING_MODEL_AUTO_UPDATE` - -- Type: `bool` -- Default: `False` -- Description: Toggles automatic update of the reranking model. - -#### `RAG_RERANKING_MODEL_TRUST_REMOTE_CODE` - -- Type: `bool` -- Default: `False` -- Description: Determines whether or not to allow custom models defined on the Hub in their own -modeling files for reranking. - -#### `RAG_OPENAI_API_BASE_URL` - -- Type: `str` -- Default: `${OPENAI_API_BASE_URL}` -- Description: Sets the OpenAI base API URL to use for RAG embeddings. - -#### `RAG_OPENAI_API_KEY` - -- Type: `str` -- Default: `${OPENAI_API_KEY}` -- Description: Sets the OpenAI API key to use for RAG embeddings. - -#### `RAG_EMBEDDING_OPENAI_BATCH_SIZE` - -- Type: `int` -- Default: `1` -- Description: Sets the batch size for OpenAI embeddings. - -#### `ENABLE_RAG_LOCAL_WEB_FETCH` - -- Type: `bool` -- Default: `False` -- Description: Enables local web fetching for RAG. Enabling this allows Server Side Request -Forgery attacks against local network resources. - -#### `YOUTUBE_LOADER_LANGUAGE` - -- Type: `str` -- Default: `en` -- Description: Sets the language to use for YouTube video loading. - -#### `CHUNK_SIZE` - -- Type: `int` -- Default: `1500` -- Description: Sets the document chunk size for embeddings. - -#### `CHUNK_OVERLAP` - -- Type: `int` -- Default: `100` -- Description: Specifies how much overlap there should be between chunks. - -#### `CONTENT_EXTRACTION_ENGINE` - -- Type: `str` (`tika`) -- Options: - - Leave empty to use default - - `tika` - Use a local Apache Tika server -- Description: Sets the content extraction engine to use for document ingestion. - -#### `TIKA_SERVER_URL` - -- Type: `str` -- Default: `http://localhost:9998` -- Description: Sets the URL for the Apache Tika server. - -#### `RAG_FILE_MAX_COUNT` - -- Type: `int` -- Default: `10` -- Description: Sets the maximum number of files that can be uploaded at once for document ingestion. - -#### `RAG_FILE_MAX_SIZE` - -- Type: `int` -- Default: `100` (100MB) -- Description: Sets the maximum size of a file that can be uploaded for document ingestion. - -### Web Search - -#### `ENABLE_RAG_WEB_SEARCH` - -- Type: `bool` -- Default: `False` -- Description: Enable web search toggle - -#### `ENABLE_SEARCH_QUERY` - -- Type: `bool` -- Default: `False` -- Description: Enables the generation of search queries from prompts - -#### `RAG_WEB_SEARCH_ENGINE` - -- Type: `str` (enum: `searxng`, `google_pse`, `brave`, `serpstack`, `serper`, `serply`, `searchapi`, `duckduckgo`, `tavily`, `jina`) -- Options: - - `searxng` - Uses the [SearXNG](https://github.com/searxng/searxng) search engine. - - `google_pse` - Uses the [Google Programmable Search Engine](https://programmablesearchengine.google.com/about/). - - `brave` - Uses the [Brave search engine](https://brave.com/search/api/). - - `serpstack` - Uses the [Serpstack search engine](https://serpstack.com/). - - `serper` - Uses the [Serper search engine](https://serper.dev/). - - `serply` - Uses the [Serply search engine](https://serply.io/). - - `searchapi` - Uses the [SearchAPI search engine](https://www.searchapi.io/). - - `duckduckgo` - Uses the [DuckDuckGo search engine](https://duckduckgo.com/). - - `tavily` - Uses the [Tavily search engine](https://tavily.com/). - - `jina` - Uses the [Jina search engine](https://jina.ai/). -- Description: Select engine for performing searches - -#### `SEARXNG_QUERY_URL` - -- Type: `str` -- Description: The [SearXNG search API](https://docs.searxng.org/dev/search_api.html) URL supporting JSON output. `` is replaced with -the search query. Example: `http://searxng.local/search?q=` - -#### `GOOGLE_PSE_API_KEY` - -- Type: `str` -- Description: The API key for the Google Programmable Search Engine (PSE) service. - -#### `GOOGLE_PSE_ENGINE_ID` - -- Type: `str` -- Description: The engine ID for the Google Programmable Search Engine (PSE) service. - -#### `BRAVE_SEARCH_API_KEY` - -- Type: `str` -- Description: The API key for the Brave Search API. - -#### `SERPSTACK_API_KEY` - -- Type: `str` -- Description: The API key for Serpstack search API. - -#### `SERPSTACK_HTTPS` - -- Type: `bool` -- Default: `True` -- Description: Configures the use of HTTPS for Serpstack requests. Free tier requests are restricted to HTTP only. - -#### `SERPER_API_KEY` - -- Type: `str` -- Description: The API key for the Serper search API. - -#### `SERPLY_API_KEY` - -- Type: `str` -- Description: The API key for the Serply search API. - -#### `TAVILY_API_KEY` - -- Type: `str` -- Description: The API key for the Tavily search API. - -#### `RAG_WEB_SEARCH_RESULT_COUNT` - -- Type: `int` -- Default: `3` -- Description: Maximum number of search results to crawl. - -#### `RAG_WEB_SEARCH_CONCURRENT_REQUESTS` - -- Type: `int` -- Default: `10` -- Description: Number of concurrent requests to crawl web pages returned from search results. - -#### `SEARCHAPI_API_KEY` - -- Type: `str` -- Description: Sets the SearchAPI API key. - -#### `SEARCHAPI_ENGINE` - -- Type: `str` -- Description: Sets the SearchAPI engine. - -### Speech to Text - -#### `AUDIO_STT_ENGINE` - -- Type: `str` (enum: `openai`) -- Options: - - Leave empty to use local Whisper engine for Speech-to-Text. - - `openai` - Uses OpenAI engine for Speech-to-Text. -- Description: Specifies the Speech-to-Text engine to use. - -#### `AUDIO_STT_OPENAI_API_BASE_URL` - -- Type: `str` -- Default: `${OPENAI_API_BASE_URL}` -- Description: Sets the OpenAI-compatible base URL to use for Speech-to-Text. - -#### `AUDIO_STT_OPENAI_API_KEY` - -- Type: `str` -- Default: `${OPENAI_API_KEY}` -- Description: Sets the OpenAI API key to use for Speech-to-Text. - -#### `AUDIO_STT_MODEL` - -- Type: `str` -- Default: `whisper-1` -- Description: Specifies the Speech-to-Text model to use for OpenAI-compatible endpoints. - -#### `WHISPER_MODEL` - -- Type: `str` -- Default: `base` -- Description: Sets the Whisper model to use for Speech-to-Text. The backend used is faster_whisper with quantization to `int8`. - -#### `WHISPER_MODEL_DIR` - -- Type: `str` -- Default: `${DATA_DIR}/cache/whisper/models` -- Description: Specifies the directory to store Whisper model files. - -#### `WHISPER_MODEL_AUTO_UPDATE` - -- Type: `bool` -- Default: `False` -- Description: Toggles automatic update of the Whisper model. - -### Text to Speech - -#### `AUDIO_TTS_ENGINE` - -- Type: `str` (enum: `elevenlabs`, `openai`) -- Options: - - Leave empty to use built-in WebAPI engine for Text-to-Speech. - - `elevenlabs` - Uses ElevenLabs engine for Text-to-Speech - - `openai` - Uses OpenAI engine for Text-to-Speech. -- Description: Specifies the Text-to-Speech engine to use. - -#### `AUDIO_TTS_API_KEY` - -- Type: `str` -- Description: Sets the API key for Text-to-Speech. - -#### `AUDIO_TTS_OPENAI_API_BASE_URL` - -- Type: `str` -- Default: `${OPENAI_API_BASE_URL}` -- Description: Sets the OpenAI-compatible base URL to use for text-to-speech. - -#### `AUDIO_TTS_OPENAI_API_KEY` - -- Type: `str` -- Default: `${OPENAI_API_KEY}` -- Description: Sets the API key to use for text-to-speech. - -#### `AUDIO_TTS_MODEL` - -- Type: `str` -- Default: `tts-1` -- Description: Specifies the OpenAI text-to-speech model to use. - -#### `AUDIO_TTS_VOICE` - -- Type: `str` -- Default: `alloy` -- Description: Sets the OpenAI text-to-speech voice to use. - -#### `AUDIO_TTS_SPLIT_ON` - -- Type: `str` -- Default: `punctuation` -- Description: Sets the OpenAI text-to-speech split on to use. - -### Image Generation - -#### `ENABLE_IMAGE_GENERATION` - -- Type: `bool` -- Default: `False` -- Description: Enables or disables image generation features. - -#### `IMAGE_GENERATION_ENGINE` - -- Type: `str` (enum: `openai`, `comfyui`, `automatic1111`) -- Options: - - `openai` - Uses OpenAI DALL-E for image generation. - - `comfyui` - Uses ComfyUI engine for image generation. - - `automatic1111` - Uses Automatic1111 engine for image generation (default). -- Default: `automatic1111` -- Description: Specifies the engine to use for image generation. - -#### `AUTOMATIC1111_BASE_URL` - -- Type: `str` -- Description: Specifies the URL to Automatic1111's Stable Diffusion API. - -#### `AUTOMATIC1111_API_AUTH` - -- Type: `str` -- Description: Sets the Automatic1111 API authentication. - -#### `COMFYUI_BASE_URL` - -- Type: `str` -- Description: Specifies the URL to the ComfyUI image generation API. - -#### `COMFYUI_WORKFLOW` - -- Type: `str` -- Description: Sets the ComfyUI workflow. - -#### `IMAGES_OPENAI_API_BASE_URL` - -- Type: `str` -- Default: `${OPENAI_API_BASE_URL}` -- Description: Sets the OpenAI-compatible base URL to use for DALL-E image generation. - - -#### `IMAGES_OPENAI_API_KEY` - -- Type: `str` -- Default: `${OPENAI_API_KEY}` -- Description: Sets the API key to use for DALL-E image generation. - -#### `IMAGE_GENERATION_MODEL` - -- Type: `str` -- Description: Default model to use for image generation - -#### `IMAGE_SIZE` - -- Type: `str` -- Default: `512x512` -- Description: Sets the default image size to generate. - -#### `IMAGE_STEPS` - -- Type: `int` -- Default: `50` -- Description: Sets the default iteration steps for image generation. Used for ComfyUI and AUTOMATIC1111. - -### OAuth - -#### `ENABLE_OAUTH_SIGNUP` - -- Type: `bool` -- Default: `False` -- Description: Enables user account creation via OAuth. - -#### `OAUTH_MERGE_ACCOUNTS_BY_EMAIL` - -- Type: `bool` -- Default: `False` -- Description: If enabled, merges OAuth accounts with existing accounts using the same email -address. This is considered unsafe as providers may not verify email addresses and can lead to -account takeovers. - -#### `OAUTH_USERNAME_CLAIM` - -- Type: `str` -- Default: `name` -- Description: Set username claim for OpenID. - -#### `OAUTH_EMAIL_CLAIM` - -- Type: `str` -- Default: `email` -- Description: Set email claim for OpenID. - -#### `OAUTH_PICTURE_CLAIM` - -- Type: `str` -- Default: `picture` -- Description: Set picture (avatar) claim for OpenID. - -#### `OAUTH_CLIENT_ID` - -- Type: `str` -- Description: Sets the client ID for OIDC - -#### `OAUTH_CLIENT_SECRET` - -- Type: `str` -- Description: Sets the client secret for OIDC - -#### `OAUTH_SCOPES` - -- Type: `str` -- Default: `openid email profile` -- Description: Sets the scope for OIDC authentication. `openid` and `email` are required. - -#### `OAUTH_PROVIDER_NAME` - -- Type: `str` -- Default: `SSO` -- Description: Sets the name for the OIDC provider. - -#### `ENABLE_OAUTH_ROLE_MANAGEMENT` - -- Type: `bool` -- Default: `False` -- Description: Enables role management to oauth delegation. - -#### `OAUTH_ROLES_CLAIM` - -- Type: `str` -- Default: `roles` -- Description: Sets the roles claim to look for in the OIDC token. - -#### `OAUTH_ALLOWED_ROLES` - -- Type: `str` -- Default: `user,admin` -- Description: Sets the roles that are allowed access to the platform. - -#### `OAUTH_ADMIN_ROLES` - -- Type: `str` -- Default: `admin` -- Description: Sets the roles that are considered administrators. - -#### `GOOGLE_CLIENT_ID` - -- Type: `str` -- Description: Sets the client ID for Google OAuth - -#### `GOOGLE_CLIENT_SECRET` - -- Type: `str` -- Description: Sets the client secret for Google OAuth - -#### `GOOGLE_OAUTH_SCOPE` - -- Type: `str` -- Default: `openid email profile` -- Description: Sets the scope for Google OAuth authentication. - -#### `GOOGLE_REDIRECT_URI` - -- Type: `str` -- Description: Sets the redirect URI for Google OAuth - -#### `MICROSOFT_CLIENT_ID` - -- Type: `str` -- Description: Sets the client ID for Microsoft OAuth - -#### `MICROSOFT_CLIENT_SECRET` - -- Type: `str` -- Description: Sets the client secret for Microsoft OAuth - -#### `MICROSOFT_CLIENT_TENANT_ID` - -- Type: `str` -- Description: Sets the tenant ID for Microsoft OAuth - -#### `MICROSOFT_OAUTH_SCOPE` - -- Type: `str` -- Default: `openid email profile` -- Description: Sets the scope for Microsoft OAuth authentication. - -#### `MICROSOFT_REDIRECT_URI` - -- Type: `str` -- Description: Sets the redirect URI for Microsoft OAuth - -#### `OPENID_PROVIDER_URL` - -- Type: `str` -- Description: Path to the `.well-known/openid-configuration` endpoint - -#### `OPENID_REDIRECT_URI` - -- Type: `str` -- Description: Sets the redirect URI for OIDC - -### Tools - -#### `TOOLS_DIR` - -- Type: `str` -- Default: `${DATA_DIR}/tools` -- Description: Specifies the directory for custom tools. - -## Misc Environment Variables - -These variables are not specific to Open WebUI but can still be valuable in certain contexts. - -### Proxy Settings - -Open WebUI supports using proxies for HTTP and HTTPS retrievals. To specify proxy settings, -Open WebUI uses the following environment variables: - -#### `http_proxy` - -- Type: `str` -- Description: Sets the URL for the HTTP proxy. - -#### `https_proxy` - -- Type: `str` -- Description: Sets the URL for the HTTPS proxy. - -#### `no_proxy` - -- Type: `str` -- Description: 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. diff --git a/docs/getting-started/advanced-topics/Development.md b/docs/getting-started/advanced-topics/development.md similarity index 100% rename from docs/getting-started/advanced-topics/Development.md rename to docs/getting-started/advanced-topics/development.md diff --git a/docs/getting-started/env-configuration.md b/docs/getting-started/advanced-topics/env-configuration.md similarity index 100% rename from docs/getting-started/env-configuration.md rename to docs/getting-started/advanced-topics/env-configuration.md diff --git a/docs/getting-started/advanced-topics/HttpsEncryption.md b/docs/getting-started/advanced-topics/https-encryption.md similarity index 100% rename from docs/getting-started/advanced-topics/HttpsEncryption.md rename to docs/getting-started/advanced-topics/https-encryption.md diff --git a/docs/getting-started/advanced-topics/Logging.md b/docs/getting-started/advanced-topics/logging.md similarity index 100% rename from docs/getting-started/advanced-topics/Logging.md rename to docs/getting-started/advanced-topics/logging.md diff --git a/docs/getting-started/development.mdx b/docs/getting-started/development.mdx deleted file mode 100644 index cc13537..0000000 --- a/docs/getting-started/development.mdx +++ /dev/null @@ -1,199 +0,0 @@ ---- -sidebar_position: 6 -title: "๐Ÿ› ๏ธ Development Guide" ---- -import { TopBanners } from "@site/src/components/TopBanners"; - - - -Welcome to the Open WebUI Development Setup Guide! ๐ŸŒŸ Whether you're a novice or a veteran in the software development world, this guide is designed to assist you in establishing a functional local development environment for both the frontend and backend components of Open WebUI. Let's get started and set up your development environment swiftly! ๐Ÿš€ - -## System Requirements - -Before diving into the setup, make sure your system meets the following requirements: -- **Operating System**: Linux (WSL) or macOS (Instructions provided here specifically cater to these operating systems) -- **Python Version**: Python 3.11 - -## ๐Ÿง Linux/macOS Setup Guide - -This section provides a step-by-step process to get your development environment ready on Linux (WSL) or macOS platforms. - -### ๐Ÿ“ก Cloning the Repository - -First, you'll need to clone the Open WebUI repository and switch to the directory: - -```sh -git clone https://github.com/open-webui/open-webui.git -cd open-webui -``` - -### ๐Ÿ–ฅ๏ธ Frontend Server Setup - -To set up the frontend server, follow these instructions: - -1. **Environment Configuration**: - Duplicate the environment configuration file: - - ```sh - cp -RPp .env.example .env - ``` - -2. **Install Dependencies**: - Run the following commands to install necessary dependencies: - - ```sh - npm install - ``` - -3. **Launch the Server**: - Start the server with: - - ```sh - npm run dev - ``` - - ๐ŸŒ The frontend server will be available at: http://localhost:5173. Please note that for the frontend server to function correctly, the backend server should be running concurrently. - -### ๐Ÿ–ฅ๏ธ Backend Server Setup - -Setting up the backend server involves a few more steps, Python 3.11 is required for Open WebUI: - -1. **Change Directory**: - Open a new terminal window and navigate to the backend directory: - - ```sh - cd open-webui/backend - ``` - -2. **Python Environment Setup** (Using Conda Recommended): - - Create and activate a Conda environment with Python 3.11: - - ```sh - conda create --name open-webui python=3.11 - conda activate open-webui - ``` - -3. **Install Backend Dependencies**: - Install all the required Python libraries: - - ```sh - pip install -r requirements.txt -U - ``` - -4. **Start the Backend Application**: - Launch the backend application with: - - ```sh - sh dev.sh - ``` - - ๐Ÿ“„ Access the backend API documentation at: http://localhost:8080/docs. The backend supports hot reloading, making your development process smoother by automatically reflecting changes. - -That's it! You now have both the frontend and backend servers running. Explore the API documentation and start developing features for Open WebUI. Happy coding! ๐ŸŽ‰ - -## ๐Ÿณ Running in a Docker Container - -For those who prefer using Docker, here's how you can set things up: - -1. **Initialize Configuration:** - Assuming you have already cloned the repository and created a `.env` file, create a new file named `compose-dev.yaml`. This configuration uses Docker Compose to ease the development setup. - -```yaml -name: open-webui-dev - -services: - frontend: - build: - context: . - target: build - command: ["npm", "run", "dev"] - depends_on: - - backend - extra_hosts: - - host.docker.internal:host-gateway - ports: - - "3000:5173" - develop: - watch: - path: ./src - action: sync - - backend: - build: - context: . - target: base - command: ["bash", "dev.sh"] - env_file: ".env" - environment: - - ENV=dev - - WEBUI_AUTH=False - volumes: - - data:/app/backend/data - extra_hosts: - - host.docker.internal:host-gateway - ports: - - "8080:8080" - restart: always - develop: - watch: - path: ./backend - action: sync - -volumes: - data: {} - -``` - -2. **Start Development Containers:** - -```sh -docker compose -f compose-dev.yaml up --watch -``` - -This command will start the frontend and backend servers in hot reload mode. Changes in your source files will trigger an automatic refresh. The web app will be available at http://localhost:3000 and Backend API docs at http://localhost:8080/docs. - -3. **Stopping the Containers:** - -To stop the containers, you can use: - -```sh -docker compose -f compose-dev.yaml down -``` - -### ๐Ÿ”„ Integration with Pipelines - -If your development involves [Pipelines](https://docs.openwebui.com/pipelines/), you can enhance your Docker setup: - -```yaml -services: - pipelines: - ports: - - "9099:9099" - volumes: - - ./pipelines:/app/pipelines - extra_hosts: - - host.docker.internal:host-gateway - restart: always -``` - -This setup involves mounting the `pipelines` directory to ensure any changes reflect immediately, maintaining high development agility. - -:::note -This configuration uses volume bind-mounts. Learn more about how they differ from named volumes [here](https://docs.docker.com/storage/bind-mounts/). -::: - -## ๐Ÿ› Troubleshooting - -### FATAL ERROR: Reached heap limit - -When you encounter a memory-related error during the Docker build processโ€”especially while executing `npm run build`โ€”it typically indicates that the JavaScript heap has exceeded its memory limit. One effective solution is to increase the memory allocated to Node.js by adjusting the `NODE_OPTIONS` environment variable. This allows you to set a higher maximum heap size, which can help prevent out-of-memory errors during the build process. If you encounter this issue, try to allocate at least 4 GB of RAM, or higher if you have enough RAM. - -You can increase the memory allocated to Node.js by adding the following line just before `npm run build` in the `Dockerfile`. - -```docker title=/Dockerfile -ENV NODE_OPTIONS=--max-old-space-size=4096 -``` - ---- - -Through these setup steps, both new and experienced contributors can seamlessly integrate into the development workflow of Open WebUI. Happy coding! ๐ŸŽ‰ diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md deleted file mode 100644 index a83b1be..0000000 --- a/docs/getting-started/installation.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -sidebar_position: 1 -title: "๐Ÿ”ง Alternative Installation" ---- - -### Installing Both Ollama and Open WebUI Using Kustomize - -For a CPU-only Pod: - -```bash -kubectl apply -k ./kubernetes/manifest/base -``` - -For a GPU-enabled Pod: - -```bash -kubectl apply -k ./kubernetes/manifest/gpu -``` - -### Installing Both Ollama and Open WebUI Using Helm - -:::info - - The Helm installation method has been migrated to the new GitHub repository. Please refer to - the latest installation instructions at [https://github.com/open-webui/helm-charts](https://github.com/open-webui/helm-charts). - -::: - -Confirm that Helm has been deployed on your execution environment. -For installation instructions, visit [https://helm.sh/docs/intro/install/](https://helm.sh/docs/intro/install/). - -```bash -helm repo add open-webui https://helm.openwebui.com/ -helm repo update - -kubectl create namespace open-webui -helm upgrade --install open-webui open-webui/open-webui --namespace open-webui -``` - -For additional customization options, refer to the [kubernetes/helm/values.yaml](https://github.com/open-webui/helm-charts/tree/main/charts/open-webui) file. diff --git a/docs/getting-started/logging.md b/docs/getting-started/logging.md deleted file mode 100644 index beeb9e8..0000000 --- a/docs/getting-started/logging.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -sidebar_position: 3 -title: "๐Ÿ“œ Open WebUI Logging" ---- - -## Browser Client Logging ## - -Client logging generally occurs via [JavaScript](https://developer.mozilla.org/en-US/docs/Web/API/console/log_static) `console.log()` and can be accessed using the built-in browser-specific developer tools: -* Blink - * [Chrome/Chromium](https://developer.chrome.com/docs/devtools/) - * [Edge](https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/overview) -* Gecko - * [Firefox](https://firefox-source-docs.mozilla.org/devtools-user/) -* WebKit - * [Safari](https://developer.apple.com/safari/tools/) - -## Application Server/Backend Logging ## - -Logging is an ongoing work-in-progress but some level of control is available using environment variables. [Python Logging](https://docs.python.org/3/howto/logging.html) `log()` and `print()` statements send information to the console. The default level is `INFO`. Ideally, sensitive data will only be exposed with `DEBUG` level. - -### Logging Levels ### - -The following [logging levels](https://docs.python.org/3/howto/logging.html#logging-levels) values are supported: - -| Level | Numeric value | -| ---------- | ------------- | -| `CRITICAL` | 50 | -| `ERROR` | 40 | -| `WARNING` | 30 | -| `INFO` | 20 | -| `DEBUG` | 10 | -| `NOTSET` | 0 | - -### Global ### - -The default global log level of `INFO` can be overridden with the `GLOBAL_LOG_LEVEL` environment variable. When set, this executes a [basicConfig](https://docs.python.org/3/library/logging.html#logging.basicConfig) statement with the `force` argument set to *True* within `config.py`. This results in reconfiguration of all attached loggers: -> _If this keyword argument is specified as true, any existing handlers attached to the root logger are removed and closed, before carrying out the configuration as specified by the other arguments._ - -The stream uses standard output (`sys.stdout`). In addition to all Open-WebUI `log()` statements, this also affects any imported Python modules that use the Python Logging module `basicConfig` mechanism including [urllib](https://docs.python.org/3/library/urllib.html). - -For example, to set `DEBUG` logging level as a Docker parameter use: -``` ---env GLOBAL_LOG_LEVEL="DEBUG" -``` - -### App/Backend ### - -Some level of granularity is possible using any of the following combination of variables. Note that `basicConfig` `force` isn't presently used so these statements may only affect Open-WebUI logging and not 3rd party modules. - -| Environment Variable | App/Backend | -| -------------------- | ----------------------------------------------------------------- | -| `AUDIO_LOG_LEVEL` | Audio transcription using faster-whisper, TTS etc. | -| `COMFYUI_LOG_LEVEL` | ComfyUI integration handling | -| `CONFIG_LOG_LEVEL` | Configuration handling | -| `DB_LOG_LEVEL` | Internal Peewee Database | -| `IMAGES_LOG_LEVEL` | AUTOMATIC1111 stable diffusion image generation | -| `LITELLM_LOG_LEVEL` | LiteLLM proxy | -| `MAIN_LOG_LEVEL` | Main (root) execution | -| `MODELS_LOG_LEVEL` | LLM model interaction, authentication, etc. | -| `OLLAMA_LOG_LEVEL` | Ollama backend interaction | -| `OPENAI_LOG_LEVEL` | OpenAI interaction | -| `RAG_LOG_LEVEL` | Retrieval-Augmented Generation using Chroma/Sentence-Transformers | -| `WEBHOOK_LOG_LEVEL` | Authentication webhook extended logging | diff --git a/docs/getting-started/updating.md b/docs/getting-started/updating.md deleted file mode 100644 index bf44546..0000000 --- a/docs/getting-started/updating.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -sidebar_position: 2 -title: "๐Ÿ”„ Updating Open WebUI" ---- - -## Updating your Docker Installation - -Keeping your Open WebUI Docker installation up-to-date ensures you have the latest features and security updates. You can update your installation manually or use [Watchtower](https://containrrr.dev/watchtower/) for automatic updates. - -### Manual Update - -Follow these steps to manually update your Open WebUI: - -1. **Pull the Latest Docker Image**: - ```bash - docker pull ghcr.io/open-webui/open-webui:main - ``` - -2. **Stop and Remove the Existing Container**: - - This step ensures that you can create a new container from the updated image. - ```bash - docker stop open-webui - docker rm open-webui - ``` - -3. **Create a New Container with the Updated Image**: - - Use the same `docker run` command you used initially to create the container, ensuring all your configurations remain the same. - ```bash - docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main - ``` - -This process updates your Open WebUI container to the latest version while preserving your data stored in Docker volumes. - -### Updating with Watchtower - -For those who prefer automated updates, Watchtower can monitor your Open WebUI container and automatically update it to the latest version. You have two options with Watchtower: running it once for an immediate update, or deploying it persistently to automate future updates. - -#### Running Watchtower Once - -To update your container immediately without keeping Watchtower running continuously, use the following command. Replace `open-webui` with your container name if it differs. - -```bash -docker run --rm --volume /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once open-webui -``` - -#### Deploying Watchtower Persistently - -If you prefer Watchtower to continuously monitor and update your container whenever a new version is available, you can run Watchtower as a persistent service. This method ensures your Open WebUI always stays up to date without any manual intervention. Use the command below to deploy Watchtower in this manner: - -```bash -docker run -d --name watchtower --volume /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower open-webui -``` - -Remember to replace `open-webui` with the name of your container if you have named it differently. This configuration allows you to benefit from the latest improvements and security patches with minimal downtime and manual effort. - -### Updating Docker Compose Installation - -If you installed Open WebUI using Docker Compose, follow these steps to update: - -1. **Pull the Latest Images**: - - This command fetches the latest versions of the images specified in your `docker-compose.yml` files. - ```bash - docker compose pull - ``` - -2. **Recreate the Containers with the Latest Images**: - - This command recreates the containers based on the newly pulled images, ensuring your installation is up-to-date. No build step is required for updates. - ```bash - docker compose up -d - ``` - -This method ensures your Docker Compose-based installation of Open WebUI (and any associated services, like Ollama) is updated efficiently and without the need for manual container management. - -## Updating Your Direct Install - -For those who have installed Open WebUI directly without using Docker, updates are just as important to ensure access to the latest features and security patches. Remember, direct installations are not officially supported, and you might need to troubleshoot on your own. Here's how to update your installation: - -### Pull the Latest Changes - -Navigate to your Open WebUI project directory and pull the latest changes from the repository: - -```sh -cd path/to/open-webui/ -git pull origin main -``` - -Replace `path/to/open-webui/` with the actual path to your Open WebUI installation. - -### Update Dependencies - -After pulling the latest changes, update your project dependencies. This step ensures that both frontend and backend dependencies are up to date. - -- **For Node.js (Frontend):** - -```sh -npm install -npm run build -``` - -- **For Python (Backend):** - -```sh -cd backend -pip install -r requirements.txt -U -``` - -### Restart the Backend Server - -To apply the updates, you need to restart the backend server. If you have a running instance, stop it first and then start it again using the provided script. - -```sh -bash start.sh -``` - -This command should be run from within the `backend` directory of your Open WebUI project. - -:::info - -Direct installations require more manual effort to update compared to Docker-based installations. If you frequently need updates and want to streamline the process, consider transitioning to a Docker-based setup for easier management. - -::: - -By following these steps, you can update your direct installation of Open WebUI, ensuring you're running the latest version with all its benefits. Remember to back up any critical data or custom configurations before starting the update process to prevent any unintended loss. \ No newline at end of file diff --git a/docs/getting-started/using-openwebui/index.mdx b/docs/getting-started/using-openwebui/index.mdx index 7940aec..7f061bf 100644 --- a/docs/getting-started/using-openwebui/index.mdx +++ b/docs/getting-started/using-openwebui/index.mdx @@ -11,13 +11,17 @@ Explore the essential concepts and features of Open WebUI, including models, kno ## ๐Ÿ“ฅ Ollama Models Learn how to download, load, and use models effectively. -[Check out Ollama Models](./OllamaModels.mdx) +[Check out Ollama Models](./ollama-models.mdx) --- ## ๐Ÿ“š Terminology Understand key components: models, prompts, knowledge, functions, pipes, and actions. -[Read the Terminology Guide](./Terminology.mdx) +[Read the Terminology Guide](./terminology.mdx) + +## ๐ŸŒ Additional Resources and Integrations +Find community tools, integrations, and official resources. +[Additional Resources Guide](./resources) --- diff --git a/docs/getting-started/using-openwebui/OllamaModels.mdx b/docs/getting-started/using-openwebui/ollama-models.mdx similarity index 100% rename from docs/getting-started/using-openwebui/OllamaModels.mdx rename to docs/getting-started/using-openwebui/ollama-models.mdx diff --git a/docs/getting-started/using-openwebui/resources.mdx b/docs/getting-started/using-openwebui/resources.mdx new file mode 100644 index 0000000..477d9cd --- /dev/null +++ b/docs/getting-started/using-openwebui/resources.mdx @@ -0,0 +1,37 @@ +--- +sidebar_position: 400 +title: "๐ŸŒ Additional Resources and Integrations" +--- + +# ๐ŸŒ Additional Resources and Integrations + +Explore more resources, community tools, and integration options to make the most out of Open WebUI. + +--- + +## ๐Ÿ”ฅ Open WebUI Website +Visit [Open WebUI](https://openwebui.com/) for official documentation, tools, and resources: +- **Leaderboard**: Check out the latest high-ranking models, tools, and integrations. +- **Featured Models and Tools**: Discover models and tools created by community members. +- **New Integrations**: Find newly released integrations, plugins, and models to expand your setup. + +--- + +## ๐ŸŒ Community Platforms +Connect with the Open WebUI community for support, tips, and discussions. + +- **Discord**: Join our community on Discord to chat with other users, ask questions, and stay updated. + [Join the Discord Server](https://discord.com/invite/5rJgQTnV4s) +- **Reddit**: Follow the Open WebUI subreddit for announcements, discussions, and user-submitted content. + [Visit Reddit Community](https://www.reddit.com/r/OpenWebUI/) + +--- + +## ๐Ÿ“– Tutorials and User Guides +Explore community-created tutorials to enhance your Open WebUI experience: +- [Explore Community Tutorials](/category/-tutorials) +- Learn how to configure RAG and advanced integrations with the [RAG Configuration Guide](../../tutorials/tips/rag-tutorial.md). + +--- + +Stay connected and make the most out of Open WebUI through these community resources and integrations! diff --git a/docs/getting-started/using-openwebui/Terminology.mdx b/docs/getting-started/using-openwebui/terminology.mdx similarity index 100% rename from docs/getting-started/using-openwebui/Terminology.mdx rename to docs/getting-started/using-openwebui/terminology.mdx