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
[E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/@e2b/code-interpreter) or [Python SDK](https://pypi.org/project/e2b_code_interpreter).
25
21
26
-
---
27
-
### What is E2B?
28
-
29
-
[E2B](https://www.e2b.dev/) is an open-source runtime for running AI-generated code in secure cloud Sandboxes. It's tailor-made for agentic & AI use cases.
30
-
31
-
### E2B Sandbox
32
-
E2B Sandbox is a secure cloud environment that allows AI agents and apps. You can run multiple instances of Sandboxes, and have long-running sessions. Inside the Sandboxes, LLMs can use the same tools as humans do, e.g.:
33
-
34
-
- Running LLM generated code
35
-
- Cloud browsers
36
-
- GitHub repositories and CLIs
37
-
- Coding tools like linters, autocomplete, "go-to defintion"
38
-
- Audio & video editing
39
-
40
-
<!---
41
-
<h3 align="center">
42
-
SDK made to control the E2B Sandboxes - secure cloud environments for running LLM-generated code
43
-
</h3>
44
-
--->
45
-
46
-
### E2B SDK
47
-
48
-
The E2B SDK is made to control the E2B Sandboxes - secure cloud environments for running LLM-generated code. The SDK lets you give your AI app a custom code interpreter.
49
-
50
-
- ✔️ Works with any LLM and AI framework (see [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) for examples)
51
-
- ✔️ Supports streaming content like charts and stdout, stderr
52
-
- ✔️ Python & JS SDK
53
-
- ✔️ Runs on serverless and edge functions
54
-
- ✔️ Runs AI-generated code in secure sandboxed environments
55
-
- ✔️ 100% open source (including [infrastructure](https://github.com/e2b-dev/infra))
56
-
57
-
58
-
##### 💻 Supported language runtimes
59
-
- ✔️ Python
60
-
- JavaScript
61
-
- R
62
-
- Java
63
-
64
-
65
-
<h1align="center">
66
-
Start with E2B SDK
67
-
</h1>
68
-
22
+
## Run your first Sandbox
69
23
70
24
### 1. Install SDK
71
25
72
-
JavaScript/TypeScript
26
+
JavaScript / TypeScript
73
27
```
74
28
npm i @e2b/code-interpreter
75
29
```
76
30
77
31
Python
78
32
```
79
-
pip install e2b
33
+
pip install e2b-code-interpreter
34
+
```
35
+
36
+
### 2. Get your E2B API key
37
+
1. Sign up to E2B [here](https://e2b.dev).
38
+
2. Get your API key [here](https://e2b.dev/dashboard?tab=keys).
39
+
3. Set environment variable with your API key
80
40
```
41
+
E2B_API_KEY=e2b_***
42
+
```
81
43
82
-
### 2. Execute code with code interpreter inside Sandbox
44
+
### 3. Execute code with code interpreter inside Sandbox
83
45
84
-
**JavaScript**
46
+
JavaScript / TypeScript
85
47
```ts
86
48
import { Sandbox } from'@e2b/code-interpreter'
87
49
@@ -90,47 +52,20 @@ await sbx.runCode()('x = 1')
90
52
91
53
const execution =awaitsbx.runCode()('x+=1; x')
92
54
console.log(execution.text) // outputs 2
93
-
94
-
awaitsandbox.close()
95
55
```
96
56
97
-
**Python**
57
+
Python
98
58
```py
99
59
from e2b_code_interpreter import Sandbox
100
60
101
61
with Sandbox() as sandbox:
102
62
sandbox.run_code()("x = 1")
103
-
104
63
execution = sandbox.run_code()("x+=1; x")
105
64
print(execution.text) # outputs 2
106
65
```
107
66
108
-
### 3. More resources
109
-
- Check out the [JavaScript/TypeScript](https://e2b.dev/docs/hello-world/js) and [Python](https://e2b.dev/docs/hello-world/py) "Hello World" guides to learn how to use our SDK.
110
-
111
-
- See [E2B documentation](https://e2b.dev/docs) to get started.
112
-
113
-
- Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.
0 commit comments