gpu-rich
Free GPUs, driven from your terminal by your agent.
One command-line tool sends a notebook or a training script to Kaggle, Colab, Modal, Hugging Face Jobs or NVIDIA Brev. A searchable index of public notebooks and fine-tuning recipes tells the agent what to run.
$ gpu-rich search "fine-tune whisper small"
hf-notebooks/audio/fine_tune_whisper · T4 · Apache-2.0
$ gpu-rich plan hf-notebooks/audio/fine_tune_whisper
Kaggle T4 x2 · free · 21 h left this week
$ gpu-rich run hf-notebooks/audio/fine_tune_whisper --detach
run r-7f3a queued on kaggle
$ gpu-rich wait r-7f3a --timeout 300
running · step 400/2000 · loss 0.41
$ gpu-rich pull r-7f3a
outputs/ saved · result.json · executed.ipynb
A student with no budget asks an AI coding agent to train a model. The agent finds a recipe, picks a free GPU, runs the job, reads the logs, and brings the results back to the local folder.
In scope for v1
- Run a Python script or a
.ipynbnotebook on a remote GPU with one command. - Five backends: Kaggle, Google Colab, Modal, Hugging Face Jobs, NVIDIA Brev.
- A router that reads live quota and picks the cheapest backend that fits the job.
- Status, live logs, output download and cancel for every run.
- A catalog that indexes public notebooks and recipes by link and metadata.
- A skill pack (
SKILL.md) so Claude Code, Codex, Gemini CLI and Qwen Code can drive the tool. --jsonoutput and stable exit codes on every command.
Out of scope for v1
- Model serving and public tunnels in the style of kllm. This can be a later backend feature.
- Several accounts on one platform to stack free hours. Platform terms forbid it.
- Keep-alive tricks that fake activity on an idle session.
- Copies of third-party notebooks inside our repository. The catalog stores links.
- Our own hand-written recipe collection. Tested status grows from real runs.
- A web UI, a hosted service, or user accounts.
- Native Windows support for the Colab backend, because the Colab CLI supports Linux and macOS only.
The local folder gpu-poor/ is an empty git repository. The starting material is kllm and the tools that already exist.
What kllm does and what we take from it
kllm today MIT · alpha · created 2026-11-28
kllm serves one GGUF model on Kaggle T4 x2 and exposes it through an ngrok URL. It supports one platform and one task. It has no training flow and no recipe catalog.
Ideas we reuse
- A generated notebook carries the job to Kaggle.
- The Kaggle Python API streams logs (
kernels_logs_stream) and reports GPU quota. The public CLI docs do not list these calls. - The remote job prints tagged log lines, and the local tool parses them for progress.
- A private Kaggle dataset carries secrets, because Kaggle Secrets have no CLI support.
Existing tools and the gap
| Tool | What it covers | Free GPU | Agent support | What a free-tier student still lacks |
|---|---|---|---|---|
| Google Colab CLI | colab run, exec, download. Official, Apache-2.0, released 2026. | T4 when available | Ships a skill | Colab only. No recipes. No fallback when no GPU is free. |
| Kaggle CLI | Push, status and output for notebooks. | Yes | None found | No log or stop command in the docs. Kaggle only. |
hf jobs + huggingface/skills | Clean job runner and training skills. | No free compute | Strong skill pack | Costs money from the first minute. |
| Modal CLI | Serverless GPU functions. | Monthly credits | Official skill | Needs a card for GPU use. Code must be written for Modal. |
| SkyPilot, dstack | One job spec across many clouds. | Paid clouds | Both ship a skill | No Kaggle or Colab backend. |
| Unsloth, Axolotl, LLaMA-Factory | Fine-tuning libraries with notebooks or YAML recipes. | Through notebooks | Varies | They are recipe sources. They do not launch remote compute. |
The five v1 backends cover five different shapes of compute. Every later platform fits one of these shapes, so a new adapter is small.
Kaggle free
Shape: batch notebook.
- submit
kernels_pushwith accelerator and timeout- logs
kernels_logs_stream(Python API)- outputs
kaggle kernels output- stop
- Delete the kernel. The spike confirmed that the GPU session stops at once. Each run gets its own kernel.
- quota
- Accelerator quota API. 30 GPU hours per week, confirmed by the spike.
- watch
- Secrets have no CLI support.
Google Colab free, not guaranteed
Shape: live session runtime.
- submit
colab run --gpu T4 script.pyorcolab exec -f nb.ipynb- logs
- Command output,
colab log - outputs
- Tar file on the VM, then
colab download. Download takes single files only. - stop
colab stop- quota
colab usage. Free sessions last at most 12 hours.- watch
- Linux and macOS only. One account per person.
colab execalways exits 0, so the bootstrap writes an exit-code file.
Modal $30 credits each month
Shape: serverless function.
- submit
- One
modal.Sandboxper run, in its own app. No generated wrapper is needed. - logs
- Sandbox log fetch and tail, or
modal app logs. Kept for 1 day on the Starter plan. - outputs
- Modal Volume
- stop
Sandbox.terminate(), under 1 s- quota
- No API gives the credits left. Only credits used this month are readable.
- watch
- GPU use needs a payment method on file.
Hugging Face Jobs paid
Shape: container job.
- submit
hf jobs uv run --flavor t4-small script.py- logs
fetch_job_logs(Python API)- outputs
- Push to a Hub repo or bucket
- stop
hf jobs cancel- price
- T4-small $0.40/h, A10G-small $1.00/h
- watch
- Default timeout is 30 minutes. The router uses it only with
--allow-paid.
NVIDIA Brev paid, prepaid credits
Shape: GPU machine reached over SSH.
- submit
brev create NAME -g T4, thenbrev copyandbrev exec- logs
- Tail the log file with
brev exec - outputs
brev copyback to the local folder- stop
brev stop,brev delete- price
- L4 about $0.17/h, T4 about $0.40/h, spot is lower. These are page estimates.
- watch
- Sign-in is a browser flow. A forgotten instance keeps billing, so the adapter always sets an auto-stop. Brev ships its own agent skill (
brev agent-skill).
Generic SSH and local same adapter
The Brev adapter splits into two parts: instance lifecycle and SSH execution. The SSH part alone serves a university server, a lab machine, RunPod, Vast.ai and Lambda. A local backend runs the same bundle on the student's own GPU or Mac.
All candidate platforms
A research sweep on 2026-11-29 listed 60 candidates in seven categories. The verdict column says when each one enters the project. Items marked unconfirmed come from third-party pages and need a check on the official page before we build on them.
Best for a student with no budget
- Kaggle: weekly GPU quota and a real API.
- Google Colab: free T4 when one is available.
- Local NVIDIA GPU or Apple Silicon with MLX.
- Modal: monthly credits after a card is added.
- Saturn Cloud free tier and Lightning AI credits, both shrinking.
Best for about $10 per month
- NVIDIA Brev: an L4 costs about $0.17/h on demand and about $0.05/h on spot (estimates from the pricing page).
- Hugging Face Jobs: T4-small at $0.40/h gives 25 hours.
- Thunder Compute: A100 80GB at $1.09/h gives 9 hours.
- Scaleway: L4 at €0.79/h, EU region, good CLI.
- Salad: very low headline price, reliability unknown.
1 · Free GPU notebook services
| Platform | Free offer | Headless interface | Verdict |
|---|---|---|---|
| Kaggle | T4 x2, weekly quota | CLI and Python API | v1 |
| Google Colab | T4 when available, 12 h sessions | Official CLI and MCP server | v1 |
| Lightning AI | Up to 30 credits to start. A cut was reported in November 2026 unconfirmed | SDK exists, not yet checked | next |
| Saturn Cloud | One T4-class GPU, hours unpublished | None found | later |
| HF ZeroGPU Spaces | 5 GPU minutes per day, 40 with PRO | Gradio apps only | later, demos only |
| SageMaker Studio Lab | AWS docs say it closed to new customers on 2026-07-30 | None | skip |
| Paperspace Gradient | Free M4000 GPU in private notebooks | API not confirmed | later |
| Deepnote, Datalore | No clear free GPU | None found | skip |
| Baidu AI Studio, ModelScope, Alibaba PAI-DSW, OpenBayes | Free hours claimed unconfirmed. Accounts may need a China-region phone number. | None found, or cloud API only | later, community |
2 · Serverless GPU and job platforms
| Platform | Offer and price | Headless interface | Verdict |
|---|---|---|---|
| Modal | $30 credits each month, card needed for GPU | CLI and SDK | v1 |
| Hugging Face Jobs | Paid. T4-small $0.40/h | CLI and SDK | v1 |
| RunPod Serverless | Paid per second | API | next |
| Replicate | T4 $0.81/h | HTTP API, Cog | later |
| Beam | No free tier. RTX 4090 $0.69/h | SDK and CLI | later |
| Cerebrium, Baseten, fal, Northflank, Anyscale, Koyeb | Paid, small or unpublished credits unconfirmed | CLI or API | later, on request |
| Salad | Very low consumer-GPU prices unconfirmed | REST API | later |
3 · GPU instance clouds and marketplaces
| Platform | Price signal | Headless interface | Verdict |
|---|---|---|---|
| NVIDIA Brev | L4 about $0.17/h, T4 about $0.40/h. Prepaid credits, no free credits found. | brev CLI, ships an agent skill | v1 |
| RunPod, Vast.ai, Lambda | Paid, no free tier | CLI and API | next, through the SSH adapter |
| Thunder Compute | A100 80GB $1.09/h, per-minute billing | CLI | next |
| Scaleway | L4 €0.79/h | scw CLI | later |
| Shadeform, Prime Intellect, SF Compute | Aggregators and compute markets | CLI or API | later |
| Hyperstack, Nebius, Verda, Jarvis Labs, Vultr, OVHcloud, Akash, io.net | Paid, mostly H100 and A100 class | API | later, on request |
| CoreWeave, Crusoe, Hetzner GPU | Sized for teams and monthly contracts | API | skip |
| TensorDock | Availability reports are poor unconfirmed | Not verified | skip |
4 · Hosted fine-tuning APIs
| Platform | Offer | Verdict |
|---|---|---|
| Together AI | $4 minimum per job, SDK and CLI | later, different job shape |
| Fireworks | LoRA tuning billed per token unconfirmed | later |
| Vertex AI tuning | Paid, gcloud | later |
| OpenAI fine-tuning, Predibase | Closed to new users, or absorbed by another company | skip |
These services manage the GPU for you and accept a dataset. They do not run arbitrary notebooks, so they stay outside the v1 job model.
5 and 6 · Student credits and academic compute
| Program | Offer | How gpu-rich uses it |
|---|---|---|
| Azure for Students | $100, no card at sign-up. GPU access without a card is unclear. | Docs page that explains the route. No adapter in v1. |
| GitHub Student Developer Pack | Includes the Azure credit unconfirmed | Docs page |
| Google Cloud for Education | Credits given through a teacher | Docs page |
| Modal academic credits | Up to $10k for graduate students and labs | Works with the Modal adapter |
| NSF ACCESS, NAIRR pilot | Free allocations for US researchers and students | Slurm over SSH, a later adapter |
| Google TPU Research Cloud | Free TPUs by invitation | Later |
| EuroHPC | No student route found | Skip |
gpu-rich doctor can print these programs as hints when a student has no usable backend.
7 · Local and self-managed machines
| Target | Interface | Verdict |
|---|---|---|
| Local NVIDIA GPU | Direct process | v1, the local backend |
| Any machine with SSH | ssh | v1, shared with Brev |
| Apple Silicon with MLX | mlx_lm CLI | next |
| University Slurm cluster | sbatch over SSH | next |
A plain CLI is the product. The agent learns it from a skill file. Each platform sits behind one adapter with the same eight methods.
Architecture. Ctrl/Cmd + wheel to zoom. Drag to pan. Double-click to fit.
Four building blocks
1. Job spec
A job is a source, a hardware need, dependencies, secrets and output paths. For scripts the spec lives in the PEP 723 header that uv and hf jobs uv run already read. For notebooks the spec comes from the catalog entry or from flags.
2. Bundle and bootstrap
The tool packs the source with one small bootstrap script. The bootstrap runs on the remote machine. It installs dependencies with uv, runs the script or executes the notebook with papermill, prints tagged progress lines, and writes result.json. Every adapter ships the same bundle.
3. Adapter
An adapter turns the bundle into the platform's native form: a generated notebook for Kaggle, a Colab session with a background process, a Modal Sandbox, a uv job for Hugging Face, an SSH session for Brev. Adapters hold all platform knowledge.
4. Router
The router drops backends that cannot meet the VRAM and time need. It reads live quota. It ranks free backends first and then the cheapest paid one. A paid backend runs only when the user passes --allow-paid or sets a budget.
One run from search to results. The agent polls with bounded waits, so a long job never blocks its session.
Catalog pipeline
The catalog is a build product. A weekly job crawls the source repositories, extracts metadata from each notebook, and publishes one file. The CLI downloads that file and searches it locally with SQLite full-text search. The search works offline and needs no server.
Catalog build. The notebook itself is fetched from its upstream URL only when a user runs it.
| Source | Size | Topics | Licence |
|---|---|---|---|
| huggingface/notebooks | 1,525 notebooks | Transformers, diffusers, many tasks | Apache-2.0 |
| unslothai/notebooks | 610 notebooks | LLM, vision and TTS fine-tuning | LGPL-3.0 |
| keras-team/keras-io | 265 notebooks | Vision, NLP, classic deep learning | Apache-2.0 |
| NielsRogge/Transformers-Tutorials | 153 notebooks | Vision and multimodal | MIT |
| huggingface/cookbook | 139 notebooks | LLM, RAG, agents | Apache-2.0 |
| roboflow/notebooks | 98 notebooks | Detection, segmentation | None stated |
| rasbt/LLMs-from-scratch | 69 notebooks | Build an LLM step by step | Apache-2.0 |
| meta-llama/llama-cookbook | 69 notebooks | Llama fine-tuning and inference | MIT |
| axolotl, LLaMA-Factory | 357 and 120 YAML recipes | Fine-tuning configs | Apache-2.0 |
| diffusers examples, pytorch/tutorials, cleanrl | Scripts | LoRA training, PyTorch basics, RL | Apache-2.0, BSD-3, MIT |
Testing along the way
Every run writes a small report: recipe id, backend, GPU, result, duration and error class. The command gpu-rich report shares that report when the user agrees. The weekly build merges shared reports, so each catalog entry shows where it last worked. Most indexed notebooks will need small fixes before they run headless. The agent makes those fixes, and that is where an agent adds the most value.
Agent layer
Skill pack
One SKILL.md in the open Agent Skills format teaches the loop: doctor, search, plan, run, wait, pull, fix. gpu-rich skills install copies it into the agent's skill folder.
Machine output
Every command accepts --json. Exit codes separate a failed run, an auth problem and an empty quota. Few existing tools offer this.
Error hints
The tool classifies a failed run as out of memory, missing dependency, quota, timeout or platform error. The JSON carries a short hint, for example a smaller batch size or another backend.
Estimates are working days of agent-led building with you reviewing. They hold only if the phase 0 spikes pass. Phases 2 and 3 can run in parallel.
Phase 0 · Spikes about 1 day · needs your sign-ins, about 20 minutes
- Kaggle: push a script with a GPU, stream logs, download output, cancel, read quota.
- Colab:
colab run --gpu T4on a free account. Record what happens when no T4 is free. - Modal: generated wrapper, detached run, logs, Volume download.
- HF Jobs:
hf jobs uv run, logs, outputs pushed to the Hub. - Brev: create an instance, run over SSH, stop it, read the cost.
- Catalog: crawl three repositories and check the search quality on ten real questions.
Phase 1 · Core and Kaggle about 2 days · depends on phase 0
- Job spec, bundle, bootstrap runner, run store, adapter interface.
- Kaggle adapter and the commands
doctor,run,status,logs,wait,pull,cancel. --jsonoutput, exit codes, first version ofSKILL.md.
Phase 2 · Four more backends and the router about 3 days · depends on phase 1
- Colab, Modal, HF Jobs, Brev with the shared SSH part, and
local. - Router with live quota,
plan,backends,--allow-paidand a budget cap. - Secret handling per backend.
Phase 3 · Catalog 2 to 3 days · depends on phase 1 · parallel with phase 2
- Crawler, metadata extraction, portability score, SQLite build, weekly GitHub Action.
- One LLM pass per notebook family at build time. It writes the main task, the main model, a trains flag and a summary.
- Entries group their copies in a
variantslist. search,show,fetch, andrunby catalog id.- Run reports and the merge of shared reports.
Phase 4 · Agent experience 1 to 2 days · depends on phases 2 and 3
- Full skill pack with reference files for each backend and for common failures.
- Error classification and hints.
- End-to-end sessions with Claude Code and one other agent.
Phase 5 · Public release 1 to 2 days
- README, demo recording, PyPI package, guide for adding a backend.
- A list of ten starter recipes that passed on a free backend.
Everything is new. The stack is Python 3.11+, uv, Typer, Rich, Pydantic and the standard-library SQLite. The README says that a Rust rewrite follows when the tool is stable, so the adapter interface and the JSON contracts stay language-neutral.
Repository layout
gpu-rich/
├── pyproject.toml package, extras per backend: [kaggle] [modal] [hf]
├── README.md · LICENSE
├── src/gpu_rich/
│ ├── cli.py Typer app, all commands
│ ├── models.py JobSpec, Run, Offer, Quota (Pydantic)
│ ├── jobspec.py reads PEP 723 header, notebook metadata, flags
│ ├── bundle.py packs source + bootstrap into one archive
│ ├── bootstrap/runner.py runs on the remote machine
│ ├── router.py picks a backend
│ ├── store.py SQLite run store under ~/.gpu-rich
│ ├── secrets.py OS keychain access
│ ├── output.py human view and --json view, exit codes
│ ├── errors.py failure classes and hints
│ ├── backends/
│ │ ├── base.py the Backend protocol
│ │ ├── kaggle.py · colab.py · modal.py · hf_jobs.py
│ │ ├── brev.py · ssh.py · local.py
│ └── catalog/
│ ├── index.py local full-text search
│ ├── fetch.py downloads an entry from its upstream URL
│ └── report.py run reports
├── catalog-build/ runs in CI, never ships in the package
│ ├── sources.yaml repo, licence, link-only flag
│ ├── crawl.py · extract.py · build.py
├── skills/gpu-rich/
│ ├── SKILL.md
│ └── references/ one file per backend, one for failures
├── tests/
│ ├── unit/ · contract/ · catalog/
│ └── live/ real platforms, off by default
├── spikes/ phase 0 experiments, kept for reference
├── docs/plan.html
└── .github/workflows/ci.yml · catalog.yml
These contracts are the stable surface. Agents and contributors depend on them.
Commands
| Command | Purpose |
|---|---|
gpu-rich doctor | Checks sign-in and quota for every backend and tells the user how to fix each problem. |
gpu-rich backends | Lists backends with GPU types, price and quota left. |
gpu-rich search QUERY | Searches the catalog. Filters: --task, --framework, --max-vram, --source. |
gpu-rich show ID | Prints one entry: link, licence, needs, where it last worked. |
gpu-rich fetch ID | Downloads the notebook or script from its upstream URL for local edits. |
gpu-rich plan TARGET | Dry run. Shows the chosen backend, the reason and the cost. |
gpu-rich run TARGET | Runs a file or a catalog id. Flags: --backend, --gpu, --hours, --detach, --allow-paid, --secret. |
gpu-rich status [RUN] | State of one run or of all recent runs. |
gpu-rich logs RUN | Log lines. Flags: -f, --tail. |
gpu-rich wait RUN | Blocks until the run ends or --timeout passes, then prints state and the last lines. |
gpu-rich pull RUN | Downloads outputs, result.json and the executed notebook. |
gpu-rich cancel RUN | Stops the run and frees the remote machine. |
gpu-rich report RUN | Shares the test result of a catalog run after the user agrees. |
gpu-rich skills install | Copies the skill pack into the agent's skill folder. |
Global flags: --json, --yes, --quiet. Exit codes: 0 success, 1 run failed, 2 wrong usage, 3 sign-in problem, 4 quota empty, 5 platform error.
Job spec in a script header (PEP 723)
# /// script
# requires-python = ">=3.11"
# dependencies = ["unsloth", "datasets", "trackio"]
#
# [tool.gpu-rich]
# min_vram_gb = 15
# max_hours = 2
# outputs = ["outputs/"]
# secrets = ["HF_TOKEN"]
# ///
The same file runs with plain uv run and with hf jobs uv run. Tools that do not know the [tool.gpu-rich] table ignore it.
Backend protocol
class Backend(Protocol):
name: str
def doctor(self) -> AuthState: ...
def offers(self) -> list[Offer]: ... # gpu, vram_gb, max_hours, usd_per_hour
def quota(self) -> Quota | None: ... # hours or credits left
def submit(self, bundle: Bundle, spec: JobSpec) -> RemoteRef: ...
def status(self, ref: RemoteRef) -> RunState: ...
def logs(self, ref: RemoteRef, follow: bool) -> Iterator[str]: ...
def pull(self, ref: RemoteRef, dest: Path) -> list[Path]: ...
def cancel(self, ref: RemoteRef) -> None: ...
# RunState: queued | running | succeeded | failed | cancelled | timed_out
Run record returned by --json
{
"run_id": "r-7f3a",
"target": "hf-notebooks/audio/fine_tune_whisper",
"backend": "kaggle",
"gpu": "T4 x2",
"state": "failed",
"started_at": "2026-12-03T10:12:00Z",
"duration_s": 912,
"cost_usd": 0.0,
"error": {
"class": "out_of_memory",
"hint": "Lower per_device_train_batch_size or run on a GPU with 24 GB."
},
"last_lines": ["torch.OutOfMemoryError: CUDA out of memory ..."],
"outputs_dir": null
}
Catalog entry
{
"id": "hf-notebooks/audio/fine_tune_whisper",
"title": "Fine-tune Whisper for multilingual ASR",
"source_repo": "huggingface/notebooks",
"url": "https://github.com/huggingface/notebooks/blob/main/...",
"licence": "Apache-2.0",
"kind": "notebook",
"tasks": ["speech-recognition", "fine-tuning"],
"frameworks": ["transformers"],
"models": ["openai/whisper-small"],
"dependencies": ["transformers", "datasets", "evaluate", "jiwer"],
"min_vram_gb": 11,
"vram_source": "observed",
"trains": true,
"variants": ["kaggle", "colab"],
"portability": 0.7,
"last_commit": "2026-10-02",
"tested": [
{"backend": "kaggle", "gpu": "T4 x2", "date": "2026-12-03", "result": "passed"}
]
}
| Risk | Area | Level | Answer |
|---|---|---|---|
| Platform terms | Release | high | The tool uses official CLIs and APIs only. It supports one account per platform. It ships no tunnel, no keep-alive and no serving. The README states these rules. |
| Free quota is unreliable | UX | high | Colab gives a free GPU only when one is available. The router falls back to the next backend and says why. |
| Indexed notebooks do not run headless | Correctness | high | Many notebooks use Drive mounts, widgets and Colab-only imports. A portability score ranks search results. The skill teaches the agent the usual fixes. Run reports record what passed. |
| Surprise cost | Safety | high | Paid backends need --allow-paid. Every run has a time limit. plan shows the cost before the run. Brev instances always get an auto-stop. |
| Secret leak | Security | medium | Tokens stay in the OS keychain. The tool never writes a token into pushed source. Kaggle receives secrets through a private dataset. Log output is redacted. |
| API drift | Maintenance | medium | The Colab CLI is seven months old. The Kaggle log call is missing from the CLI docs. Each adapter is isolated, and a weekly live smoke test catches breaks. |
| Windows users | Reach | medium | The Colab CLI does not support Windows. The Colab backend reports this in doctor and suggests WSL. The other backends work on Windows. |
| Catalog licences | Legal | medium | The catalog holds links and metadata. The licence of public Kaggle notebooks is unconfirmed, so Kaggle notebooks stay out of the index until that is checked. |
| Project name | Release | medium | The name is decided: gpu-rich. The PyPI and GitHub names are not checked yet. Check them before the first release. |
| Scope growth | Delivery | medium | Dozens of platforms are possible. v1 ships five. A new backend is a contribution that follows the adapter guide. |
Decisions already made
| Decision | Choice | Reason |
|---|---|---|
| Agent interface | CLI with --json plus a skill pack | SkyPilot, dstack, Modal and the Colab CLI all ship skills. A skill works in every major coding agent. An MCP server can follow if a live tool needs it. |
| Language | Python now, Rust later | The Kaggle, Modal and Hugging Face SDKs are Python, and students already have it. A Rust rewrite follows when the tool is stable. The README says so. |
| Job format | PEP 723 script header | It is an existing standard, and Hugging Face Jobs already reads it. |
| Colab access | Wrap the official Colab CLI | It is maintained by Google and has colab run. We write no private API client. |
| Catalog storage | One SQLite file with full-text search | It works offline and needs no server or vector database. |
| Catalog content | Index only | Your choice. It also removes the licence problem. |
| Serving | Left out of v1 | Your choice of v1 job. Serving from a free notebook is the part with the most terms risk. |
| Layer | What it checks | Where | Runs |
|---|---|---|---|
| Unit | Job spec parsing, router ranking, bundle content, run store, JSON shape, exit codes, log redaction. | tests/unit/ | Every commit |
| Contract | Every adapter passes one shared suite against a fake platform: submit, status changes, log order, pull, cancel twice, expired sign-in. | tests/contract/ | Every commit |
| Bootstrap | The runner executes a script and a notebook in a clean container and writes a correct result.json on success, failure and timeout. | tests/unit/test_runner.py | Every commit |
| Catalog | Extraction on fixture notebooks: pip cells, GPU hints, Colab-only imports, missing licence. Search returns expected ids for ten fixed questions. | tests/catalog/ | Every commit |
| Live smoke | A two-minute job on each real backend: nvidia-smi, one training step, one output file. | tests/live/ | Weekly and before a release, with GPU_RICH_LIVE=1 |
| Agent end-to-end | An agent with only the skill pack completes search, run, a forced out-of-memory failure, a fix and a pull. | Manual script in docs/ | Before a release |
GPU_RICH_HOME to a temporary folder. No test reads the real run store or the real keychain. Live tests use a throwaway project name and delete their remote resources at the end.Edge cases with a named test: quota runs out during a run, a session is preempted, a notebook asks for input, output is larger than the platform limit, the network drops during logs -f, two runs start at once on a platform that allows one.
uv tool install gpu-richworks on macOS and Linux, and on Windows for every backend except Colab.gpu-rich doctorreports the state of all five backends and gives a fix for each problem.- One unedited script with a PEP 723 header runs on Kaggle, Colab, Modal, HF Jobs and Brev.
- One unedited notebook runs on Kaggle and Colab and comes back as an executed notebook.
- With Kaggle quota at zero,
runpicks Colab or Modal and prints the reason. - No paid backend starts without
--allow-paidor a budget. cancelleaves no running remote resource on any backend.searchanswers in under one second offline, and eight of ten fresh test questions get a fitting recipe at rank 1.- Every command prints valid JSON with
--json, and the exit codes match the table. - Claude Code, with only the skill pack, takes a student request from search to pulled results.
- No token appears in pushed source, logs or the run store.
Phase 0 needs accounts that only you can open. Three decisions are yours.
Accounts for the spikes
- Kaggle: an API token and a phone-verified account for GPU use.
- Google: one account for the Colab CLI sign-in.
- Modal: an account. GPU use needs a card on file.
- Hugging Face: a token and a few dollars of credit for Jobs.
- NVIDIA Brev: an account.
You sign in yourself in your terminal. I never see or type the passwords.
Decisions for you
- Name: decided. The project is
gpu-rich. The local folder still has the old name. - kllm author: decided. No invitation.
- Licence: open. I recommend Apache-2.0. It matches most of the tools we wrap.
uv tool install google-colab-cli. Those two unlock the two free backends, and phase 0 can start.Real runs on real accounts, 2026-11-29. Scripts and raw findings are in spikes/.
| Spike | Verdict | What the run showed |
|---|---|---|
| Kaggle | pass | 30 GPU hours per week confirmed. Push takes 1.5 s. Logs stream live. Outputs download. Queue time was 8 s twice and more than 10 minutes once. The spikes used 5 min 19 s of quota. |
| Colab | pass, with traps | A T4 is ready in 4 to 6 s, once in 96 s. Logs stream live. Notebooks come back executed. A detached job ran with no local process. About 0.12 compute units used. The test account has paid units, so free-tier GPU availability is still untested. |
| Catalog | partial | Crawl, extract and build take under 20 s for 3 repos. Search answers in 2.6 ms. 2,288 notebooks shrink to 695 entries after copies are removed. On 8 fresh questions, 52% of top-5 results fit. |
| Modal | pass | A Modal Sandbox runs a plain script on a T4 with no wrapper app. The run id returns in 1.5 s, the T4 starts in 3 to 5 s, and cancel takes under 1 s. Logs, exit code and partial outputs all come back. Three GPU runs cost $0.024. |
| HF Jobs | not run | Your choice. The adapter is built from the documentation and stays marked untested. |
| Brev | skipped | The CLI is not installed yet. |
Design changes that come from the spikes
Kaggle adapter
- Each run gets its own kernel.
canceldeletes that kernel, and the GPU session stops at once. - The official cancel call needs a session id that Kaggle does not expose. A replacement push leaves the old session running.
- The adapter saves logs and outputs before it deletes a kernel.
- A queue timeout, 5 minutes by default, sends the job to the next backend.
- The adapter pushes notebooks. A save-without-run push fails on script kernels.
- The log ends with about ten lines of conversion noise. The adapter removes them.
- Kaggle CLI 2.2.5 needs the
sixpackage and does not declare it.
Colab adapter
- The adapter starts a session, launches the bootstrap as a background process, and polls marker files. This gives a real
--detach. colab execalways exits 0. The bootstrap writes the exit code to a file.- The default 30 s silence limit kills quiet jobs. The adapter sets
--timeout 0. --envstores secret values in a local history file in clear text. The adapter uploads secrets as a file and deletes it after the bootstrap reads it.- Outputs travel as one tar file, because download takes single files.
- The CLI has no JSON output and waits for keyboard input when the sign-in expires. The adapter parses text and closes stdin.
- Open point: how long Colab keeps a detached job alive when the kernel is idle. The longest check was 81 s.
Bootstrap runner
- It writes
exit_codeandresult.jsonon every backend. The adapters read these files and ignore the platform's own exit status. - It executes notebooks with papermill, which stops at the first failing cell.
colab exec -fcontinues after a failing cell. - It reads secrets from a file and removes the file.
Modal adapter
- The adapter creates one Sandbox per run inside its own app, with the outputs folder on a Volume. This replaces the generated wrapper app in the first design.
- A later process reads the state with the sandbox id: running, exit code, 124 for a timeout, 137 for a kill.
- Exit code 137 is ambiguous. The adapter records its own cancel in the run store.
- Cost is reported per app, so one app per run gives the cost of each run about a minute after it ends.
- Secrets pass through an anonymous secret at create time. The value did not appear in logs or metadata.
- Modal has no call for credits left. The router shows "unknown" and asks for a budget.
- Open points: GPU containers can be preempted, and nobody tested a run longer than 300 s or how long a sandbox id stays valid.
Catalog
- About 70% of notebook files are copies: translations, framework variants and vendor copies. Each source repo needs its own copy rule.
- Keyword search alone is too weak. More than half of the notebooks contain "fine-tune". One LLM pass per notebook family at build time adds the main task, the main model and a trains flag.
- 92 Unsloth notebooks print their peak GPU memory in saved outputs. The crawler reads these as
vram_source: observed. - VRAM is known for 42% of entries. The rest shows "unknown" until a run report fills it.
- Colab-only code appears in about 1% of notebooks. Login prompts (15%) and secrets (32%) are the real blockers.
- Three repos give 695 entries. The earlier target of 3,000 is replaced by about 1,500, to be confirmed when more sources are crawled.
State on 2026-11-29. The parts were built in parallel by subagents and joined through one adapter contract. Nothing is released and nothing is committed to git.
gpu-rich run examples/finetune_lora.py --backend kaggle --detach sent a LoRA fine-tune of DistilBERT to Kaggle. The queue took 9 s. The job ran 53 s on 2x Tesla T4 and reached 0.86 accuracy on SST-2. wait reported succeeded, and the adapter files, metrics.json and result.json landed in the local folder.| Part | State | Proof |
|---|---|---|
| CLI core | works | doctor, backends, plan, run, status, logs, wait, pull, cancel. End-to-end tests on the local backend cover detach, failure hints, cancel, secrets and notebooks. |
| Bootstrap runner and bundle | works | 58 tests. Ran for real on Kaggle, Colab and Modal. |
| Router | works | On the real accounts it chose Kaggle as free and refused Colab, Modal and HF as paid, with a cost for each. |
| Kaggle backend | verified live | Full run through the CLI on 2x T4. Cancel by kernel delete was proven in the spike. |
| Colab backend | verified live | Full run with pull and a cancel on a real T4. The idle watchdog is tested with fakes only. |
| Modal backend | verified live | Full run in 42 s and a cancel in 1.7 s on a real T4. Cost about $0.007. |
| HF Jobs backend | unverified | 54 tests against a fake API. No real job has run. The account reports that it cannot pay. |
| Brev backend | unverified | Built from the documentation. The CLI is not installed. Prices are estimates. |
| SSH and local backends | works | Every remote script ran for real through a local transport. No real SSH host was used. |
| Skill pack and docs | written | skills install for Claude Code, Codex, Gemini CLI, Qwen Code and Cursor. README, backend guide, CI workflow. No agent has driven a full session with the skill yet. |
| Catalog | works | 2,049 entries from 19 repos in a 6.5 MB index that ships in the package. search, show, fetch, report and run ID work. On 10 new questions, 64% of top-5 results fit and 8 of 10 have a fitting recipe at rank 1. One judge scored this, so the numbers are rough. |
What the real runs changed
- Kaggle's image ships
torchao0.10, and its ownpeftrefuses versions below 0.16. A plain LoRA script fails there. The tool now gives the fix as a hint: addtorchao>=0.16.0to the dependencies. - Kaggle's status API drops single requests. The adapter retries reads and never retries a push.
- One Kaggle run stayed queued for more than 15 minutes, and the next one started in 5 s.
runmoves to the next backend when a queue is slower than 5 minutes. - A Colab status call takes 3 to 60 s, and one call can hang. The adapter retries read-only calls with a time limit.
- Outputs download automatically when a run ends. A paid Colab session or Modal app is released at that moment.
- A job with secrets skips Kaggle, because Kaggle has no safe way to receive them yet.
First catalog recipe on a real GPU
gpu-rich run unsloth/nb/whisper fetched the Kaggle copy of the Unsloth Whisper notebook and ran it headless on 2x T4 with no edits. The run failed after 92 s at the import of Unsloth: a CUDA library that the notebook's own installs need is missing on Kaggle's image. The executed notebook, the log and a test report came back. So the path from catalog id to a real run works, and a portability score of 1.00 does not mean a notebook runs today. Run reports are the only real proof.
The first submission of that run stayed in Kaggle's queue for 29 minutes. A second submission started in 12 s. run now submits again to the same backend, twice by default, before it moves to the next one.
Still open
- No coding agent has run the full loop with the skill pack. That is the phase 4 test.
- The Colab watchdog, long Colab jobs with an idle kernel, Modal preemption, and every HF Jobs and Brev path are unproven on the real platforms.
- Each Kaggle run leaves a private kernel on the account. A finished kernel costs nothing.
pullcan delete it if you prefer. fetchdownloads one file. Recipes that are scripts with sibling files will not run as fetched.- The LLM pass over the catalog is written and tested with a fake only. It has never run.
- The licence is not chosen, and the name is not checked on PyPI.