{"id":13455994,"url":"https://github.com/zhangzhejian/codeinterpreter-codebox","last_synced_at":"2025-03-24T09:31:12.774Z","repository":{"id":196043235,"uuid":"694062581","full_name":"zhangzhejian/codeinterpreter-codebox","owner":"zhangzhejian","description":"Easy to deploy.A cloud service for python code interpreter sandbox for Code-Interpreter.","archived":false,"fork":false,"pushed_at":"2024-03-12T09:52:47.000Z","size":66,"stargazers_count":47,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-06T22:46:40.652Z","etag":null,"topics":["agent","aigc","backend","chatgpt","chatgpt-api","codeinterpreter","docker","fastapi","llm","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhangzhejian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-20T08:57:35.000Z","updated_at":"2024-11-20T17:56:21.000Z","dependencies_parsed_at":"2024-10-28T23:31:10.234Z","dependency_job_id":null,"html_url":"https://github.com/zhangzhejian/codeinterpreter-codebox","commit_stats":null,"previous_names":["zhangzhejian/codeinterpreter-codebox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangzhejian%2Fcodeinterpreter-codebox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangzhejian%2Fcodeinterpreter-codebox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangzhejian%2Fcodeinterpreter-codebox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangzhejian%2Fcodeinterpreter-codebox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhangzhejian","download_url":"https://codeload.github.com/zhangzhejian/codeinterpreter-codebox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245243230,"owners_count":20583588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","aigc","backend","chatgpt","chatgpt-api","codeinterpreter","docker","fastapi","llm","python"],"created_at":"2024-07-31T08:01:14.546Z","updated_at":"2025-03-24T09:31:12.474Z","avatar_url":"https://github.com/zhangzhejian.png","language":"Python","readme":"# Codeinterpreter-Codebox\n\nWelcome to Codeinterpreter-Codebox, a cutting-edge cloud service tailored for executing Code Interpreter code.\n\n## 📜 Table of Contents\n- [🎯 Key Features](#-key-features)\n- [💡 What Can You Do?](#-what-can-you-do)\n- [📋 Related Projects \u0026 Their Differences](#-related-projects--their-differences)\n- [💻 Sample Codes](#-sample-codes)\n- [📦 Deployment](#-deployment)\n- [📧 Contact](#-contact)\n\n## 🎯 Key Features\n\n1. 🐍 **Independent Jupyter Sandbox Environment**  \nA completely isolated Jupyter sandbox environment that supports state-preserving code execution. Supports file uploads and downloads.\n2. 🐳 **Dockerized One-click Deployment**  \n3. 🌐 **Completely Free and Open Source**  \n4. 🛡️ **Information Security**  \nSupports completely private deployments without the need to upload files to external servers.\n5. 🚀 **More Flexible**  \nSupports the opening of more ports to achieve more custom functionality requirements, such as: connecting to databases, connecting to the internet, connecting to other servers.\n\n## 💡 What Can You Do?\n1. Execute Python code.\n2. Supports reading of uploaded files ([Upload and Analyze Files](./examples/client/codeinterpreter_session.py)).  \n```python\nif name=='main':\nsession=CodeinterpreterSession()\ntry:\nsession.upload_files(['./../data/test_data.csv'])\nsession.chat('How many columns are in the uploaded file?')\nfinally:\nsession.close()\n```\n3. Supports downloading files from the sandbox.\n4. Supports dynamic scaling for commercial deployments.\n5. Supports custom feature modifications, open ports, network connections, etc., supports web crawlers.\n\n## 📋 Related Projects \u0026 Their Differences\n1. [Code Interpreter api](https://github.com/shroominic/codeinterpreter-api)\n2. [open-interpreter](https://github.com/KillianLucas/open-interpreter) \n3. [E2B](https://github.com/e2b-dev/e2b) \n\n| Feature/Project | [Codeinterpreter-Codebox★](https://github.com/zhangzhejian/codeinterpreter-codebox) | [Code Interpreter api](https://github.com/shroominic/codeinterpreter-api) | [open-interpreter](https://github.com/KillianLucas/open-interpreter) | [E2B](https://github.com/e2b-dev/e2b) |\n|---|---|---|---|---|\n| **Private Commercial Deployment** | ✅ | ❌ | ❌| ❌ |\n| **Remote Invocation** | ✅ |✅ | ❌ | ✅ |\n| **Fully Open Source** | ✅ | ❌ | ✅ | ❌ |\n| **Free of Charge** | ✅ | ❌ | ✅ | ❌ |\n| **Customization** | ✅ | ❌ | ❌| ❌ |\n| **Information Security** | ✅ | ❌ | ✅ | ❌ |\n| **Multiple Programming Languages** | ❌ | ❌ | ✅ | ✅ |\n| **Local Execution** | ✅ | ✅ | ✅ | ❌ |\n| **Direct Invocation w/o Deployment** | ❌ | ✅ | ✅ | ✅ |\n\n★ Indicates our project\n\n## 💻 Sample Codes\n1. **Server-Client Interaction**: [jupyter server communicate](./examples/jupyter/jupyter_api_test.ipynb) showcases the details of interaction between the server and the Jupyter container.\n2. **Remote Execution**: [jupyter call](./examples/jupyter/execute_dynamic_code.ipynb) demonstrates how to invoke a web service via an HTTP request, execute code, and retrieve results. \n```python\ntest_code=\"\"\"\nimport docker\nprint(docker.version)\n\n\"\"\"\nexecute(test_code)\n\n#output\nExecute Result= {\"output_type\":\"text/plain\",\"content\":\"6.1.3\\n\",\"files\":null}\n```\n3. **Client Session Demonstration**: [client session invocation](./examples/client/codeinterpreter_session.py) shows how to allow LLM to invoke and execute code in a project through session and HTTP request.\n```python\nsession=CodeinterpreterSession()\ntry:\nsession.upload_files(['./../data/test_data.csv'])\nsession.chat('How many columns are in the uploaded file?')\nfinally:\nsession.close()\n```\n\n## 📦 Deployment\n1. **Install Docker**  \nLinux: Install Docker by terminal  \nMac os: Install Docker desktop for mac  \nWindows: Install Docker desktop for windows\n2. **Modify Docker config file**  \nHead over to [docker compose](./app/docker_dev.yml) and substitute 'CODEBOX_ROOT_PATH' and 'YOUR_MNT_PATH:/codebox' with your file path to mount 'YOUR_MNT_PATH'.\n3. **Launch server**\n- Build custom jupyter image\n```shell\ncd docker\ndocker build -t scipy-notebook:custom -f Dockerfile .\n```\n- Build web server image\n```shell\ncd app\ndocker-compose -f docker_dev.yml build\n```\n- Launch server\n```shell\ndocker-compose -f docker_dev.yml up\n```\n\n\n## 📧 Contact\nWeChat: zjajzzj1996  \nEmail: [zhangzhehian@gmail.com](zhangzhehian@gmail.com)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangzhejian%2Fcodeinterpreter-codebox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhangzhejian%2Fcodeinterpreter-codebox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangzhejian%2Fcodeinterpreter-codebox/lists"}