mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #8291] feat: pyodide - load additional packages by name/URL #15070
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 @idling-mind on GitHub (Jan 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8291
Originally assigned to: @tjbck on GitHub.
Feature Request
Specify additional packages for pyodide/micropip to load either by name or by url
Is your feature request related to a problem? Please describe.
I tried my best to configure pyodide to load additional package. In my case, I wanted to load a local package which is not uploaded to pypi. Even tried to compile pyodide with additional packages. It was cumbersome and I didnt succeed.
Describe the solution you'd like
Have a section either in workspace or admin settings where I can specify settings related to pyodide (or in-browser code execution. In this settings, i'd like to add a list of additional packages to load which micropip supports. This could either be by name or by url.
Describe alternatives you've considered
Building pyodide with additional packages myself and getting open-webui to load that version of pyodide.
Additional Notes
I tried hosting the wheel from a local url and run the following. That worked for me.
However, when I tried to import matplotlib, it complained.
SyntaxError: 'await' outside function@silentoplayz commented on GitHub (May 28, 2025):
Related - https://github.com/open-webui/open-webui/issues/3583
@TomTheWise commented on GitHub (Mar 12, 2026):
I Absolutely would love that - I have actually kind of done it (not completely successfull) it in the past two days and hosting the packages locally via the reverseproxy and adjusting the CSP for the OWUI connection to include the URL - this way pyodide in the client browser still can't escpape to the internet but can access the own "mini-repository".
Running code manually with code execution from the internal "mini-repository" works and loads the additional packages.
But the current problem is (and probably not that hard to fix) is that as soon as pyodide is enabled the hardcoded prompt:
CODE_INTERPRETER_PYODIDE_PROMPT in the open-webui/backend/open_webui/config.py which tells code interpreter usage the strict prompt that loading additional modules and unsing micropip.install and so on is NOT AVAILABLE.
The code interpreter Prompt itself can be overwritten via the Admin-GUI, but as soon as pyodide is selected, the CODE_INTERPRETER_PYODIDE_PROMPT is appended to that in a hardcoded way.
Would love the possibility to make PYODIDE_PROMPT overwritable like with CODE_INTERPRETER_PROMPT_TEMPLATE!
That way without hosting another container we could get the most out of pyodide that is possible in a still super secure way!