[GH-ISSUE #8291] feat: pyodide - load additional packages by name/URL #30598

Open
opened 2026-04-25 04:50:45 -05:00 by GiteaMirror · 2 comments
Owner

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.

import micropip
await micropip.install("http://local_address:8888/mypackage-0.1.0-py3-none-any.whl")
import mypackage
print(mypackage)

However, when I tried to import matplotlib, it complained. SyntaxError: 'await' outside function

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. ```python import micropip await micropip.install("http://local_address:8888/mypackage-0.1.0-py3-none-any.whl") import mypackage print(mypackage) ``` However, when I tried to import matplotlib, it complained. `SyntaxError: 'await' outside function`
Author
Owner

@silentoplayz commented on GitHub (May 28, 2025):

Related - https://github.com/open-webui/open-webui/issues/3583

<!-- gh-comment-id:2914838005 --> @silentoplayz commented on GitHub (May 28, 2025): Related - https://github.com/open-webui/open-webui/issues/3583
Author
Owner

@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!

<!-- gh-comment-id:4049524946 --> @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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#30598