feat(sandbox): add E2B sandbox provider - #2301
Conversation
|
Hi @max-sudolabs thanks a lot for your PR. Can you run a SWE Bench Verified eval using https://github.com/NVIDIA-NeMo/Gym/tree/main/responses_api_agents/mini_swe_agent_2 and the E2B provider and post the results. You can pick any small OSS model like Qwen 3.6 27b and run it via openrouter to make things easier. |
|
🌿 Preview your docs: https://nvidia-preview-max-sudolabs-e2b-sandbox-provider.docs.buildwithfern.com/nemo/gym Here are the markdown pages you've updated: |
|
This is great @max-sudolabs! I'm on the Product Team for Nemo Gym. Its great to see the collaboration. One request when this work merges: would you be willing to add a note on the E2B docs side as well? Since this adds official NeMo Gym support for E2B sandboxes, it would be great to have it reflected in E2B's own documentation (integration page, supported frameworks, or wherever E2B surfaces partner integrations). |
Hi @hemildesai, I take care of it! Will reports results back. |
We're excited as well! Once PR merge we draft a docs page on our side! Will crosslink it to your docs as well. |
|
@hemildesai Hey, I've been running tests lately and everything passes. I can see there is an error in CI - "Secrets detector". I checked it and it seems like False Positive. Can you take a look on that as well, please? And what are the next steps, so we can finally merge it? |
@max-sudolabs I will take a look at the Secrets detector error. Apart from that things look good, and we can move forward once @OndrejDrapalik reports results on SWE Bench verified via mini swe agent 2. |
|
Hi @max-sudolabs @OndrejDrapalik, just following up to see if you were able to run SWE-Bench verified via mini swe agent 2? We would love to have this merged. Let me know if I can help in any way. |
|
Ran the SWE-bench Verified smoke set (the committed 5 rows in
python -m nemo_gym.sandbox.providers.e2b.build \
--image docker.io/swebench/sweb.eval.x86_64.django_1776_django-10973:latest \
--image docker.io/swebench/sweb.eval.x86_64.pylint-dev_1776_pylint-4551:latest \
--image docker.io/swebench/sweb.eval.x86_64.sphinx-doc_1776_sphinx-8595:latest \
--image docker.io/swebench/sweb.eval.x86_64.sympy_1776_sympy-20916:latest \
--image docker.io/swebench/sweb.eval.x86_64.scikit-learn_1776_scikit-learn-14141:latest \
--cpu-count 2 --memory-mb 8192 --output template_map.yaml
sandbox:
e2b:
create:
template_map:
docker.io/swebench/sweb.eval.x86_64.django_1776_django-10973:latest: sweb-eval-x86_64-django_1776_django-10973-latest__ea28a12e4b22
# ... (5 entries, straight from the builder output)
E2B_API_KEY=... gym env start \
--config mini_swe_agent_2_e2b.yaml \
--config nemo_gym/sandbox/providers/e2b/configs/e2b.yaml \
--config e2b_overlay.yaml \
--config responses_api_models/vllm_model/configs/vllm_model.yaml \
'++policy_base_url=https://openrouter.ai/api/v1' \
"++policy_api_key=$OPENROUTER_API_KEY" \
'++policy_model_name=qwen/qwen3.6-27b'(
gym eval run --no-serve \
--agent mini_swe_agent_2 \
--input responses_api_agents/mini_swe_agent_2/data/example.jsonl \
--output results/mini_swe_agent_2_e2b.jsonl \
--limit 5 \
--num-repeats 1 \
--concurrency 5 \
--temperature 0.6 \
--top-p 0.95 \
--max-output-tokens 16384After running the above, the result is as follows: Key metrics for mini_swe_agent_2: {
"pass@1/accuracy": 60.0,
"pass@1[avg-of-1]/accuracy": 60.0,
"mean/reward": 0.6,
"resolved_task_count": 3,
"task_count": 5,
"resolved_task_rate": 60.0,
"eval_error_rate": 0.0,
"tests_status_rate": 100.0
}Per instance:
Both misses are genuine model failures, not infra: patches applied cleanly in-sandbox, FAIL_TO_PASS tests judged them insufficient. Zero eval/infrastructure errors; all 5 sandboxes ran concurrently on E2B and were cleaned up after the run. E2B API key stayed out of the generated worker configs (env passthrough), as designed. Same score as the enroot validation on these rows (3/5, 60% — #1952, same Qwen3.6-27B family). Happy to follow up with a full 500-instance run if a Daytona-comparable number (#1513) would help. |
|
@hemildesai benchmark is done: SWE-bench Verified through |
|
SHIP — no reliability concerns found. Reviewed the full diff (new optional What I checked hardest, and why it holds:
Minor, non-blocking observations (author's call, no action required):
No blockers, no correctness risks to the verifier/scoring path (this touches sandbox infra only). Good to merge. |
Signed-off-by: Maksim Obukhov <maksimobukhov@sudolabs.io>
Signed-off-by: Maksim Obukhov <maksimobukhov@sudolabs.io>
Signed-off-by: Maksim Obukhov <maksimobukhov@sudolabs.io>
Signed-off-by: Maksim Obukhov <maksimobukhov@sudolabs.io>
Signed-off-by: Maksim Obukhov <maksimobukhov@sudolabs.io>
Signed-off-by: Hemil Desai <hemild@nvidia.com>
Signed-off-by: Hemil Desai <hemild@nvidia.com>
Signed-off-by: Hemil Desai <hemild@nvidia.com>
adccad0 to
6177a87
Compare
|
/claude review |
|
/ok to test 6177a87 |
|
SHIP — LGTM, no reliability concerns. Reviewed the full diff (E2B sandbox provider + template-builder CLI + docs + deps + Verified against the trusted base and CLAUDE.md conventions:
|
Summary
This continues the E2B sandbox provider work started by @hemildesai in #2165, moved to a fork so I can iterate on the implementation directly.
The current draft:
>=2.36.0,<3.0.0range;nemo-gym/<version>integration attribution throughConnectionConfig.set_integration();E2B_API_KEYenv fallback;nemo_gym/sandbox/providers/e2b/README.md) and a Fern docs page (fern/versions/latest/pages/infrastructure/sandbox/e2b.mdx);Thanks @hemildesai for the initial implementation and for inviting me to continue the work.
Validation
maininterfaces.uv lock --checkpassed with the repository-pinned uv version.