Skip to main content
Run model inference, training, and other CUDA workloads on a GPU sandbox. You choose the GPU and bring your application in a Docker image. Once the sandbox is running, you can execute commands, work with files, and expose services as you would in any other sandbox.
Contact us at info@hyperbrowser.ai or through support chat to enable GPU access for your team.

Before you start

Install and configure the CLI, using hx 0.1.25 or later. The example below builds an image remotely, so you don’t need Docker installed on your computer.

Build a GPU image

Your image needs the libraries your application will use on the GPU. This example uses PyTorch with CUDA 12.8. Create a folder called gpu-python and save the following as gpu-python/Dockerfile:
From the parent directory, build the image:
Copy the build ID from the output and replace YOUR_BUILD_ID below:
Wait for this command to finish successfully before continuing. It waits for both the build and GPU image upload. Hyperbrowser supplies the GPU driver when your sandbox starts. The build itself runs without a GPU, so Dockerfile steps should install dependencies rather than run GPU computations. For more build options, see Custom images.

Create a GPU sandbox

Start your image on an L4 GPU:
This gives you one L4 GPU, 2 vCPUs, 4 GiB of system memory, and the default 12 GiB of disk. The command waits until the sandbox is ready, which can take several minutes. Its ten-minute lifetime and usage billing begin once it starts running. Copy the sandbox ID from the output into this variable for the remaining commands:
If you interrupt the wait, the sandbox continues provisioning. You can still use its ID to stop it.

Run code on the GPU

Run a small PyTorch computation inside the sandbox:
You should see:
PyTorch has created a tensor on the GPU and computed the sum of its squared values. You can now run your own scripts the same way. Use background processes for longer jobs, or expose a port to serve a model or web application. Servers should listen on 0.0.0.0.

Stop the sandbox

Stop the sandbox when you’re done:
Stopping releases its resources and ends usage billing. Files written inside the sandbox are deleted, so download results or save them to external storage first. Your image remains available to start another sandbox.

Choose GPUs and resources

Set --gpu to a GPU type from the pricing table. Add --gpu-count when your application needs more than one GPU. You can request 1–8 GPUs of the same type on one host, subject to available capacity and host sizes. Each GPU is reserved for your sandbox; the host may also run other sandboxes. GPU sandboxes use the us region by default. GPU, CPU, and system memory are billed while the sandbox is running, including idle time. Provisioning time is not billed. See Pricing for rates and a worked example.

Use the REST API

After building the image, you can also create and manage GPU sandboxes with the API. The Node 1.3.0 and Python 1.13.0 SDKs do not expose GPU creation fields; use the CLI or REST API with those versions.
Set HYPERBROWSER_API_KEY as described in Install, then create a sandbox from the gpu-python image you built above:
The response is 202 Accepted with status: "provisioning". Copy its id into SANDBOX_ID:
Check the sandbox’s status:
Repeat this request every few seconds until status is active. If it ends or fails instead, check closeReason before creating another sandbox. While provisioning, runtime and token are null.Once active, copy runtime.baseUrl and token from the response:
Send a command to the runtime URL using the sandbox token:
The command output is in result.stdout. It contains NVIDIA L4 and 14.0, just like the CLI example.Stop the sandbox when you’re finished. This also works while it is still provisioning:

Storage and interruptions

GPU sandboxes support files, terminals, exposed ports, and network policies. They do not support memory snapshots, shared volumes, or managed secret injection through secrets, vaults, or 1Password. GPU workloads can be interrupted, and running processes are not automatically resumed or replayed. Save checkpoints and results to external storage so you can recover your work in a new sandbox.

Troubleshooting

See the create-sandbox API reference for all request fields.