[GH-ISSUE #22509] feat: Support offline clients by allowing toggle or local serving of Pyodide 'black' formatter #58393

Closed
opened 2026-05-05 23:05:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @harrycch on GitHub (Mar 10, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22509

Check Existing Issues

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

Problem Description

In a fully offline/air-gapped environment, we use OFFLINE_MODE=true to 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 triggers micropip.install('black'), which forces the user's browser to attempt a connection to pypi.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_MODE targets the server rather than the client, I propose one of the following enhancements to support fully offline client browsers:

  1. A UI Toggle / Environment Variable: Introduce a new setting (e.g., ENABLE_TOOL_FORMATTING=false or a toggle in the admin settings) that skips the Pyodide auto-formatting step entirely for normal users, matching the behavior currently allowed for Admins.

  2. Serve black Locally: Bundle the black package (and its dependencies) within the OpenWebUI Docker image, and configure Pyodide's micropip index 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.

Originally created by @harrycch on GitHub (Mar 10, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22509 ### Check Existing Issues - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### Problem Description In a fully offline/air-gapped environment, we use `OFFLINE_MODE=true` to 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 triggers `micropip.install('black')`, which forces the user's browser to attempt a connection to `pypi.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_MODE` targets the server rather than the client, I propose one of the following enhancements to support fully offline client browsers: 1. **A UI Toggle / Environment Variable:** Introduce a new setting (e.g., `ENABLE_TOOL_FORMATTING=false` or a toggle in the admin settings) that skips the Pyodide auto-formatting step entirely for normal users, matching the behavior currently allowed for Admins. 2. **Serve `black` Locally**: Bundle the `black` package (and its dependencies) within the OpenWebUI Docker image, and configure Pyodide's `micropip` index 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.
Author
Owner

@tjbck commented on GitHub (Mar 24, 2026):

Should be addressed in dev.

<!-- gh-comment-id:4121776279 --> @tjbck commented on GitHub (Mar 24, 2026): Should be addressed in dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58393