pip install

This commit is contained in:
DrMelone
2026-02-19 20:32:33 +01:00
parent 6b34253f9e
commit a23497346c
3 changed files with 28 additions and 2 deletions

View File

@@ -6366,6 +6366,32 @@ bypassed when accessing documents from MIT.
Open WebUI provides environment variables to customize the pip installation process. Below are the environment variables used by Open WebUI for adjusting package installation behavior:
#### `ENABLE_AUTO_DEPENDENCY_INSTALL`
- Type: `bool`
- Default: `True`
- Description: Controls whether Open WebUI automatically runs `pip install` for Python packages declared in function and tool `requirements` frontmatter. When enabled, dependencies are installed at runtime — both on startup (for all active functions and admin tools) and when saving a function or tool with new requirements.
:::warning Security Hardening for Production
**Strongly recommended: set `ENABLE_AUTO_DEPENDENCY_INSTALL=False` in production.** Runtime pip installs allow any admin-uploaded function or tool to install arbitrary Python packages into the running process. Disabling this:
- **Prevents arbitrary package installation** from user-uploaded code
- **Eliminates race conditions** that crash workers when `UVICORN_WORKERS > 1` or multiple replicas attempt concurrent pip installs
- **Ensures reproducible deployments** — all dependencies are baked into the container image
Pre-install required packages in your Dockerfile instead:
```dockerfile
FROM ghcr.io/open-webui/open-webui:main
RUN pip install --no-cache-dir python-docx requests beautifulsoup4
```
When disabled, functions and tools that import missing packages will fail with a `ModuleNotFoundError` at load time, clearly indicating which packages need to be pre-installed.
:::
#### `PIP_OPTIONS`
- Type: `str`