Lightweight virtual machines where both you and your agents can run code with sub-20ms cold starts.
Set up authentication to Blaxel
.env
file (BL_WORKSPACE
and BL_API_KEY
, or see this page for other authentication options).SandboxInstance.create()
waits for the creation to be acknowledged, the function sandbox.wait
allows to wait for the sandbox to be fully deployed and ready on Blaxel.
blaxel/prod-{NAME}:latest
(e.g. blaxel/prod-base:latest).ports
parameter.
ttl
parameter, or at a specific date using the expiresAt
/expires_at
parameter.
The ttl
parameter accepts a string with the following time units: s
(seconds), m
(minutes), h
(hours), d
(days), and w
(weeks).
name
and either retrieves it or creates a new one using your specified configuration.
Tools available in the MCP server…
processExecute
- Execute a command.processGet
- Get process information by identifier (PID or name).processGetLogs
- Get logs for a specific process.processKill
- Kill a specific process.processStop
- Stop a specific process.processesList
- List all running processes.fsDeleteFileOrDirectory
- Delete a file or directory.fsGetWorkingDirectory
- Get the current working directory.fsListDirectory
- List contents of a directory.fsReadFile
- Read contents of a file.fsWriteFile
- Create or update a file.codegenEditFile
- Propose and apply a targeted edit to a specified file, with instructions and partial contents. This tool uses MorphLLM for fast edits, and requires a Morph API key set as an environment variable when creating the sandbox.codegenCodebaseSearch
- Find semantic code snippets from the codebase based on a natural language query.codegenFileSearch
- Fast fuzzy filename search in the project.codegenGrepSearch
- Run fast, exact regex/text searches on files for locating patterns or strings.codegenListDir
- List contents of a directory in the project.codegenParallelApply
- Plan and apply similar changes to multiple locations/files simultaneously.codegenReadFileRange
- Read a specific range of lines in a file (max 250 lines at once).codegenReapply
- Retry the application of the last edit, in case it previously failed.standby
to active
in under 25 milliseconds, and scale back down top standby
after one second of inactivity, maintaining their previous state after scaling down.
Here is the summary on the possible statuses for a sandbox:
standby
: The sandbox is created but is hibernating. You are not charged while a sandbox is in standby mode. Sandboxes transition from standby to active mode in approximately 20 ms.active
: The sandbox is running and processing tasks. You are charged for active runtime. Sandboxes automatically return to standby mode after 1 second of inactivity.stopped
: The sandbox is shut down and requires manual restart to access its API.