Back to Videos

E2B: The Missing Piece for AI Agents?

Channel AI Tinkerers
Guest Vasek Mlejnsky, Founder & CEO of E2B
Date October 16, 2024
Duration 34:00
E2B Firecracker MicroVM Sandboxing
TL;DR

E2B is an open-source developer tool that provides secure, cloud-based sandboxes for running AI-generated code. Using Firecracker microVMs, E2B can spin up isolated execution environments in ~150 milliseconds, enabling use cases from code interpretation to generative UI. The platform powers Perplexity's code execution features and is designed to be the "boring code execution layer" that lets developers focus on building AI applications.

Key Takeaways

Summary

What is E2B?

E2B is a developer tool that makes it easy to run AI-generated code in the cloud securely. At its core, E2B provides sandboxes - lightweight microVMs that can be created with a single line of code. Each sandbox is essentially a small Ubuntu machine in the cloud that can be customized for specific use cases.

The platform uses Firecracker (the same technology behind AWS Lambda) to achieve fast startup times. Currently, sandboxes spin up in about 150 milliseconds, with the VM itself starting in just 20 milliseconds. The team is working to get total startup time under 100ms.

Architecture and Integration

E2B consists of an infrastructure layer for sandbox orchestration, SDKs for JavaScript and Python, and a CLI for managing custom sandbox templates. When integrated with an LLM, developers define a tool (like "execute_python") that the model can call. The tool implementation uses E2B's SDK to send code to a sandbox, execute it, and return results back to the model.

Use Cases

The six main use cases E2B sees, ranging from production to experimental:

Perplexity Partnership

Perplexity is one of E2B's key customers. When Pro users ask programming questions or request data visualization, Perplexity collects data from the internet, generates code, and executes it on E2B's infrastructure. Speed was a critical requirement - Perplexity is known for fast responses, making E2B's sub-200ms startup times essential.

Security and Observability

E2B's philosophy is to be the "boring code execution layer" - handling isolation and security so developers can focus on their applications. The team is building observability features that will alert developers when code attempts sensitive operations (like database writes), similar to the iOS permission model where agents may need explicit permission for certain actions.

Future Vision

E2B's vision is to be the best place to run AI-generated code, then expand to deploying generated code. Planned features include sandbox checkpointing and forking, better observability for agent actions, and a runtime that handles not just running but deploying code.

Notable Quotes

"We want to be the boring code execution layer for LLMs. We don't want to be wrapping LLMs for you or being too opinionated about how any agent system you should be building."

"Speed is not just nice to have, speed is a necessity. Perplexity is known for speed - that was one of the first questions they had for us."

"I wouldn't underestimate how powerful it is to go just vanilla with LLM provider SDKs and write your own code. You might find out that you don't need any framework."

"The most exciting use cases are the agents that are not agents for developers - not coding agents but they're using code to complete tasks."

Chapters

TimeTopic
00:00Introduction and what is E2B
03:00Repository overview and sandbox architecture
05:30Perplexity demo - gold price visualization
07:00SDK integration and tool definition
11:00Startup performance - 150ms target
12:30Six use cases overview
14:00Generative UI demo - Artifacts clone
17:00Streamlit app generation demo
18:00Security considerations for database access
21:00Neon database branching discussion
24:00Reasoning improvement with code execution
28:00Rapid fire - boring vs creative use cases
29:30Vision for next six months
32:30Closing remarks

References