Skip to main content

gpu-rich

Free GPUs, driven from your terminal by your AI agent.

gpu-rich sends a Python script or a Jupyter notebook to a free or cheap GPU (Kaggle, Google Colab, Modal, Hugging Face Jobs, NVIDIA Brev, or your own machine over SSH). It follows the run, and it brings the results back to your folder. A searchable index of public notebooks and fine-tuning recipes helps your coding agent find something to run.

It is made for students and people who start with machine learning and have no GPU budget.

Status

Alpha. Not published on PyPI yet. Commands and JSON fields can still change.

Backend Cost State
kaggle free, about 30 GPU hours each week verified in spikes
colab free when a GPU is available; uses compute units when your account has them verified in spikes
modal paid, 30 USD of monthly credits on the Starter plan verified in spikes
hf (Hugging Face Jobs) paid built from documentation, not yet run
brev (NVIDIA Brev) paid built from documentation, not yet run
ssh:<host> your own machine works with any host you can ssh to
local this machine for smoke tests

The Colab backend works on Linux and macOS only, because the official Colab CLI does not support Windows.

Install

You need Python 3.11 or newer and uv.

git clone <this repository> gpu-rich
cd gpu-rich
uv tool install --editable .
gpu-rich --version

uv tool install gpu-rich will work after the first release.

Then sign in to the platforms you want to use. gpu-rich doctor tells you how, for each one.

Quickstart for a person (60 seconds)

gpu-rich doctor                      # which backends are ready, and how to fix the others
gpu-rich plan train.py               # which backend would run it, and the cost
gpu-rich run train.py --detach       # start it; prints a run id
gpu-rich wait RUN_ID --timeout 300   # wait up to 5 minutes; run it again until the run ends
gpu-rich pull RUN_ID                 # results in ./gpu-rich-runs/RUN_ID/

Stop a run with gpu-rich cancel RUN_ID.

Quickstart for an agent

Install the skill pack into your project, then start a new agent session:

gpu-rich skills install

This writes .agents/skills/gpu-rich/ (read by Codex CLI, Gemini CLI, Qwen Code and Cursor) and .claude/skills/gpu-rich/ (read by Claude Code). Use --global to install it for all your projects, and --agent NAME for one agent only.

Then ask your agent, for example: "Fine-tune a small model on my data in data/train.csv. I have no GPU."

The agent checks the backends, prepares the job, runs it detached, waits in bounded steps, fixes failures such as out-of-memory errors, and brings the results back.

Commands

Put --json before the command to get one JSON document on stdout (for agents and scripts).

Command What it does
gpu-rich doctor Checks sign-in and quota for every backend, and says how to fix each problem.
gpu-rich backends Lists the machines each backend offers, with price and quota.
gpu-rich plan FILE Dry run: which backend would run the job, why, and the cost.
gpu-rich run FILE Runs a script or a notebook. Use --detach to return at once.
gpu-rich status [RUN] One run, or the recent runs.
gpu-rich logs [RUN] The job's log. -f follows it, --tail N keeps the last lines.
gpu-rich wait [RUN] Waits at most --timeout seconds, then prints the run.
gpu-rich pull [RUN] Downloads the outputs, result.json and the executed notebook.
gpu-rich cancel [RUN] Stops a run and frees the remote machine.
gpu-rich search QUERY Searches the recipe catalog.
gpu-rich show ID Shows one catalog entry: link, licence, needs.
gpu-rich fetch ID Downloads a catalog entry from its upstream link.
gpu-rich report [RUN] Shares the test result of a catalog run, when you agree.
gpu-rich catalog info / update Shows or updates the local catalog index.
gpu-rich skills install / path / show Installs or shows the agent skill pack.

Exit codes: 0 ok, 1 the run failed, 2 wrong usage, 3 sign-in problem, 4 no backend or quota, 5 platform error.

The job header

A script says what it needs in a PEP 723 header. The same file still runs with plain uv run train.py.

# /// script
# requires-python = ">=3.11"
# dependencies = ["transformers", "datasets", "peft"]
#
# [tool.gpu-rich]
# gpu = "T4"
# max_hours = 2
# outputs = ["outputs"]
# include = ["data/train.csv"]
# secrets = ["HF_TOKEN"]
# ///
  • outputs: what comes back. Write your results under outputs/.
  • include: extra local files to send with the job.
  • secrets: names of environment variables. The values come from your shell, never from the file.
  • max_hours: the job stops at this time.

Notebooks keep the same keys in their metadata under gpu-rich. The full format is in skills/gpu-rich/references/job-format.md.

Rules the tool follows

  • It uses the official CLI or API of each platform.
  • It supports one account per platform.
  • It ships no tunnel, no keep-alive trick and no model serving.
  • It never starts a paid backend unless you allow it.
  • It never writes a token into the code it sends.

Money safety

  • Free backends come first. A paid backend runs only with --allow-paid or --budget USD on the command, or budget_usd in ~/.gpu-rich/config.toml.
  • plan shows the estimated cost before you run anything.
  • Every job has a time limit (max_hours).
  • cancel stops the remote machine. Check gpu-rich status for runs you forgot.
  • Colab uses your compute units when your account has a balance. Modal, Hugging Face Jobs and Brev cost money.

For contributors

A note on the language

The tool is written in Python, because the platform SDKs are Python and ML students already have it. Once everything is stable, a rewrite in Rust is inevitable. lol.

Licence

Apache-2.0. See LICENSE. The recipe catalog links to third-party notebooks; each one keeps its own licence.

Metadata

Release files for gpu-rich 0.0.1

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

Source distribution (sdist)

Source distribution for gpu-rich 0.0.1
File Size Uploaded Provenance Actions
gpu_rich-0.0.1.tar.gz 4.3 MB Without provenance Details for gpu_rich-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpu-rich 0.0.1
File Interpreter ABI Platform Actions
gpu_rich-0.0.1-py3-none-any.whl Python 3 none any Details for gpu_rich-0.0.1-py3-none-any.whl

Total release size: 8.3 MB

Release files / gpu_rich-0.0.1.tar.gz

Download URL gpu_rich-0.0.1.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
590e3b15c669dd04b5a285cd972c6ed7ab99c9d27440567d9aa35630b7386f5f
BLAKE2b-256 checksum
How to use checksums
1dab66ac38b48845f99cdc4afb47356c7c953b141f35f65ed16ab74e775e8d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release files / gpu_rich-0.0.1-py3-none-any.whl

Download URL gpu_rich-0.0.1-py3-none-any.whl
Size 4.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e6623ad0eebe8732982b03d3e24edbd8c54eb95ad05aa85d26ad19b709d0a8cc
BLAKE2b-256 checksum
How to use checksums
2a9be26a528009efd9cac48fbe115e5391fe6b8146faac3643b0f6bc9149f787
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Security for gpu-rich 0.0.1

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