Skip to main content Switch to mobile version gpu-rich 0.0.3 Free GPUs, driven from your terminal by your AI agent.
pip install gpu-rich Copy PIP instructions
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, Vast.ai, 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.
Every terminal line and number in the demo comes from a real run on a free Kaggle T4.
Alpha, on PyPI. Commands and JSON fields can still change.
The table says how far each backend is tested. "Tested with real runs" means that a full job ran on a real account: submit, logs, results, cancel.
The Colab backend works on Linux and macOS only, because the official Colab CLI does not support Windows.
You need Python 3.11 or newer and uv.
uv tool install gpu-rich gpu-rich doctor To try it without an install, run uvx gpu-rich doctor.
gpu-rich doctor lists every backend and gives one fix line for each backend that is not ready.
Your first run, on a free Kaggle GPU
Create a Kaggle account and verify your phone number in the Kaggle settings. Kaggle gives GPU time to verified accounts only.
Go to kaggle.com > Settings > API and create a token. Save it to ~/.kaggle/access_token.
Run gpu-rich doctor. The kaggle line must start with ok.
Run the example. It fine-tunes a small text classifier with LoRA in about 5 minutes.
curl -LO https://raw.githubusercontent.com/mohamed2394/gpu-rich/main/examples/finetune_lora.py gpu-rich run finetune_lora.py The results come back to ./gpu-rich-runs/RUN_ID/outputs/: metrics.json and the LoRA adapter.
The Kaggle queue is slow at times. gpu-rich cancels a run that does not start in 5 minutes and submits it again, because a new submission usually starts in seconds.
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.
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.
Put --json before the command to get one JSON document on stdout (for agents and scripts).
Exit codes: 0 ok, 1 the run failed, 2 wrong usage, 3 sign-in problem, 4 no backend or quota, 5 platform error.
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.
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.
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.
Tests: uv run --group dev pytest. Live tests against real platforms run only with GPU_RICH_LIVE=1.
Adding a platform: docs/adding-a-backend.md.
Release check with a real agent: docs/agent-e2e.md.
The design: docs/plan.html.
The catalog is an index of 2,049 public notebooks and scripts from 19 repositories. It links to them and does not copy them. Most entries are not tested on these backends yet, so a recipe can fail because of its own dependencies.
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.
Apache-2.0. See LICENSE. The recipe catalog links to third-party notebooks; each one keeps its own licence.
Apache-2.0 View SPDX License List
Release files for gpu-rich 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 8.2 MB
Release files / gpu_rich-0.0.3.tar.gz
Release files / gpu_rich-0.0.3-py3-none-any.whl
Security for gpu-rich 0.0.3
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.
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.
Release history Release notifications | RSS feed
Nov 30, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




