gpu-rich 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gpu_rich-0.0.1/.claude/launch.json +11 -0
- gpu_rich-0.0.1/.github/workflows/catalog.yml +109 -0
- gpu_rich-0.0.1/.github/workflows/ci.yml +56 -0
- gpu_rich-0.0.1/.gitignore +18 -0
- gpu_rich-0.0.1/LICENSE +201 -0
- gpu_rich-0.0.1/PKG-INFO +168 -0
- gpu_rich-0.0.1/README.md +144 -0
- gpu_rich-0.0.1/catalog-build/build.py +283 -0
- gpu_rich-0.0.1/catalog-build/crawl.py +447 -0
- gpu_rich-0.0.1/catalog-build/enrich.py +221 -0
- gpu_rich-0.0.1/catalog-build/evaluate.py +164 -0
- gpu_rich-0.0.1/catalog-build/evaluation.json +304 -0
- gpu_rich-0.0.1/catalog-build/export_for_enrichment.py +86 -0
- gpu_rich-0.0.1/catalog-build/extract.py +1136 -0
- gpu_rich-0.0.1/catalog-build/judgments.json +332 -0
- gpu_rich-0.0.1/catalog-build/queries.json +40 -0
- gpu_rich-0.0.1/catalog-build/sources.toml +240 -0
- gpu_rich-0.0.1/docs/adding-a-backend.md +135 -0
- gpu_rich-0.0.1/docs/agent-e2e.md +99 -0
- gpu_rich-0.0.1/docs/plan.html +1327 -0
- gpu_rich-0.0.1/examples/finetune_lora.py +93 -0
- gpu_rich-0.0.1/pyproject.toml +46 -0
- gpu_rich-0.0.1/skills/.keep +0 -0
- gpu_rich-0.0.1/skills/gpu-rich/SKILL.md +152 -0
- gpu_rich-0.0.1/skills/gpu-rich/references/backends.md +85 -0
- gpu_rich-0.0.1/skills/gpu-rich/references/job-format.md +107 -0
- gpu_rich-0.0.1/skills/gpu-rich/references/json-contract.md +193 -0
- gpu_rich-0.0.1/skills/gpu-rich/references/recipes.md +77 -0
- gpu_rich-0.0.1/skills/gpu-rich/references/troubleshooting.md +136 -0
- gpu_rich-0.0.1/src/gpu_rich/__init__.py +3 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/__init__.py +44 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/base.py +115 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/brev.py +307 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/colab.py +648 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/hf_jobs.py +577 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/kaggle.py +823 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/local.py +177 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/modal.py +491 -0
- gpu_rich-0.0.1/src/gpu_rich/backends/ssh.py +523 -0
- gpu_rich-0.0.1/src/gpu_rich/bootstrap/__init__.py +1 -0
- gpu_rich-0.0.1/src/gpu_rich/bootstrap/runner.py +391 -0
- gpu_rich-0.0.1/src/gpu_rich/bundle.py +226 -0
- gpu_rich-0.0.1/src/gpu_rich/catalog/__init__.py +9 -0
- gpu_rich-0.0.1/src/gpu_rich/catalog/api.py +134 -0
- gpu_rich-0.0.1/src/gpu_rich/catalog/commands.py +223 -0
- gpu_rich-0.0.1/src/gpu_rich/catalog/data/catalog.sqlite +0 -0
- gpu_rich-0.0.1/src/gpu_rich/catalog/index.py +481 -0
- gpu_rich-0.0.1/src/gpu_rich/catalog/report.py +52 -0
- gpu_rich-0.0.1/src/gpu_rich/cli.py +527 -0
- gpu_rich-0.0.1/src/gpu_rich/config.py +38 -0
- gpu_rich-0.0.1/src/gpu_rich/errors.py +88 -0
- gpu_rich-0.0.1/src/gpu_rich/jobspec.py +110 -0
- gpu_rich-0.0.1/src/gpu_rich/models.py +134 -0
- gpu_rich-0.0.1/src/gpu_rich/output.py +55 -0
- gpu_rich-0.0.1/src/gpu_rich/router.py +118 -0
- gpu_rich-0.0.1/src/gpu_rich/skills_cmd.py +202 -0
- gpu_rich-0.0.1/src/gpu_rich/store.py +69 -0
- gpu_rich-0.0.1/tests/catalog/_catalog_helpers.py +155 -0
- gpu_rich-0.0.1/tests/catalog/test_catalog_cli.py +124 -0
- gpu_rich-0.0.1/tests/catalog/test_catalog_enrich.py +142 -0
- gpu_rich-0.0.1/tests/catalog/test_catalog_extract.py +93 -0
- gpu_rich-0.0.1/tests/catalog/test_catalog_fetch_report.py +121 -0
- gpu_rich-0.0.1/tests/catalog/test_catalog_search.py +163 -0
- gpu_rich-0.0.1/tests/contract/test_brev_fake.py +389 -0
- gpu_rich-0.0.1/tests/contract/test_colab_fake.py +496 -0
- gpu_rich-0.0.1/tests/contract/test_hf_jobs_fake.py +563 -0
- gpu_rich-0.0.1/tests/contract/test_kaggle_fake.py +928 -0
- gpu_rich-0.0.1/tests/contract/test_modal_fake.py +480 -0
- gpu_rich-0.0.1/tests/contract/test_ssh_fake.py +541 -0
- gpu_rich-0.0.1/tests/live/test_colab_live.py +203 -0
- gpu_rich-0.0.1/tests/live/test_kaggle_live.py +201 -0
- gpu_rich-0.0.1/tests/live/test_modal_live.py +175 -0
- gpu_rich-0.0.1/tests/unit/test_bundle.py +382 -0
- gpu_rich-0.0.1/tests/unit/test_cli_local.py +136 -0
- gpu_rich-0.0.1/tests/unit/test_jobspec.py +79 -0
- gpu_rich-0.0.1/tests/unit/test_runner.py +512 -0
- gpu_rich-0.0.1/tests/unit/test_skill_pack.py +219 -0
- gpu_rich-0.0.1/tests/unit/test_skills_cmd.py +202 -0
- gpu_rich-0.0.1/tests/unit/test_store_errors_router.py +138 -0
- gpu_rich-0.0.1/uv.lock +2696 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
name: catalog
|
|
2
|
+
|
|
3
|
+
# Weekly rebuild of the recipe catalog (index only: links and metadata, never copies of notebooks).
|
|
4
|
+
# Clones the sources (blobless, sparse), runs crawl -> extract -> build -> evaluate, and publishes
|
|
5
|
+
# catalog.sqlite as a workflow artifact and as an asset of the rolling `catalog` release.
|
|
6
|
+
# Cloned repos are data: the pipeline parses them as JSON / text and never runs or installs them.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
schedule:
|
|
10
|
+
- cron: "17 4 * * 1" # Mondays 04:17 UTC
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
inputs:
|
|
13
|
+
publish:
|
|
14
|
+
description: "Upload catalog.sqlite to the `catalog` release"
|
|
15
|
+
type: boolean
|
|
16
|
+
default: true
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
concurrency:
|
|
22
|
+
group: catalog
|
|
23
|
+
cancel-in-progress: false
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
timeout-minutes: 60
|
|
29
|
+
permissions:
|
|
30
|
+
contents: write # release upload
|
|
31
|
+
env:
|
|
32
|
+
WORK: catalog-build/_work
|
|
33
|
+
PY: "3.12"
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- uses: astral-sh/setup-uv@v6
|
|
38
|
+
|
|
39
|
+
- name: Install Python
|
|
40
|
+
run: uv python install "$PY"
|
|
41
|
+
|
|
42
|
+
- name: Restore source clones
|
|
43
|
+
uses: actions/cache@v4
|
|
44
|
+
with:
|
|
45
|
+
path: catalog-build/_work/src
|
|
46
|
+
key: catalog-src-${{ github.run_id }}
|
|
47
|
+
restore-keys: catalog-src-
|
|
48
|
+
|
|
49
|
+
- name: Previous catalog (for id aliases)
|
|
50
|
+
env:
|
|
51
|
+
GH_TOKEN: ${{ github.token }}
|
|
52
|
+
run: |
|
|
53
|
+
mkdir -p "$WORK/prev"
|
|
54
|
+
gh release download catalog --pattern catalog.sqlite --dir "$WORK/prev" || echo "no previous release"
|
|
55
|
+
|
|
56
|
+
- name: Crawl (clone or fetch from github.com)
|
|
57
|
+
run: uv run --no-project --python "$PY" python -I catalog-build/crawl.py --src "$WORK/src" --out "$WORK/out" --sync
|
|
58
|
+
|
|
59
|
+
- name: Extract
|
|
60
|
+
run: uv run --no-project --python "$PY" python -I catalog-build/extract.py --src "$WORK/src" --out "$WORK/out"
|
|
61
|
+
|
|
62
|
+
- name: Enrich (only when the ANTHROPIC_API_KEY secret is set)
|
|
63
|
+
env:
|
|
64
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
65
|
+
run: |
|
|
66
|
+
if [ -z "$ANTHROPIC_API_KEY" ]; then echo "no key: skipped"; exit 0; fi
|
|
67
|
+
uv run --no-project --python "$PY" python -I catalog-build/enrich.py --out "$WORK/out" \
|
|
68
|
+
--cache "$WORK/src/.enrich-cache" --output "$WORK/out/enrichment.jsonl" --limit 500
|
|
69
|
+
|
|
70
|
+
- name: Build
|
|
71
|
+
run: |
|
|
72
|
+
prev=""; [ -f "$WORK/prev/catalog.sqlite" ] && prev="--previous $WORK/prev/catalog.sqlite"
|
|
73
|
+
enr="catalog-build/enrichment.jsonl"; [ -f "$WORK/out/enrichment.jsonl" ] && enr="$WORK/out/enrichment.jsonl"
|
|
74
|
+
uv run --no-project --python "$PY" python -I catalog-build/build.py --out "$WORK/out" \
|
|
75
|
+
--db "$WORK/out/catalog.sqlite" --enrichment "$enr" $prev
|
|
76
|
+
|
|
77
|
+
- name: Evaluate
|
|
78
|
+
run: uv run --no-project --python "$PY" python -I catalog-build/evaluate.py --out "$WORK/out"
|
|
79
|
+
|
|
80
|
+
- name: Size check (the wheel ships it; keep it under 8 MB)
|
|
81
|
+
run: |
|
|
82
|
+
size=$(stat -c %s "$WORK/out/catalog.sqlite")
|
|
83
|
+
echo "catalog.sqlite: $size bytes"
|
|
84
|
+
[ "$size" -lt 8388608 ]
|
|
85
|
+
|
|
86
|
+
- name: Catalog tests against the new file
|
|
87
|
+
run: |
|
|
88
|
+
cp "$WORK/out/catalog.sqlite" src/gpu_rich/catalog/data/catalog.sqlite
|
|
89
|
+
uv run --python "$PY" --group dev pytest tests/catalog -q
|
|
90
|
+
|
|
91
|
+
- uses: actions/upload-artifact@v4
|
|
92
|
+
with:
|
|
93
|
+
name: catalog-${{ github.run_number }}
|
|
94
|
+
path: |
|
|
95
|
+
catalog-build/_work/out/catalog.sqlite
|
|
96
|
+
catalog-build/_work/out/evaluation.json
|
|
97
|
+
catalog-build/_work/out/crawl_stats.json
|
|
98
|
+
catalog-build/_work/out/extract_stats.json
|
|
99
|
+
catalog-build/_work/out/build_stats.json
|
|
100
|
+
retention-days: 30
|
|
101
|
+
|
|
102
|
+
- name: Publish to the `catalog` release
|
|
103
|
+
if: github.event_name == 'schedule' || inputs.publish
|
|
104
|
+
env:
|
|
105
|
+
GH_TOKEN: ${{ github.token }}
|
|
106
|
+
run: |
|
|
107
|
+
gh release view catalog >/dev/null 2>&1 || \
|
|
108
|
+
gh release create catalog --title "Recipe catalog" --notes "Rebuilt weekly by .github/workflows/catalog.yml." --prerelease
|
|
109
|
+
gh release upload catalog "$WORK/out/catalog.sqlite" "$WORK/out/evaluation.json" --clobber
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ci-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
name: pytest (${{ matrix.os }}, Python ${{ matrix.python }})
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
timeout-minutes: 20
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
os: [ubuntu-latest, macos-latest]
|
|
24
|
+
python: ["3.11", "3.13"]
|
|
25
|
+
env:
|
|
26
|
+
UV_PYTHON: ${{ matrix.python }}
|
|
27
|
+
# Live tests use real accounts and quota. They never run in CI.
|
|
28
|
+
GPU_RICH_LIVE: "0"
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
|
|
32
|
+
- uses: astral-sh/setup-uv@v6
|
|
33
|
+
with:
|
|
34
|
+
enable-cache: true
|
|
35
|
+
|
|
36
|
+
- name: Install Python ${{ matrix.python }}
|
|
37
|
+
run: uv python install ${{ matrix.python }}
|
|
38
|
+
|
|
39
|
+
- name: Run tests (live tests are deselected)
|
|
40
|
+
run: uv run --group dev pytest -m "not live"
|
|
41
|
+
|
|
42
|
+
- name: Check the packaged skill and CLI
|
|
43
|
+
run: |
|
|
44
|
+
uv run gpu-rich --version
|
|
45
|
+
uv run gpu-rich --json skills path
|
|
46
|
+
uv build --wheel --out-dir dist
|
|
47
|
+
python3 -c "import zipfile,glob,sys; n=zipfile.ZipFile(glob.glob('dist/*.whl')[0]).namelist(); sys.exit(0 if 'gpu_rich/_skills/gpu-rich/SKILL.md' in n else 'skill missing from wheel')"
|
|
48
|
+
|
|
49
|
+
lint:
|
|
50
|
+
name: ruff (optional)
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
continue-on-error: true
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
- uses: astral-sh/setup-uv@v6
|
|
56
|
+
- run: uvx ruff check src tests
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
.venv/
|
|
4
|
+
.DS_Store
|
|
5
|
+
# spike scratch folders
|
|
6
|
+
spikes/**/_work/
|
|
7
|
+
spikes/**/_out/
|
|
8
|
+
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
dist/
|
|
12
|
+
catalog-build/_work/
|
|
13
|
+
gpu-rich-runs/
|
|
14
|
+
gpu-rich-recipes/
|
|
15
|
+
gpu-rich-reports/
|
|
16
|
+
|
|
17
|
+
# Phase 0 experiments stay local: they hold account names and run URLs.
|
|
18
|
+
spikes/
|
gpu_rich-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 The gpu-rich authors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
gpu_rich-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: gpu-rich
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Free GPUs, driven from your terminal by your AI agent.
|
|
5
|
+
Project-URL: Homepage, https://github.com/mohamed2394/gpu-rich
|
|
6
|
+
Project-URL: Repository, https://github.com/mohamed2394/gpu-rich
|
|
7
|
+
Project-URL: Issues, https://github.com/mohamed2394/gpu-rich/issues
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: kaggle>=2.2
|
|
12
|
+
Requires-Dist: pydantic>=2.6
|
|
13
|
+
Requires-Dist: rich>=13
|
|
14
|
+
Requires-Dist: six
|
|
15
|
+
Requires-Dist: typer>=0.12
|
|
16
|
+
Provides-Extra: all
|
|
17
|
+
Requires-Dist: huggingface-hub>=1.0; extra == 'all'
|
|
18
|
+
Requires-Dist: modal>=1.6; extra == 'all'
|
|
19
|
+
Provides-Extra: hf
|
|
20
|
+
Requires-Dist: huggingface-hub>=1.0; extra == 'hf'
|
|
21
|
+
Provides-Extra: modal
|
|
22
|
+
Requires-Dist: modal>=1.6; extra == 'modal'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# gpu-rich
|
|
26
|
+
|
|
27
|
+
Free GPUs, driven from your terminal by your AI agent.
|
|
28
|
+
|
|
29
|
+
`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.
|
|
30
|
+
|
|
31
|
+
It is made for students and people who start with machine learning and have no GPU budget.
|
|
32
|
+
|
|
33
|
+
## Status
|
|
34
|
+
|
|
35
|
+
Alpha. Not published on PyPI yet. Commands and JSON fields can still change.
|
|
36
|
+
|
|
37
|
+
| Backend | Cost | State |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `kaggle` | free, about 30 GPU hours each week | verified in spikes |
|
|
40
|
+
| `colab` | free when a GPU is available; uses compute units when your account has them | verified in spikes |
|
|
41
|
+
| `modal` | paid, 30 USD of monthly credits on the Starter plan | verified in spikes |
|
|
42
|
+
| `hf` (Hugging Face Jobs) | paid | built from documentation, not yet run |
|
|
43
|
+
| `brev` (NVIDIA Brev) | paid | built from documentation, not yet run |
|
|
44
|
+
| `ssh:<host>` | your own machine | works with any host you can `ssh` to |
|
|
45
|
+
| `local` | this machine | for smoke tests |
|
|
46
|
+
|
|
47
|
+
The Colab backend works on Linux and macOS only, because the official Colab CLI does not support Windows.
|
|
48
|
+
|
|
49
|
+
## Install
|
|
50
|
+
|
|
51
|
+
You need Python 3.11 or newer and [uv](https://docs.astral.sh/uv/).
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone <this repository> gpu-rich
|
|
55
|
+
cd gpu-rich
|
|
56
|
+
uv tool install --editable .
|
|
57
|
+
gpu-rich --version
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`uv tool install gpu-rich` will work after the first release.
|
|
61
|
+
|
|
62
|
+
Then sign in to the platforms you want to use. `gpu-rich doctor` tells you how, for each one.
|
|
63
|
+
|
|
64
|
+
## Quickstart for a person (60 seconds)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gpu-rich doctor # which backends are ready, and how to fix the others
|
|
68
|
+
gpu-rich plan train.py # which backend would run it, and the cost
|
|
69
|
+
gpu-rich run train.py --detach # start it; prints a run id
|
|
70
|
+
gpu-rich wait RUN_ID --timeout 300 # wait up to 5 minutes; run it again until the run ends
|
|
71
|
+
gpu-rich pull RUN_ID # results in ./gpu-rich-runs/RUN_ID/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Stop a run with `gpu-rich cancel RUN_ID`.
|
|
75
|
+
|
|
76
|
+
## Quickstart for an agent
|
|
77
|
+
|
|
78
|
+
Install the skill pack into your project, then start a new agent session:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
gpu-rich skills install
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
Then ask your agent, for example: "Fine-tune a small model on my data in data/train.csv. I have no GPU."
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
|
|
90
|
+
## Commands
|
|
91
|
+
|
|
92
|
+
Put `--json` before the command to get one JSON document on stdout (for agents and scripts).
|
|
93
|
+
|
|
94
|
+
| Command | What it does |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `gpu-rich doctor` | Checks sign-in and quota for every backend, and says how to fix each problem. |
|
|
97
|
+
| `gpu-rich backends` | Lists the machines each backend offers, with price and quota. |
|
|
98
|
+
| `gpu-rich plan FILE` | Dry run: which backend would run the job, why, and the cost. |
|
|
99
|
+
| `gpu-rich run FILE` | Runs a script or a notebook. Use `--detach` to return at once. |
|
|
100
|
+
| `gpu-rich status [RUN]` | One run, or the recent runs. |
|
|
101
|
+
| `gpu-rich logs [RUN]` | The job's log. `-f` follows it, `--tail N` keeps the last lines. |
|
|
102
|
+
| `gpu-rich wait [RUN]` | Waits at most `--timeout` seconds, then prints the run. |
|
|
103
|
+
| `gpu-rich pull [RUN]` | Downloads the outputs, `result.json` and the executed notebook. |
|
|
104
|
+
| `gpu-rich cancel [RUN]` | Stops a run and frees the remote machine. |
|
|
105
|
+
| `gpu-rich search QUERY` | Searches the recipe catalog. |
|
|
106
|
+
| `gpu-rich show ID` | Shows one catalog entry: link, licence, needs. |
|
|
107
|
+
| `gpu-rich fetch ID` | Downloads a catalog entry from its upstream link. |
|
|
108
|
+
| `gpu-rich report [RUN]` | Shares the test result of a catalog run, when you agree. |
|
|
109
|
+
| `gpu-rich catalog info` / `update` | Shows or updates the local catalog index. |
|
|
110
|
+
| `gpu-rich skills install` / `path` / `show` | Installs or shows the agent skill pack. |
|
|
111
|
+
|
|
112
|
+
Exit codes: 0 ok, 1 the run failed, 2 wrong usage, 3 sign-in problem, 4 no backend or quota, 5 platform error.
|
|
113
|
+
|
|
114
|
+
## The job header
|
|
115
|
+
|
|
116
|
+
A script says what it needs in a [PEP 723](https://peps.python.org/pep-0723/) header. The same file still runs with plain `uv run train.py`.
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
# /// script
|
|
120
|
+
# requires-python = ">=3.11"
|
|
121
|
+
# dependencies = ["transformers", "datasets", "peft"]
|
|
122
|
+
#
|
|
123
|
+
# [tool.gpu-rich]
|
|
124
|
+
# gpu = "T4"
|
|
125
|
+
# max_hours = 2
|
|
126
|
+
# outputs = ["outputs"]
|
|
127
|
+
# include = ["data/train.csv"]
|
|
128
|
+
# secrets = ["HF_TOKEN"]
|
|
129
|
+
# ///
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- `outputs`: what comes back. Write your results under `outputs/`.
|
|
133
|
+
- `include`: extra local files to send with the job.
|
|
134
|
+
- `secrets`: names of environment variables. The values come from your shell, never from the file.
|
|
135
|
+
- `max_hours`: the job stops at this time.
|
|
136
|
+
|
|
137
|
+
Notebooks keep the same keys in their metadata under `gpu-rich`. The full format is in [skills/gpu-rich/references/job-format.md](skills/gpu-rich/references/job-format.md).
|
|
138
|
+
|
|
139
|
+
## Rules the tool follows
|
|
140
|
+
|
|
141
|
+
- It uses the official CLI or API of each platform.
|
|
142
|
+
- It supports one account per platform.
|
|
143
|
+
- It ships no tunnel, no keep-alive trick and no model serving.
|
|
144
|
+
- It never starts a paid backend unless you allow it.
|
|
145
|
+
- It never writes a token into the code it sends.
|
|
146
|
+
|
|
147
|
+
## Money safety
|
|
148
|
+
|
|
149
|
+
- 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`.
|
|
150
|
+
- `plan` shows the estimated cost before you run anything.
|
|
151
|
+
- Every job has a time limit (`max_hours`).
|
|
152
|
+
- `cancel` stops the remote machine. Check `gpu-rich status` for runs you forgot.
|
|
153
|
+
- Colab uses your compute units when your account has a balance. Modal, Hugging Face Jobs and Brev cost money.
|
|
154
|
+
|
|
155
|
+
## For contributors
|
|
156
|
+
|
|
157
|
+
- Tests: `uv run --group dev pytest`. Live tests against real platforms run only with `GPU_RICH_LIVE=1`.
|
|
158
|
+
- Adding a platform: [docs/adding-a-backend.md](docs/adding-a-backend.md).
|
|
159
|
+
- Release check with a real agent: [docs/agent-e2e.md](docs/agent-e2e.md).
|
|
160
|
+
- The design: [docs/plan.html](docs/plan.html).
|
|
161
|
+
|
|
162
|
+
## A note on the language
|
|
163
|
+
|
|
164
|
+
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.
|
|
165
|
+
|
|
166
|
+
## Licence
|
|
167
|
+
|
|
168
|
+
Apache-2.0. See [LICENSE](LICENSE). The recipe catalog links to third-party notebooks; each one keeps its own licence.
|