Add Vercel sandbox environment support#145
Open
taivu1998 wants to merge 1 commit into
Open
Conversation
Author
|
Hi @alexzhang13, could you help review it when you have time? Thanks! |
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
This PR adds first-class Vercel Sandbox support as a new isolated RLM environment.
What’s included
VercelREPLinrlm/environments/vercel_repl.pyenvironment="vercel"in the environment factory andEnvironmentTypeverceloptional dependency extra inpyproject.tomlbackend="vercel"for AI Gatewayenvironment="vercel"for Vercel Sandboxesexamples/vercel_repl_example.pyDesign
The implementation follows the existing isolated-environment pattern already used by Modal/Prime/Daytona/E2B:
python3.13LMHandlerNotable v1 choices:
persistent=Trueis explicitly unsupportedrlm_query(...)andrlm_query_batched(...)are exposed in the sandbox as thin aliases over thellm_queryvariantsFiles changed
rlm/environments/vercel_repl.pyrlm/environments/__init__.pyrlm/core/types.pypyproject.tomlREADME.mdexamples/vercel_repl_example.pytests/test_vercel_repl.pytests/test_imports.pytests/test_multi_turn_integration.pyVerification
Ran:
.venv/bin/ruff check rlm/environments/vercel_repl.py tests/test_vercel_repl.py tests/test_imports.py tests/test_multi_turn_integration.py examples/vercel_repl_example.py.venv/bin/ruff format --check rlm/environments/vercel_repl.py tests/test_vercel_repl.py tests/test_imports.py tests/test_multi_turn_integration.py examples/vercel_repl_example.py.venv/bin/python -m compileall rlm/environments/vercel_repl.py examples/vercel_repl_example.py tests/test_vercel_repl.py.venv/bin/pytest tests/test_vercel_repl.py tests/test_imports.py tests/test_types.py tests/test_multi_turn_integration.py::TestPersistentModeValidation::test_vercel_environment_raises_errorResult:
63 passed, 4 skippedNotes
I did not run the full socket-heavy integration suite in this environment because localhost socket binds for
LMHandlerare blocked here withPermissionError: [Errno 1] Operation not permitted. The new Vercel-specific coverage and public-surface checks are passing.