Skip to main content

rungpu

Run a Python/ML job on the cheapest suitable GPU without thinking about cloud infrastructure.

gpu run "python train.py" --vram 24 --max-price 0.50

That one command finds a GPU, rents it, uploads your project, installs dependencies, streams the output, brings your results back and destroys the instance. You never open a cloud console or configure SSH.

A gpu run session from search to destroying the instance

A replay of a real run, sped up, with two lines of noise removed.

Status: early MVP. Vast.ai is the only provider. The full flow works on real rented GPUs, but only on demo projects so far. See Limitations.

Quick start

You need a Vast.ai account with credit and an API key. You pay Vast.ai directly.

rungpu needs Python 3.13. uv installs it for you:

uv tool install rungpu

With Python 3.13 already installed, pip install rungpu works too. The command is gpu:

export VAST_API_KEY=...          # or put it in a .env file
gpu search --vram 24 --max-price 0.50

Then, from your project directory:

gpu run "python train.py" --vram 24 --max-price 0.50

Commands

Shows matching offers, best value first.

gpu search --vram 24 --max-price 0.50 --gpus 1 --limit 10

gpu run

Option Meaning Default
--vram Minimum VRAM per GPU, in GB 24
--max-price Maximum $/hour. Without it, you are asked to confirm none
--gpus Number of GPUs 1
--mode What matters most: cheap, balanced or fast cheap
--disk Disk size, in GB 30
--min-reliability From 0 to 1 0.99
--artifacts, -a Path to bring back. Repeatable runs
--env, -e KEY=VALUE, or KEY to copy it from your shell. Repeatable none
--image Docker image vastai/pytorch
--setup Replaces the automatic dependency install detected
--no-setup Skip dependency install off
--max-hours Stop the command after this long none
--yes, -y Don't ask to confirm the rental off

gpu run exits with your command's exit code, so it works in scripts. Exit code 3 means an instance could not be confirmed destroyed. 130 means it was interrupted.

Choosing what matters

--mode works with gpu search and gpu run.

Mode Picks Good for
cheap The lowest expected cost of the job, not the lowest hourly price Long jobs on a budget
balanced A big speed gain for a small extra cost Most jobs
fast The fastest GPU within --max-price When time matters more than money
gpu run "python train.py" --vram 24 --max-price 1.00 --mode fast

When the choice isn't the best value offer, gpu run shows the trade-off:

vs best value (RTX PRO 4000): about 1.9x faster, about 4% more per job (DLPerf estimate)

This is a rough estimate. Modes compare GPUs using DLPerf, a general benchmark that knows nothing about your model, so it can't predict how long your job will take. If your job is limited by its disk or CPU, a faster GPU may just sit idle. When one offer is both the fastest and the best value, all three modes pick it. Vast's search doesn't return every offer on every call, so the choice is the best one seen, not a guaranteed market best.

gpu jobs

Lists recent jobs and warns about instances that are still running.

gpu destroy <instance-id>

For emergencies. gpu run destroys instances by itself.

How your project is handled

What gets uploaded. The current directory, except for .git, virtual environments, caches, everything in .gitignore, and secrets: .env, *.pem, *.key and SSH keys.

Your dataset may be gitignored. If so, it won't be uploaded and your job won't find it. Add a .gpuignore file, which uses the .gitignore syntax and takes priority:

!data/
*.ckpt

Dependencies come from requirements.txt, or otherwise from [project].dependencies in pyproject.toml.

Results are copied into the same relative path locally, overwriting files with the same name. They are also downloaded when your command fails, because logs and checkpoints matter most then.

Safety

The instance is destroyed after an exception, a training crash, an SSH failure or Ctrl+C, including an impatient second Ctrl+C. After destroying it, the tool reads it back to confirm. It then looks for any other instance carrying the job's label, which catches an instance whose id was lost because of an interruption mid-request.

If destruction can't be confirmed, you get a red panel with the exact command to run, and exit code 3.

If your computer dies, gpu can't clean up. So each instance watches for a heartbeat from your computer, and destroys itself after 10 minutes of silence, using a key that only works for that instance. Your account key never leaves your computer. To change the timeout, set GPU_WATCHDOG_TIMEOUT_SECONDS, where 0 turns this off.

Marketplace hosts are third parties. Whoever owns the machine can technically see your code, your data and any variables you pass with --env. Don't run anything there that you couldn't show them. Prefer --env over uploading .env, and scoped tokens over personal ones. Output is masked for --env values and common token formats, but this is best effort.

Limitations

  • The dead-man switch has a limit. After kill -9, a power cut or a lost network, the instance destroys itself after 10 minutes without a heartbeat. If the instance never finishes starting, the switch can't run, so check gpu jobs after a crash. If it can't arm itself, you get a warning.
  • Don't let your laptop sleep during a job. A sleeping computer sends no heartbeats, so the instance is destroyed.
  • A network outage of more than about 3 minutes ends the job, because the command runs inside the SSH session. Reconnection is planned.
  • The cost shown excludes traffic and storage during startup. Traffic prices vary by a factor of about 15 between hosts. On a first real job, the final charge was about 2.5 times the estimate.
  • DLPerf is a proxy. It doesn't know your workload, so --mode ranks GPUs but can't predict your job's runtime or cost. A lone offer for its GPU model can't be checked for an inflated benchmark, which matters most with --mode fast.
  • On-demand instances on a single node only.

Development

git clone https://github.com/MikhailSeliakov/rungpu.git
uv sync
uv run pytest                    # Unit tests. Never touches the network.
uv run ruff check .
uv run pytest -m integration     # Real Vast API. Free and read-only.

The end-to-end test rents a real GPU and needs a second, explicit switch:

GPU_E2E_ALLOW_SPEND=1 uv run pytest -m e2e

Metadata

Release files for rungpu 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rungpu 0.1.0
File Size Uploaded Provenance Actions
rungpu-0.1.0.tar.gz 30.6 kB Without provenance Details for rungpu-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rungpu 0.1.0
File Interpreter ABI Platform Actions
rungpu-0.1.0-py3-none-any.whl Python 3 none any Details for rungpu-0.1.0-py3-none-any.whl

Total release size: 72.3 kB

Release files / rungpu-0.1.0.tar.gz

Download URL rungpu-0.1.0.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8d1673ce4f27c38fa74bb796b50d54793420701b331de4c43357ebb7c5adb9f8
BLAKE2b-256 checksum
How to use checksums
7db745f729d0d0a8334643aabf6afd57010d48f1dd33329d2287bf00b431b2cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rungpu-0.1.0-py3-none-any.whl

Download URL rungpu-0.1.0-py3-none-any.whl
Size 41.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
107fe76e15bff8b5987def6fa9b510f1643e7118381fdbc4ed9ec4a6f7bcdc86
BLAKE2b-256 checksum
How to use checksums
0e7c134ee568dc59a0bdee96bfbcd5b45c20898813aa48aaa5a0397f8570a0f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rungpu 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page