🚨 Dangermode is a ChatGPT Plugin written with Python and FastAPI that allows ChatGPT to execute code snippets in an IPython session, whether it's the console, the notebook, or a JupyterLab session.
🚨🚨🚨 YOU ARE GIVING AI THE ABILITY TO EXECUTE CODE AS YOU. 🚨🚨🚨
Running this plugin on your machine is dangerous. Running this plugin on a public server is extremely dangerous. You have been warned.
- Execute code snippets in an IPython session through ChatGPT.
- Inspect variables and view results in real-time.
- Serve images and display data to ChatGPT.
Since you don't want to unleash ChatGPT directly onto your literal machine (including your files) etc., run the docker image:
docker run -p 8000:8000 -it --rm rgbkrk/dangermode
You can also build and run it locally:
docker build . -t rgbkrk/dangermode
docker run -p 8000:8000 -it --rm dangermode
If you're feeling brave , you can install dangermode
directly via pip
, conda
, or clone the repository and install it locally. If you really aren't worried about security, go for it. You have been warned.
Run this in a cell in your notebook
import dangermode
# You must set the host to bind to all addresses when using Docker.
# Since this is dangerous, I leave it as an exercise to the reader.
dangermode.activate_dangermode()
In order to use this plugin, you have to have ChatGPT Plugin access.
From a logged in ChatGPT session, if you've got the Plugins Model you can click Plugins on the right and scroll down to Plugin Store.
Next, click "Develop your own plugin".
Enter localhost:8000
as the domain.
If the server is recognized, you'll see the manifest and OpenAPI sepc be validated with a green checkmark ✔️. Click "Install localhost plugin" and start using it!
GET /openapi.json
: Retrieve the OpenAPI JSON configuration.GET /.well-known/ai-plugin.json
: Retrieve the AI plugin JSON configuration.GET /images/{image_name}
: Retrieve an image by its name.GET /api/variable/{variable_name}
: Retrieve the value of a variable by its name.POST /api/run_cell
: Execute a code cell and return the result.
Please do. I can't let Large Language Models write all of it.
Please fork the repository, make your changes, and submit a pull request.
Dangermode is released under the BSD 3-Clause License. See LICENSE for more information.
If you have any questions or feedback, please feel free to reach out to the author, Kyle Kelley, on Twitter at @KyleRayKelley or just open an issue on the repository.