deepsense.ai ds_pycontain
ds_pycontain is a small python package to help with docker containers and images and provide Python REPL running in a docker container.
Example use case you might consider is to isolate python code execution generated by untrusted LLM by running it in a docker container.
This package makes it a bit easier to:
- Build docker images from Dockerfiles or in-memory string.
- Pull docker images from dockerhub (or similar).
- Run docker container to execute a one-off command.
- Run docker container to execute a long-running process and communicate with it.
- Run python commands in a container and get the result.