rungpu
Run a Python/ML job on the cheapest suitable GPU without thinking about cloud infrastructure.
rungpu 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 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 rungpu.
Version 0.1.0 called it gpu, which oh-my-zsh already uses as an alias for git push upstream.
export VAST_API_KEY=... # or put it in a .env file
rungpu search --vram 24 --max-price 0.50
Then, from your project directory:
rungpu run "python train.py" --vram 24 --max-price 0.50
Commands
rungpu search
Shows matching offers, best value first.
rungpu search --vram 24 --max-price 0.50 --gpus 1 --limit 10
rungpu 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 |
rungpu 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 rungpu search and rungpu 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, without paying extra for a tiny gain |
When time matters more than money |
rungpu run "python train.py" --vram 24 --max-price 1.00 --mode fast
Speed counts against price as DLPerf / price^k, with k at 1, 0.5 and 0.1. So even fast won't
pay 40% more for a GPU that is 0.05% faster, which is measurement noise, but it will pay four
times the price for an H100 that is 1.8 times faster.
When the choice isn't the best value offer, rungpu 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. Run the same search twice and an offer may come and go.
rungpu jobs
Lists recent jobs and warns about instances that are still running.
rungpu destroy <instance-id>
For emergencies. rungpu 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, rungpu 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
RUNGPU_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 checkrungpu jobsafter 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
--moderanks 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:
RUNGPU_E2E_ALLOW_SPEND=1 uv run pytest -m e2e
Metadata
Release files for rungpu 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rungpu-0.1.2.tar.gz | 30.9 kB | Without provenance | Details for rungpu-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rungpu-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for rungpu-0.1.2-py3-none-any.whl |
Total release size: 73.3 kB
Release files / rungpu-0.1.2.tar.gz
| Download URL | rungpu-0.1.2.tar.gz |
|---|---|
| Size | 30.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bc18232ecdc5f96540e7c4f33708ce939d8f2c75f2bc0cbcb8027a0034dc2f5
|
|
BLAKE2b-256 checksum How to use checksums |
ee21ebe0214059d25125ce78edc186512cf4c815baf72bd68e90ae80d9c792cb
|
| 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.2-py3-none-any.whl
| Download URL | rungpu-0.1.2-py3-none-any.whl |
|---|---|
| Size | 42.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfdeb73ea7ed03e7e66d41f18563995f1d61dafb8aea278e4f91dd61ec7a9db1
|
|
BLAKE2b-256 checksum How to use checksums |
4143b4a1c10208d4f7661ab121861e5408fc8b312471083034416bd17f4a9726
|
| 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.2
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.