Skip to content

Simple code sandbox supporting jupyter notebook style code execution. Used for agent training

Notifications You must be signed in to change notification settings

Visual-Agent/MultiModal-Jupyter-Sandbox

 
 

Repository files navigation

Release Logs

[20251202] Update version Jupyter-Sandbox-V2, which is adapted from GPT-OSS tools.

The docker image can be found on this dockerhub repo via:

docker pull chenshawn6915/multimodal-ipython-sandbox:oss-v2

Introduction

Yet another code sandbox for agent RL training ... but in jupyter notebook style.

  • Like jupyter notebook, user can execute multiple code blocks in the same session. All functions and variables are automatically stored after code execution.
  • Like jupyter notebook, when calling plt.show in the code block, a base64 format image will be returned via image field.
  • Like jupyter notebook, if the last line of code has no left value, the right value will be returned via result field.
  • While there is no docker or any other vitualization, to ensure safety, all code executions are guarded by HumanEval safe prefix.

Usage

1. Docker Virtualization

The docker image of this repo can be found on this dockerhub repo.

docker pull chenshawn6915/multimodal-ipython-sandbox:latest

Execution:

docker run -d -p 18901-18904:18901-18904 chenshawn6915/multimodal-ipython-sandbox:latest

By default, there will be 4 code sandbox processes running on ports 18901-18904 respectively. You can change the port mapping by modifying -p 18901-18904:18901-18904 as you wish.

Testing:

python client_demo.py

2. Local Deployment

NOTE: Running this code sandbox on your local machine is DANGEROUS, as model-generated code execution can lead to unexpected behavior. DO NOT do this unless for debugging purposes. We are not responsible for any harm that may result from your code generation.

Step 1: Install redis according to their official installation documentation

Make sure that redis-server and redis-cli are properly installed: which redis-server which redis-cli

Step 2: Start serving

bash start_serving.sh

About

Simple code sandbox supporting jupyter notebook style code execution. Used for agent training

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.1%
  • Dockerfile 1.5%
  • Shell 1.4%