Learning resourcesReviewed · E2B

E2B Code Interpreter: Customize the template

This E2B documentation page shows developers who already use the E2B Code Interpreter SDK how to customize code-interpreter-v1, the sandbox template (preinstalled environment) in which the SDK runs their code, with Python or JavaScript/TypeScript examples. Its extension example only inherits code-interpreter-v1 without adding packages or changing the runtime; package installation is covered on a separate linked page. It also provides a separate route for rebuilding the production template from source.

Researched 15 Nov 2026

In short.

This E2B documentation page is for developers using the E2B Code Interpreter SDK and explains how to extend or rebuild code-interpreter-v1, the sandbox template (preinstalled environment) in which the SDK runs code. Package-specific customization requires instructions on a separate linked page. The recommended route derives a custom template from code-interpreter-v1 and builds it under a chosen alias. A second route uses the repository’s build_prod.py script to rebuild the production template. Both require an E2B API key. The examples configure a build and show a Hello, World! sandbox call; successful execution, compatibility and costs are not established.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete selected page at [https://docs.e2b.dev/code-interpreting/customize-template.md], including both build routes, code examples, the package-installation note and the documentation-index notice. Linked pages, the documentation index, repository files and dependency contents are excluded. No commands, template builds or sandbox examples were executed; runtime behavior, compatibility and performance remain unverified.

The overview

identity

Customize the template is an E2B documentation guide covering customization of the sandbox template used by the Code Interpreter SDK. The source is [https://docs.e2b.dev/code-interpreting/customize-template.md].

It covers extending the public code-interpreter-v1 template and rebuilding that production template from the code-interpreter repository.

assessment

The guide is useful for developers who already use E2B Code Interpreter and need a repeatable sandbox configuration. It makes the choice between extending the existing template and rebuilding its source explicit.

Its main gap is the customization itself: the extension example inherits the base template without adding packages or changing its runtime. Those changes require further instructions.

users

Application developers needing preinstalled dependencies are the main audience for the extension route. The source-build route addresses SDK contributors and developers who want to rebuild the official template themselves.

Beginners receive a numbered sequence, but need familiarity with package installation, environment variables and running scripts. The page does not explain those concepts in depth.

capabilities

The page shows template inheritance, building under a custom alias, configuring CPU and memory, displaying build logs, and creating a Code Interpreter sandbox from that alias. Extension examples are supplied in Python and JavaScript/TypeScript.

For production-template builds, it documents repository setup, build dependencies and a clean rebuild option that ignores the layer cache.

Using it

requirements

The extension workflow installs e2b with dotenv for JavaScript/TypeScript, or e2b with python-dotenv for Python. It requires an E2B API key supplied as E2B_API_KEY in a .env file.

The usage examples import @e2b/code-interpreter or e2b_code_interpreter, whose installation is not shown. The TypeScript build command uses npx tsx. Supported language versions and exact SDK versions are unspecified.

The source-build route requires Git, Python and the dependencies listed in the repository’s requirements-dev.txt; that file’s contents are not included.

mechanism

A template defines the starting environment for a sandbox. The extension route uses Template().fromTemplate("code-interpreter-v1") in TypeScript or Template().from_template("code-interpreter-v1") in Python. According to the guide, inheriting this template preserves the components the Code Interpreter SDK depends on.

Template.build assigns the resulting template the alias code-interpreter-custom. Sandbox.create then selects that alias when creating a sandbox.

setup

For extension, install the build SDK and environment loader, create template.ts or template.py, and create the corresponding build script. Add the API key to .env, then run npx tsx build.ts or python build.py. The example requests 2 CPUs and 2048 MB of memory; these are example settings, not stated minimum requirements.

For a production-template rebuild, clone [https://github.com/e2b-dev/code-interpreter], enter its template directory, install requirements-dev.txt, provide the API key and run python build_prod.py. Prefixing that command with SKIP_CACHE=true requests a rebuild without the layer cache.

example

The Python usage example creates a sandbox with Sandbox.create("code-interpreter-custom"), submits print('Hello, World!') through run_code, and prints execution.logs.stdout. The JavaScript example uses the corresponding asynchronous create and runCode calls.

This illustrates how a built template is selected and how execution logs are accessed. It does not demonstrate an added dependency or a changed runtime. No example was executed.

Assessment & evidence

limitations

The page does not show package-installation commands within the template definition, explain runtime replacement, or document compatibility constraints for either change.

Build duration, resource limits, troubleshooting, sandbox isolation properties and production reliability are not established. A script described as the production build path does not by itself establish readiness for a particular application.

reasoning

Extending code-interpreter-v1 is the page’s recommended route for most customization because it retains the SDK’s expected environment. This makes it a reasonable starting point when the desired change is an additional dependency.

Rebuilding from source fits work on the template or SDK itself. The practical choice depends on whether inheritance supports the required change; the page does not establish that every runtime modification is compatible.

alternatives

The two documented routes are extending the existing public template and rebuilding the production template from source. If the default environment already meets an application’s needs, the page identifies code-interpreter-v1 as the template the SDK normally uses.

No comparison with other sandbox services or local execution environments is provided, so their relative suitability is not assessed.

evidence

The evidence is the complete Customize the template documentation page at [https://docs.e2b.dev/code-interpreting/customize-template.md]. It supplies instructions and illustrative code, without build receipts, execution output or benchmarks.

The statement that CI and releases use build_prod.py comes from this documentation. Repository code and CI configuration are outside the available evidence.

Access & freshness

costs

The page provides no prices, billing units, free allowance or account-plan requirements. Template-build and sandbox-execution costs are unknown.

The 2-CPU and 2048-MB configuration does not establish a price. The cost difference between cached and clean builds is also unknown.

rights

The page links to the code-interpreter repository on GitHub ([https://github.com/e2b-dev/code-interpreter]) but includes no license text or explicit redistribution terms for the documentation, examples or template components. Applicable reuse and redistribution rights are unknown from this page.

Licenses for packages added to a custom template are not addressed.

freshness

The page was captured on 15 November 2026 at 07:25:38 UTC. Its text gives no publication or last-update date.

It names code-interpreter-v1 but does not pin SDK versions or a repository commit for the clone command. Compatibility with a particular installed SDK or later repository revision is unverified.

actions

Start with the extension route for an application-specific environment. For dependency additions, consult the referenced package guide at [https://docs.e2b.dev/quickstart/install-custom-packages.md]; its instructions are not included here.

Before adopting the template, confirm SDK compatibility and account pricing, then build it and verify the actual packages and code your application needs. Use the source-build route when contributing to the SDK or rebuilding the official template.

Evidence for this report

selected-page.txtselected · checked 2026-11-15