Skip to main content

Sailboxes vs. Tensorlake: CPU minimums and memory billing

Sail charges for the CPU you use. A higher CPU limit alone does not increase the charge. Tensorlake charges for at least 20% of allocated CPU while the sandbox runs. It charges for the full allocation if it cannot measure CPU use. Sail bills for the RAM the Sailbox holds. Tensorlake bills for all allocated RAM while the sandbox runs. Sail pricing · Tensorlake pricing

Create the Sailbox

Install the Sail Python SDK on the machine that runs your controller. Run python -m pip install sail. Sign in with sail auth login. Create one Sailbox per session. This example saves its ID in a local file. In your application, store the ID with the agent session.

Transfer files

Replace Tensorlake’s sandbox.write_file(path, data) with sb.fs.write(path, data). Run this code from the directory that contains worker.py and job.json. The example worker reads /tmp/job.json and writes /tmp/result.json inside the Sailbox. Use the paths your worker needs.
If the worker uses Git on Tensorlake, give the Sailbox access to that repository. To move the repository, mirror its Git refs. Save uncommitted changes separately. An export of a pinned filesystem version contains the files from that version. Keep the version history on Tensorlake if you need rollback.

Run your existing worker

Pass the command and its arguments to sb.run() as a single list.

Reconnect after sleep

An idle Sailbox sleeps automatically by default. Use the saved ID to find the same Sailbox. Read the result file. This operation wakes a sleeping Sailbox.
Sleep preserves files and memory. Termination deletes the Sailbox.

Check the worker output

Run your worker with the same input on Tensorlake and on Sail. Compare the command output and the files from both runs.