Document ENABLE_PLUGINS and CONTEXT_COMPACTION_TOKEN_CAP

This commit is contained in:
Classic298
2026-07-10 00:59:14 +02:00
parent 924395b239
commit 7edffd55d4
2 changed files with 26 additions and 1 deletions
@@ -608,6 +608,17 @@ For details on the security model, see the [Security Policy](/security/security-
Because Tools and Functions execute server-side code, any user with permission to create or import them effectively has the same level of access as the Open WebUI process itself. This is inherent to how extensibility works. By default, only administrators can create and import Tools and Functions. The settings below control these permissions.
### Disabling the feature entirely
If your deployment does not use Tools or Functions at all, remove the surface completely:
```bash
# Set to false to disable the built-in Tools and Functions execution surface
ENABLE_PLUGINS=false
```
This is stronger than [Safe Mode](#safe-mode). Safe Mode deactivates all Functions but leaves the feature in place; `ENABLE_PLUGINS=false` hides the workspace **Tools** and admin **Functions** pages, makes their endpoints return empty, and skips every plugin execution path (filters, actions, pipe functions, built-in native tool-calling and code-interpreter detection). OpenAPI and MCP tool servers configured through connections are unaffected. Setting this off removes the arbitrary-code-execution surface these features carry, so use it whenever the feature is not needed.
### Code execution
Open WebUI has two code execution features enabled by default:
@@ -761,6 +772,7 @@ The table below summarizes the key hardening actions covered in this guide. Each
| [Enable audit logging](#audit-logging) | `NONE` | `METADATA` or higher |
| [Restrict API key endpoints](#endpoint-restrictions) | All endpoints | `ENABLE_API_KEYS_ENDPOINT_RESTRICTIONS=true` |
| [Keep API passthrough disabled](#openai-api-passthrough) | Disabled | Keep `ENABLE_OPENAI_API_PASSTHROUGH=false` |
| [Disable Tools and Functions if unused](#disabling-the-feature-entirely) | Enabled | `ENABLE_PLUGINS=false` |
| [Disable auto pip install](#dependency-installation) | Enabled | `ENABLE_PIP_INSTALL_FRONTMATTER_REQUIREMENTS=false` |
| [Review community sharing](#data-sharing-and-export) | `true` | Disable if sensitive data |
| [Review direct connections](#data-sharing-and-export) | `false` | Keep disabled unless needed |
+14 -1
View File
@@ -1142,7 +1142,14 @@ when using OpenAI-compatible endpoints.
- Type: `int`
- Default: `80000`
- Description: The estimated context size, in tokens, above which older messages are compacted when `ENABLE_CONTEXT_COMPACTION` is on. Lower it for smaller-context models, raise it for larger ones. This is the global maximum: an individual model can set a *lower* threshold of its own with the **Context Compaction Threshold** advanced parameter (`compact_token_threshold`), but it cannot raise it above this value.
- Description: The estimated context size, in tokens, above which older messages are compacted when `ENABLE_CONTEXT_COMPACTION` is on. Lower it for smaller-context models, raise it for larger ones. This is the global default threshold: an individual model can override it with the **Context Compaction Threshold** advanced parameter (`compact_token_threshold`), setting a higher or lower value of its own, bounded by `CONTEXT_COMPACTION_TOKEN_CAP`.
- Persistence: This environment variable is a `ConfigVar` variable.
#### `CONTEXT_COMPACTION_TOKEN_CAP`
- Type: `int`
- Default: falls back to `CONTEXT_COMPACTION_TOKEN_THRESHOLD` when unset
- Description: The absolute ceiling, in tokens, for any per-model context compaction threshold. A model can raise or lower its own threshold with the `compact_token_threshold` advanced parameter, but the effective value is clamped to this cap. When unset it equals `CONTEXT_COMPACTION_TOKEN_THRESHOLD`, reproducing the previous behaviour in which per-model thresholds could only be lowered. Can also be set in **Admin Panel > Settings > Interface** (**Token Cap**).
- Persistence: This environment variable is a `ConfigVar` variable.
#### `CONTEXT_COMPACTION_PROMPT_TEMPLATE`
@@ -7744,6 +7751,12 @@ 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_PLUGINS`
- Type: `bool`
- Default: `True`
- Description: Master switch for Open WebUI's built-in Tools and Functions. When set to `False`, the entire Tools and Functions surface is removed: the workspace **Tools** page and admin **Functions** page are hidden, their API endpoints return empty, and every plugin execution path (filters, actions, pipe functions, built-in native tool-calling and code-interpreter detection) is skipped. This is stronger than [`SAFE_MODE`](#safe_mode): `SAFE_MODE` deactivates all Functions while the feature stays in place, whereas `ENABLE_PLUGINS=False` gates off the whole execution surface. OpenAPI and MCP tool servers configured through connections are unaffected. Surfaced to clients as the `enable_plugins` config flag.
#### `ENABLE_PIP_INSTALL_FRONTMATTER_REQUIREMENTS`
- Type: `bool`