Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangzhejian/codeinterpreter-codebox
Easy to deploy.A cloud service for python code interpreter sandbox for Code-Interpreter.
https://github.com/zhangzhejian/codeinterpreter-codebox
agent aigc backend chatgpt chatgpt-api codeinterpreter docker fastapi llm python
Last synced: 3 months ago
JSON representation
Easy to deploy.A cloud service for python code interpreter sandbox for Code-Interpreter.
- Host: GitHub
- URL: https://github.com/zhangzhejian/codeinterpreter-codebox
- Owner: zhangzhejian
- License: mit
- Created: 2023-09-20T08:57:35.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-12T09:52:47.000Z (11 months ago)
- Last Synced: 2024-08-01T08:18:33.495Z (6 months ago)
- Topics: agent, aigc, backend, chatgpt, chatgpt-api, codeinterpreter, docker, fastapi, llm, python
- Language: Python
- Homepage:
- Size: 64.5 KB
- Stars: 30
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - zhangzhejian/codeinterpreter-codebox - Easy to deploy.A cloud service for python code interpreter sandbox for Code-Interpreter. (Python)
README
# Codeinterpreter-Codebox
Welcome to Codeinterpreter-Codebox, a cutting-edge cloud service tailored for executing Code Interpreter code.
## π Table of Contents
- [π― Key Features](#-key-features)
- [π‘ What Can You Do?](#-what-can-you-do)
- [π Related Projects & Their Differences](#-related-projects--their-differences)
- [π» Sample Codes](#-sample-codes)
- [π¦ Deployment](#-deployment)
- [π§ Contact](#-contact)## π― Key Features
1. π **Independent Jupyter Sandbox Environment**
A completely isolated Jupyter sandbox environment that supports state-preserving code execution. Supports file uploads and downloads.
2. π³ **Dockerized One-click Deployment**
3. π **Completely Free and Open Source**
4. π‘οΈ **Information Security**
Supports completely private deployments without the need to upload files to external servers.
5. π **More Flexible**
Supports the opening of more ports to achieve more custom functionality requirements, such as: connecting to databases, connecting to the internet, connecting to other servers.## π‘ What Can You Do?
1. Execute Python code.
2. Supports reading of uploaded files ([Upload and Analyze Files](./examples/client/codeinterpreter_session.py)).
```python
if name=='main':
session=CodeinterpreterSession()
try:
session.upload_files(['./../data/test_data.csv'])
session.chat('How many columns are in the uploaded file?')
finally:
session.close()
```
3. Supports downloading files from the sandbox.
4. Supports dynamic scaling for commercial deployments.
5. Supports custom feature modifications, open ports, network connections, etc., supports web crawlers.## π Related Projects & Their Differences
1. [Code Interpreter api](https://github.com/shroominic/codeinterpreter-api)
2. [open-interpreter](https://github.com/KillianLucas/open-interpreter)
3. [E2B](https://github.com/e2b-dev/e2b)| 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) |
|---|---|---|---|---|
| **Private Commercial Deployment** | β | β | β| β |
| **Remote Invocation** | β |β | β | β |
| **Fully Open Source** | β | β | β | β |
| **Free of Charge** | β | β | β | β |
| **Customization** | β | β | β| β |
| **Information Security** | β | β | β | β |
| **Multiple Programming Languages** | β | β | β | β |
| **Local Execution** | β | β | β | β |
| **Direct Invocation w/o Deployment** | β | β | β | β |β Indicates our project
## π» Sample Codes
1. **Server-Client Interaction**: [jupyter server communicate](./examples/jupyter/jupyter_api_test.ipynb) showcases the details of interaction between the server and the Jupyter container.
2. **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.
```python
test_code="""
import docker
print(docker.version)"""
execute(test_code)#output
Execute Result= {"output_type":"text/plain","content":"6.1.3\n","files":null}
```
3. **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.
```python
session=CodeinterpreterSession()
try:
session.upload_files(['./../data/test_data.csv'])
session.chat('How many columns are in the uploaded file?')
finally:
session.close()
```## π¦ Deployment
1. **Install Docker**
Linux: Install Docker by terminal
Mac os: Install Docker desktop for mac
Windows: Install Docker desktop for windows
2. **Modify Docker config file**
Head 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'.
3. **Launch server**
- Build custom jupyter image
```shell
cd docker
docker build -t scipy-notebook:custom -f Dockerfile .
```
- Build web server image
```shell
cd app
docker-compose -f docker_dev.yml build
```
- Launch server
```shell
docker-compose -f docker_dev.yml up
```## π§ Contact
WeChat: zjajzzj1996
Email: [[email protected]]([email protected])