Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

e2b

Package Overview
Dependencies
Maintainers
3
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

e2b

E2B SDK that give agents cloud environments

  • 0.16.2-beta.57
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-13.68%
Maintainers
3
Weekly downloads
 
Created
Source

e2b logo

E2B SDK

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.

  • ✔️ Works with any LLM and AI framework (see Cookbook for examples)
  • ✔️ Supports streaming content like charts and stdout, stderr
  • ✔️ Python & JS SDK
  • ✔️ Runs on serverless and edge functions
  • ✔️ Runs AI-generated code in secure sandboxed environments
  • ✔️ 100% open source (including infrastructure)
💻 Supported language runtimes
  • ✔️ Python
  • (Beta) JavaScript, R, Java
Last 1 month downloads for the Python SDK Last 1 month downloads for the Python SDK

What is E2B?

E2B is an open-source runtime for running AI-generated code in secure cloud Sandboxes. It's tailor-made for agentic & AI use cases.

E2B Sandbox

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.:

  • Running LLM generated code
  • Cloud browsers
  • GitHub repositories and CLIs
  • Coding tools like linters, autocomplete, "go-to defintion"
  • Audio & video editing

Getting Started & Documentation

Please visit documentation to get started.

To create and control a sandbox, you use our SDK:

Install SDK

npm install e2b

Start sandbox

import { Sandbox } from "e2b";

// Create sandbox
const sandbox = await Sandbox.create();

// Let an LLM use the sandbox here
// Visit https://e2b.dev/docs/sandbox/overview to learn more about sandboxes.

// Close sandbox once done
await sandbox.close();

Development

You can use the SDK with a locally running envd (that usually runs inside the sandbox and allows the SDK to interact with it) by passing E2B_DEBUG=true to .env or by using debug: true in the Sandbox.create or Sandbox.connect method options.

Install dependencies

pnpm install

Generating API clients used by SDK

Check out top-level README for more information.

Building

For development, you can run the following command to rebuild the SDK on every change:

pnpm dev

Testing

Use pnpm test to run the test suite or pnpm example to run the example code. Pass E2B_DEBUG=true to .env to run against the locally running envd (usually run via Docker).

When running with a local environment the environment is not cleaned up after every test run as when running the test againts production. This might lead to some issues when running the tests multiple times and it is good to keep in mind.

Keywords

FAQs

Package last updated on 15 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc