// the find
e2b-dev/code-interpreter
Python & JS/TS SDK for running AI-generated code/code interpreting in your AI app
E2B's code interpreter SDK wraps their cloud sandbox infrastructure to let you run AI-generated Python/JS code in isolated environments. The core use case is 'give an LLM a REPL it can't escape from' — stateful Jupyter kernel sessions with file I/O, chart extraction, and multi-runtime support. It's a managed service with open-source SDKs, not a self-hostable runtime.
Stateful kernel sessions across multiple `runCode` calls is the right model for agentic code execution — you don't have to reconstruct context on every call. The chart data extractor is a genuinely useful addition: it parses matplotlib/plotly output back into structured JSON so your LLM can reason about results, not just render PNGs. Both sync and async Python APIs are first-class, not bolted on. Test coverage is unusually thorough for an SDK — separate test files per runtime, per chart type, per env var scenario.
It's a cloud service, not infrastructure you own — your sandboxes run on E2B's servers, billed per compute second, and if they go down or change pricing you have no fallback. Self-hosting is theoretically possible by building the Docker template yourself, but the documentation for that path is a README stub and a pile of Python build scripts with no operational guidance. The chart extraction layer parses Jupyter display_data output heuristically, which means anything your LLM generates outside standard matplotlib/plotly conventions will silently return an unknown chart type. No built-in secret injection — if your AI-generated code needs API keys, you're passing them in as env vars and trusting the sandbox isolation to be good enough.