feat: add E2B sandbox support#35
Merged
alexzhang13 merged 7 commits intoalexzhang13:mainfrom Feb 9, 2026
Merged
Conversation
Add a new E2BREPL environment that runs Python code in E2B sandboxes, following the same HTTP broker pattern as ModalREPL and PrimeREPL. Changes: - Add rlm/environments/e2b_repl.py with E2BREPL class - Add examples/e2b_repl_example.py demonstrating usage - Register "e2b" environment in environments/__init__.py - Add "e2b" to EnvironmentType in core/types.py - Add e2b optional dependency to pyproject.toml Key implementation details: - Uses e2b-code-interpreter SDK with Sandbox.create() API - Runs Flask broker on port 8889 (8888 is used by E2B's Jupyter) - Uses sandbox.get_host(port) for public URL access - Supports llm_query(), llm_query_batched(), FINAL_VAR()
Owner
|
I'll take a look at this when I have time, I do want to add E2B support. |
Keep both E2B and Prime sandbox support. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8976ee1 to
fddfd14
Compare
Contributor
Author
|
@alexzhang13 ready for review. To test, run: uv run python examples/e2b_repl_example.py |
Align E2BREPL with other environments (DockerREPL, ModalREPL, PrimeREPL) by adding the persistent parameter introduced in PR alexzhang13#40. Raises NotImplementedError when persistent=True since E2BREPL doesn't yet implement the SupportsPersistence protocol. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
heya @alexzhang13 lmk if you're planning on looking at this + merging. will make sure it doesnt go stale. |
Owner
|
@alt-glitch Oh sorry yes, I never got to this. Yes, I will merge this in but it'll need some updating. |
alexzhang13
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
E2BREPLenvironment that runs Python code in E2B sandboxes, following the same HTTP broker pattern asModalREPLandPrimeREPL.Changes
rlm/environments/e2b_repl.py- FullE2BREPLimplementation using HTTP broker patternexamples/e2b_repl_example.py- Example demonstrating basic code execution and LLM queriesrlm/environments/__init__.py- Register "e2b" environmentrlm/core/types.py- Add "e2b" toEnvironmentTypepyproject.toml- Adde2boptional dependency (e2b-code-interpreter>=0.0.11)Key Implementation Details
e2b-code-interpreterSDK withSandbox.create()APIsandbox.get_host(port)for public URL accessllm_query(),llm_query_batched(),FINAL_VAR()Usage
Example Output
Test Plan
FINAL_VAR()extracts variables correctly