mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #22509] feat: Support offline clients by allowing toggle or local serving of Pyodide 'black' formatter #35256
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @harrycch on GitHub (Mar 10, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22509
Check Existing Issues
Verify Feature Scope
Problem Description
In a fully offline/air-gapped environment, we use
OFFLINE_MODE=trueto isolate the OpenWebUI backend. However, this does not isolate the client browser. When a normal (non-admin) user attempts to save a Tool, the frontend uses Pyodide to automatically format the code. This triggersmicropip.install('black'), which forces the user's browser to attempt a connection topypi.org.Because the client has no internet access, it throws a fatal
ValueError: Can't fetch metadata for 'black', completely preventing normal users from saving tools. (Note: Admin users can save tools successfully because their code bypasses this client-side formatting sandbox).Desired Solution you'd like
Since
OFFLINE_MODEtargets the server rather than the client, I propose one of the following enhancements to support fully offline client browsers:A UI Toggle / Environment Variable: Introduce a new setting (e.g.,
ENABLE_TOOL_FORMATTING=falseor a toggle in the admin settings) that skips the Pyodide auto-formatting step entirely for normal users, matching the behavior currently allowed for Admins.Serve
blackLocally: Bundle theblackpackage (and its dependencies) within the OpenWebUI Docker image, and configure Pyodide'smicropipindex URLs to fetch the package directly from the local OpenWebUI server instead of the public internet.Alternatives Considered
Admin-only tool creation: Currently, we are working around this by forcing all tools to be created using the Admin account, which inherently bypasses the Pyodide formatting check.
Local PyPI Mirror: Setting up a local PyPI server and using internal DNS spoofing to intercept the browser's request to
pypi.org, which is overly complex for a standard deployment.Additional Context
This feature would greatly improve parity between user roles in enterprise and air-gapped deployments where end-user workstations do not have external network access.
@tjbck commented on GitHub (Mar 24, 2026):
Should be addressed in dev.