Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: code execution pipeline #33

Open
tjbck opened this issue Jun 1, 2024 · 3 comments
Open

feat: code execution pipeline #33

tjbck opened this issue Jun 1, 2024 · 3 comments

Comments

@tjbck
Copy link
Collaborator

tjbck commented Jun 1, 2024

No description provided.

@EtiennePerot
Copy link

Adding a code generation pipeline to Open WebUI would be amazing, but it needs to be securely sandboxed. Even if the generated code is harmless, it's easy for it to accidentally pull in a dependency that executes remote code.

I work on gVisor, which is what ChatGPT uses for sandboxing code execution (as proof, try to make it run the dmesg command in its code execution environment). I use Open WebUI myself on my home server, and would love if it supported code execution. Let me know if I can help or assist here.

@justinh-rahb
Copy link
Collaborator

We have come to an internal agreement that we definitely need a sandbox of some kind. More ideas are always welcome, thanks @EtiennePerot

@EtiennePerot
Copy link

EtiennePerot commented Aug 26, 2024

I have created a sandboxed code execution tool (Bash and Python both supported) and uploaded it to GitHub and to the Open WebUI portal. It uses gVisor to isolate the host system from the arbitrary code running in the sandbox. Network access can be selectively enabled. To avoid overloading the system, it supports limiting execution to a maximum number of seconds, and optionally limiting the memory the code is allowed to use. Let me know what you think.

Code execution tool

One thing I'm confused about is how this can be practically used in the context of Open WebUI pipelines. As far as I can tell, these don't have access to the tools (or at least not yet?).

For now, I can use the tool locally, and it runs inside the Open WebUI container itself. This is fine for my needs as I am the sole user of my own instance, but please let me know if there is a better way to integrate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants