You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE:** Code Interpreter is currently in Alpha. Be careful with production usage.
3
+
A secure service for executing untrusted Python code in isolated Docker containers. This service provides a REST API for running code with strict resource limits, timeout controls, and file handling capabilities.
4
4
5
-
A secure, FastAPI-based service for executing Python code in isolated Docker containers. This service provides a REST API for running untrusted Python code with strict resource limits, timeout controls, and file handling capabilities.
5
+
Everything runs locally and the execution environment comes pre-packaged with a list of common Python libraries.
6
6
7
-
The goal of the project is to be the easiest, lightest weight way to add secure python execution to your AI agent.
7
+
This project aims to be the easiest, lightest weight way to add secure Python execution to your AI agent.
8
8
9
-
Powers the Code Interpreter in [Onyx](https://github.com/onyx-dot-app/onyx). Checkout the implementation
10
-
[here]() as a good reference for using this in your app.
9
+
## How it works
10
+
11
+
The security first architecture and an overview of the implementation can be found [here](https://github.com/onyx-dot-app/code-interpreter/blob/main/HOW_IT_WORKS.md).
11
12
12
13
## Quick Start
13
14
14
-
### Docker Deployment
15
+
> Note: This repo powers the Code Interpreter feature in [Onyx](https://github.com/onyx-dot-app/onyx).
16
+
Check out the implementation [here](https://github.com/onyx-dot-app/onyx/tree/main/backend/onyx/tools/tool_implementations/python) as a reference for using it in your app.
15
17
16
-
The code-interpreter service needs access to Docker to run code in isolated containers. There are two deployment modes:
18
+
### Docker Deployment
17
19
18
20
#### Option 1: Docker-out-of-Docker (Recommended)
19
21
20
-
This is the recommended approach for most use cases. It shares the host's Docker daemon for better performance:
22
+
This is the recommended approach for most use cases. This shares the host's Docker daemon for better performance to spin up and manage the ephemeral code execution containers.
21
23
22
24
```bash
23
25
docker run --rm -it \
@@ -36,7 +38,7 @@ docker run --rm -it \
36
38
37
39
#### Option 2: Docker-in-Docker
38
40
39
-
Use this when you need complete isolation or can't access the host Docker socket:
41
+
Use this when you need complete isolation or can't access the host Docker socket. This runs a separate Docker daemon in a container to manage the code execution containers.
40
42
41
43
```bash
42
44
docker run --rm -it \
@@ -57,71 +59,9 @@ docker run --rm -it \
57
59
- Subsequent runs will reuse the cached image (instant startup)
58
60
- The server will not accept requests until the executor image is available
59
61
60
-
#### Building from Source
61
-
62
-
```bash
63
-
# Standard build (executor image pulled at runtime)
0 commit comments