← all repositories
e2b-dev/e2b-cookbook

A cookbook for letting LLMs run code without burning down your laptop

Copy-paste examples for running untrusted AI-generated code in E2B sandboxes across every major LLM provider.

1.4k stars TypeScript Coding AssistantsAgents
e2b-cookbook
Velocity · 7d
+1.4
★ / day
Trend
steady
star history

What it does

E2B Cookbook is a collection of runnable examples showing how to use the E2B SDK to spin up secure sandboxes where LLMs can execute code, analyze data, and build apps. Each example pairs a specific provider or framework with a concrete task—OpenAI’s o3-mini analyzing CSVs, Claude interpreting code inside a sandbox, or a Next.js app streaming results from a code interpreter.

The interesting bit

The breadth is the point. Rather than one polished demo, this is a matrix of integrations: nine LLM providers, seven AI frameworks, and a growing pile of MCP (Model Context Protocol) servers. It’s documentation by example, which turns out to be how most developers actually want to learn sandbox tooling.

Key highlights

  • Dual-language support: most examples come in both Python and TypeScript, with a few TypeScript-only (MCP, Vercel AI SDK) or Python-only (LangChain, Autogen) exceptions
  • Covers major providers: OpenAI, Anthropic, Mistral, Groq, Fireworks AI, Together AI, WatsonX AI
  • Framework integrations include LangChain, LangGraph, Autogen, Vercel AI SDK, AgentKit, and Stirrup
  • MCP section shows how to connect sandboxes to external tools like arXiv, DuckDuckGo, Browserbase, and Exa
  • Practical use cases beyond toy examples: Airbnb scraping with Firecrawl, Docker-in-sandbox, Playwright automation

Caveats

  • Coverage is uneven: some providers have TypeScript gaps (Fireworks AI, Claude Managed Agents), while Python misses the entire MCP section
  • The README is a well-organized link farm, but you’ll need to dig into individual folders for actual implementation details

Verdict

Grab this if you’re building anything where LLMs need to execute code safely—data analysis agents, coding assistants, or autonomous research tools. Skip it if you’re looking for a single polished starter template; this is a reference shelf, not a finished product.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.