riggrade 0.1.0__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.
Files changed (70) hide show
  1. riggrade-0.1.0/LICENSE +202 -0
  2. riggrade-0.1.0/PKG-INFO +88 -0
  3. riggrade-0.1.0/README.md +71 -0
  4. riggrade-0.1.0/pricewatch/__init__.py +3 -0
  5. riggrade-0.1.0/pricewatch/aggregate.py +90 -0
  6. riggrade-0.1.0/pricewatch/reconstructed.py +210 -0
  7. riggrade-0.1.0/pricewatch/record.py +63 -0
  8. riggrade-0.1.0/pricewatch/sources.py +72 -0
  9. riggrade-0.1.0/pyproject.toml +33 -0
  10. riggrade-0.1.0/riggrade/__init__.py +3 -0
  11. riggrade-0.1.0/riggrade/acceptance.py +99 -0
  12. riggrade-0.1.0/riggrade/certificate_page.py +136 -0
  13. riggrade-0.1.0/riggrade/classes.py +62 -0
  14. riggrade-0.1.0/riggrade/cluster_rules.py +149 -0
  15. riggrade-0.1.0/riggrade/discovery.py +240 -0
  16. riggrade-0.1.0/riggrade/endpoint.py +776 -0
  17. riggrade-0.1.0/riggrade/engine.py +183 -0
  18. riggrade-0.1.0/riggrade/fixit.py +248 -0
  19. riggrade-0.1.0/riggrade/grading.py +347 -0
  20. riggrade-0.1.0/riggrade/heartbeat.py +41 -0
  21. riggrade-0.1.0/riggrade/index/reconstructed-getdeploying.csv +266 -0
  22. riggrade-0.1.0/riggrade/index/reconstructed-getdeploying.json +2289 -0
  23. riggrade-0.1.0/riggrade/index.py +98 -0
  24. riggrade-0.1.0/riggrade/label.py +76 -0
  25. riggrade-0.1.0/riggrade/mcp.py +279 -0
  26. riggrade-0.1.0/riggrade/payment.py +353 -0
  27. riggrade-0.1.0/riggrade/salelog.py +50 -0
  28. riggrade-0.1.0/riggrade/screenlist.py +101 -0
  29. riggrade-0.1.0/riggrade/serve.py +73 -0
  30. riggrade-0.1.0/riggrade/session.py +173 -0
  31. riggrade-0.1.0/riggrade/signing.py +98 -0
  32. riggrade-0.1.0/riggrade/spec/param-distribution.json +15 -0
  33. riggrade-0.1.0/riggrade/verify.py +96 -0
  34. riggrade-0.1.0/riggrade.egg-info/PKG-INFO +88 -0
  35. riggrade-0.1.0/riggrade.egg-info/SOURCES.txt +68 -0
  36. riggrade-0.1.0/riggrade.egg-info/dependency_links.txt +1 -0
  37. riggrade-0.1.0/riggrade.egg-info/entry_points.txt +4 -0
  38. riggrade-0.1.0/riggrade.egg-info/requires.txt +3 -0
  39. riggrade-0.1.0/riggrade.egg-info/top_level.txt +3 -0
  40. riggrade-0.1.0/runner/__init__.py +7 -0
  41. riggrade-0.1.0/runner/bundle.py +31 -0
  42. riggrade-0.1.0/runner/client.py +42 -0
  43. riggrade-0.1.0/runner/cluster.py +160 -0
  44. riggrade-0.1.0/runner/gpu.py +165 -0
  45. riggrade-0.1.0/runner/identity.py +55 -0
  46. riggrade-0.1.0/runner/local.py +36 -0
  47. riggrade-0.1.0/runner/main.py +154 -0
  48. riggrade-0.1.0/runner/preflight.py +683 -0
  49. riggrade-0.1.0/runner/rulers.py +186 -0
  50. riggrade-0.1.0/runner/smoke.py +161 -0
  51. riggrade-0.1.0/runner/stats.py +40 -0
  52. riggrade-0.1.0/setup.cfg +4 -0
  53. riggrade-0.1.0/tests/test_certificate_page.py +69 -0
  54. riggrade-0.1.0/tests/test_cluster.py +150 -0
  55. riggrade-0.1.0/tests/test_deploy.py +111 -0
  56. riggrade-0.1.0/tests/test_discovery.py +242 -0
  57. riggrade-0.1.0/tests/test_endpoint.py +541 -0
  58. riggrade-0.1.0/tests/test_grading.py +247 -0
  59. riggrade-0.1.0/tests/test_index.py +201 -0
  60. riggrade-0.1.0/tests/test_mcp.py +81 -0
  61. riggrade-0.1.0/tests/test_payment.py +297 -0
  62. riggrade-0.1.0/tests/test_preflight.py +366 -0
  63. riggrade-0.1.0/tests/test_pricewatch.py +117 -0
  64. riggrade-0.1.0/tests/test_products.py +270 -0
  65. riggrade-0.1.0/tests/test_runner.py +135 -0
  66. riggrade-0.1.0/tests/test_samples.py +63 -0
  67. riggrade-0.1.0/tests/test_signing.py +194 -0
  68. riggrade-0.1.0/tests/test_smoke.py +112 -0
  69. riggrade-0.1.0/tests/test_state.py +126 -0
  70. riggrade-0.1.0/tests/test_t4_fixes.py +209 -0
riggrade-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.4
2
+ Name: riggrade
3
+ Version: 0.1.0
4
+ Summary: Independent GPU rig grading: free preflight check, paid x402 grade, MCP server
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/nnyycc77-ship-it/riggrade
7
+ Project-URL: Service, https://riggrade-674098696181.us-central1.run.app/riggrade/v1
8
+ Keywords: gpu,benchmark,mcp,x402,agents
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Provides-Extra: cdp
15
+ Requires-Dist: cryptography>=42; extra == "cdp"
16
+ Dynamic: license-file
17
+
18
+ # riggrade
19
+
20
+ RigGrade is an independent, single-operator GPU rig grading service with open rules. Whoever holds access to a rig runs an open, pinned benchmark container on it. The grading endpoint grades the result against fixed, published bars for the rig's peer class (similar cards) and workload class (job type: inference or training), and returns a label and an evidence pack. Grades are labels of measured quality, not promises.
21
+
22
+ Status (1 Nov 2026): live at https://riggrade-674098696181.us-central1.run.app/riggrade/v1 with paid grading on. Agents can read `/.well-known/agent.json`, `/llms.txt` and `/riggrade/v1/openapi.json` on that host. Prices: 3 USDC per workload class for consumer cards, 5 USDC for data-centre cards, paid by x402 (USDC on Base). While a GPU class has no reference yet, each rig's first session there is free.
23
+
24
+ - [Grading spec, v0.1](docs/grading-spec.md)
25
+ - [Sample grading of three fictional rigs](docs/sample-grading.md)
26
+ - [Preflight check](docs/preflight.md): the kind of acceptance test big buyers run before paying for GPUs, for everyone else. Free one-minute check of a rented or hosted GPU box (throttling, foreign processes, driver vs CUDA, PCIe link, download and disk speed). `python3 -m runner.preflight`. Not a grade.
27
+ - [GPU index method, v0 draft](docs/index-method.md): daily listed price per GPU-hour by peer class, and price per unit of measured work once graded rigs exist. Method published before any value. Recorder: `python3 -m pricewatch.record --out PATH`.
28
+ - [Cluster acceptance test, spec v0 draft](docs/cluster-acceptance.md): checks a rented multi-node cluster against its provider's own claims (inventory, node health, stragglers, inter-node fabric, storage) and writes an evidence pack. The signed certificate is on sale at 25 USDC (see the offer below).
29
+ - MCP server for agents: `python3 -m riggrade.mcp` exposes `gpu_preflight` and `riggrade_service_info` over stdio.
30
+ - [Products](docs/products.md): the host fix-it report (2 USDC) and the cluster acceptance certificate (25 USDC), each on sale only when the service names it.
31
+ - [Payments](docs/payments.md): x402 through keyless public facilitators with an automatic backup; payer screened against the OFAC list before settle. Payments are live; the descriptor at `/riggrade/v1` lists what is on sale.
32
+ - [Reconstructed price history method, v0 draft](docs/index-reconstructed-method.md): a separate, labelled series from third-party records, never joined to the live index; no reconstructed grades.
33
+ - [Cluster acceptance certificate: the offer in one page](docs/offer-cluster-acceptance.md), with a [sample certificate](docs/sample-certificate.html); a certificate's lookup URL renders as a printable page in a browser (`?format=html`), the dispute copy.
34
+ - [Fleet rails readiness](docs/fleet-rails.md): what AgentCore, Cloudflare's gateway, MPP and the metered scheme need, and where RigGrade stands.
35
+ - [Compute supply ledger method, v0 draft](docs/compute-supply-method.md): six links from chips to rigs, two of them RigGrade's own measurements, with named reconciliation signals. Method published before any value; no value yet.
36
+ - **Free GPU price index** (live): `GET /riggrade/v1/index` and the MCP tool `gpu_price_index` give the latest listed on-demand price per peer class, weekly, reconstructed from GetDeploying's CC BY 4.0 dataset with attribution; the full series ships in the package as `riggrade/index/reconstructed-getdeploying.{json,csv}` and is re-imported every Tuesday. Information, not an offer.
37
+ - [Smoke test from Google Drive](notebooks/smoke_test_drive.ipynb): the same free GPU test, reading the code from Drive after checking it against a manifest (`scripts/stage_for_drive.py`) and writing both reports back to Drive.
38
+ - [Smoke test notebook](notebooks/smoke_test.ipynb): checks the GPU code paths on a free Colab or Kaggle GPU. Not a grade: small model, short run, local endpoint with the sale off. Command: `python3 -m runner.smoke --minutes 2`.
39
+
40
+ ## Use the MCP server
41
+
42
+ Standard library only, stdio, no secrets. Two tools: `gpu_preflight` (free, runs
43
+ on the box the server runs on) and `riggrade_service_info`.
44
+
45
+ Claude Desktop or Claude Code (`claude mcp add riggrade -- python3 -m riggrade.mcp`),
46
+ or in any MCP client config:
47
+
48
+ ```json
49
+ {"mcpServers": {"riggrade": {
50
+ "command": "python3", "args": ["-m", "riggrade.mcp"],
51
+ "env": {"RIGGRADE_ENDPOINT": "https://riggrade-674098696181.us-central1.run.app/riggrade/v1"}}}}
52
+ ```
53
+
54
+ With `pip install git+https://github.com/nnyycc77-ship-it/riggrade` the commands
55
+ `riggrade-mcp` and `riggrade-preflight` are on the path.
56
+
57
+ ## Running a graded session
58
+
59
+ The grading server is deployed from a separate private operations
60
+ repository; the code it runs is this one at `main`.
61
+
62
+
63
+ The benchmark container is public: `ghcr.io/nnyycc77-ship-it/riggrade-bench`,
64
+ pinned by digest in `container/bench-image.env`. The server accepts result
65
+ bundles only from a listed digest, so run it by digest, never by tag:
66
+
67
+ ```bash
68
+ . container/bench-image.env
69
+ # RIGGRADE_IMAGE_DIGESTS (plural) comes from bench-image.env; the container reads the singular name.
70
+ docker run --rm --gpus all -e RIGGRADE_IMAGE_DIGEST=$RIGGRADE_IMAGE_DIGESTS \
71
+ -e RIGGRADE_ENDPOINT=https://riggrade-674098696181.us-central1.run.app/riggrade/v1 \
72
+ $BENCH_IMAGE --help
73
+ ```
74
+
75
+ The container carries the runner and the spec only. The grading server,
76
+ payment code and screen list never ship in it.
77
+
78
+ ## Licence
79
+
80
+ Apache License 2.0; see `LICENSE`. The benchmark is open so that anyone can
81
+ inspect and rerun the test behind a grade.
82
+
83
+ ## Rules for this repo
84
+
85
+ - Never commit secrets, keys, wallet private material or credentials.
86
+ - Never commit customer data: evidence packs, host identities or wallet-linked results.
87
+ - One branch and one pull request per meaningful piece of work. No automated loops that open or merge pull requests.
88
+ - GitHub Actions run tests only.
@@ -0,0 +1,71 @@
1
+ # riggrade
2
+
3
+ RigGrade is an independent, single-operator GPU rig grading service with open rules. Whoever holds access to a rig runs an open, pinned benchmark container on it. The grading endpoint grades the result against fixed, published bars for the rig's peer class (similar cards) and workload class (job type: inference or training), and returns a label and an evidence pack. Grades are labels of measured quality, not promises.
4
+
5
+ Status (1 Nov 2026): live at https://riggrade-674098696181.us-central1.run.app/riggrade/v1 with paid grading on. Agents can read `/.well-known/agent.json`, `/llms.txt` and `/riggrade/v1/openapi.json` on that host. Prices: 3 USDC per workload class for consumer cards, 5 USDC for data-centre cards, paid by x402 (USDC on Base). While a GPU class has no reference yet, each rig's first session there is free.
6
+
7
+ - [Grading spec, v0.1](docs/grading-spec.md)
8
+ - [Sample grading of three fictional rigs](docs/sample-grading.md)
9
+ - [Preflight check](docs/preflight.md): the kind of acceptance test big buyers run before paying for GPUs, for everyone else. Free one-minute check of a rented or hosted GPU box (throttling, foreign processes, driver vs CUDA, PCIe link, download and disk speed). `python3 -m runner.preflight`. Not a grade.
10
+ - [GPU index method, v0 draft](docs/index-method.md): daily listed price per GPU-hour by peer class, and price per unit of measured work once graded rigs exist. Method published before any value. Recorder: `python3 -m pricewatch.record --out PATH`.
11
+ - [Cluster acceptance test, spec v0 draft](docs/cluster-acceptance.md): checks a rented multi-node cluster against its provider's own claims (inventory, node health, stragglers, inter-node fabric, storage) and writes an evidence pack. The signed certificate is on sale at 25 USDC (see the offer below).
12
+ - MCP server for agents: `python3 -m riggrade.mcp` exposes `gpu_preflight` and `riggrade_service_info` over stdio.
13
+ - [Products](docs/products.md): the host fix-it report (2 USDC) and the cluster acceptance certificate (25 USDC), each on sale only when the service names it.
14
+ - [Payments](docs/payments.md): x402 through keyless public facilitators with an automatic backup; payer screened against the OFAC list before settle. Payments are live; the descriptor at `/riggrade/v1` lists what is on sale.
15
+ - [Reconstructed price history method, v0 draft](docs/index-reconstructed-method.md): a separate, labelled series from third-party records, never joined to the live index; no reconstructed grades.
16
+ - [Cluster acceptance certificate: the offer in one page](docs/offer-cluster-acceptance.md), with a [sample certificate](docs/sample-certificate.html); a certificate's lookup URL renders as a printable page in a browser (`?format=html`), the dispute copy.
17
+ - [Fleet rails readiness](docs/fleet-rails.md): what AgentCore, Cloudflare's gateway, MPP and the metered scheme need, and where RigGrade stands.
18
+ - [Compute supply ledger method, v0 draft](docs/compute-supply-method.md): six links from chips to rigs, two of them RigGrade's own measurements, with named reconciliation signals. Method published before any value; no value yet.
19
+ - **Free GPU price index** (live): `GET /riggrade/v1/index` and the MCP tool `gpu_price_index` give the latest listed on-demand price per peer class, weekly, reconstructed from GetDeploying's CC BY 4.0 dataset with attribution; the full series ships in the package as `riggrade/index/reconstructed-getdeploying.{json,csv}` and is re-imported every Tuesday. Information, not an offer.
20
+ - [Smoke test from Google Drive](notebooks/smoke_test_drive.ipynb): the same free GPU test, reading the code from Drive after checking it against a manifest (`scripts/stage_for_drive.py`) and writing both reports back to Drive.
21
+ - [Smoke test notebook](notebooks/smoke_test.ipynb): checks the GPU code paths on a free Colab or Kaggle GPU. Not a grade: small model, short run, local endpoint with the sale off. Command: `python3 -m runner.smoke --minutes 2`.
22
+
23
+ ## Use the MCP server
24
+
25
+ Standard library only, stdio, no secrets. Two tools: `gpu_preflight` (free, runs
26
+ on the box the server runs on) and `riggrade_service_info`.
27
+
28
+ Claude Desktop or Claude Code (`claude mcp add riggrade -- python3 -m riggrade.mcp`),
29
+ or in any MCP client config:
30
+
31
+ ```json
32
+ {"mcpServers": {"riggrade": {
33
+ "command": "python3", "args": ["-m", "riggrade.mcp"],
34
+ "env": {"RIGGRADE_ENDPOINT": "https://riggrade-674098696181.us-central1.run.app/riggrade/v1"}}}}
35
+ ```
36
+
37
+ With `pip install git+https://github.com/nnyycc77-ship-it/riggrade` the commands
38
+ `riggrade-mcp` and `riggrade-preflight` are on the path.
39
+
40
+ ## Running a graded session
41
+
42
+ The grading server is deployed from a separate private operations
43
+ repository; the code it runs is this one at `main`.
44
+
45
+
46
+ The benchmark container is public: `ghcr.io/nnyycc77-ship-it/riggrade-bench`,
47
+ pinned by digest in `container/bench-image.env`. The server accepts result
48
+ bundles only from a listed digest, so run it by digest, never by tag:
49
+
50
+ ```bash
51
+ . container/bench-image.env
52
+ # RIGGRADE_IMAGE_DIGESTS (plural) comes from bench-image.env; the container reads the singular name.
53
+ docker run --rm --gpus all -e RIGGRADE_IMAGE_DIGEST=$RIGGRADE_IMAGE_DIGESTS \
54
+ -e RIGGRADE_ENDPOINT=https://riggrade-674098696181.us-central1.run.app/riggrade/v1 \
55
+ $BENCH_IMAGE --help
56
+ ```
57
+
58
+ The container carries the runner and the spec only. The grading server,
59
+ payment code and screen list never ship in it.
60
+
61
+ ## Licence
62
+
63
+ Apache License 2.0; see `LICENSE`. The benchmark is open so that anyone can
64
+ inspect and rerun the test behind a grade.
65
+
66
+ ## Rules for this repo
67
+
68
+ - Never commit secrets, keys, wallet private material or credentials.
69
+ - Never commit customer data: evidence packs, host identities or wallet-linked results.
70
+ - One branch and one pull request per meaningful piece of work. No automated loops that open or merge pull requests.
71
+ - GitHub Actions run tests only.
@@ -0,0 +1,3 @@
1
+ """Daily listed-price recorder for the RigGrade GPU index (docs/index-method.md)."""
2
+
3
+ METHOD_VERSION = "v0-draft"
@@ -0,0 +1,90 @@
1
+ """Pure aggregation for the listed-price series (method sections 3 and 5).
2
+
3
+ Input is a list of normalised offers:
4
+ {"gpu_name": str, "gpu_memory_gb": float, "num_gpus": int,
5
+ "total_price_per_hour": float, "verified": bool or None}
6
+ No identifiers enter this module, so none can reach the output.
7
+ """
8
+
9
+ from riggrade.classes import PEER_CLASSES, identify
10
+
11
+ MIN_OFFERS = 10
12
+
13
+
14
+ def weighted_percentile(pairs, q):
15
+ """pairs: (value, weight). Percentile q in [0, 1], weight-aware: the
16
+ smallest value whose cumulative weight reaches q of the total."""
17
+ pairs = sorted((v, w) for v, w in pairs if w > 0)
18
+ if not pairs:
19
+ return None
20
+ total = sum(w for _v, w in pairs)
21
+ acc = 0.0
22
+ for value, weight in pairs:
23
+ acc += weight
24
+ if acc >= q * total - 1e-12:
25
+ return value
26
+ return pairs[-1][0]
27
+
28
+
29
+ def _summary(pairs, verified_gpus=None, known_gpus=None):
30
+ gpus = sum(w for _v, w in pairs)
31
+ out = {"offers": len(pairs), "gpus": gpus}
32
+ if len(pairs) < MIN_OFFERS:
33
+ out["status"] = "insufficient"
34
+ return out
35
+ out["status"] = "ok"
36
+ out.update({"p25": round(weighted_percentile(pairs, 0.25), 4),
37
+ "median": round(weighted_percentile(pairs, 0.50), 4),
38
+ "p75": round(weighted_percentile(pairs, 0.75), 4)})
39
+ if known_gpus:
40
+ out["verified_share"] = round(verified_gpus / known_gpus, 3)
41
+ return out
42
+
43
+
44
+ def by_class(offers):
45
+ """One source's snapshot -> {class_id: summary}, plus unmatched count."""
46
+ pairs, verified, known, unmatched = {}, {}, {}, 0
47
+ for o in offers:
48
+ n = int(o.get("num_gpus") or 0)
49
+ price = o.get("total_price_per_hour")
50
+ if n <= 0 or price is None or price <= 0:
51
+ unmatched += 1
52
+ continue
53
+ cls = identify(o.get("gpu_name"), o.get("gpu_memory_gb"))
54
+ if cls is None:
55
+ unmatched += 1
56
+ continue
57
+ pairs.setdefault(cls, []).append((price / n, n))
58
+ if o.get("verified") is not None:
59
+ known[cls] = known.get(cls, 0) + n
60
+ verified[cls] = verified.get(cls, 0) + (n if o["verified"] else 0)
61
+ classes = {c: _summary(p, verified.get(c), known.get(c)) for c, p in pairs.items()}
62
+ return {"classes": classes, "unmatched_offers": unmatched}, pairs
63
+
64
+
65
+ def combined(per_source_pairs, per_source_summary):
66
+ """Method 3: median across sources that met the minimum sample, per class."""
67
+ pooled = {}
68
+ for source, pairs in per_source_pairs.items():
69
+ for cls, items in pairs.items():
70
+ if per_source_summary[source]["classes"][cls]["status"] == "ok":
71
+ pooled.setdefault(cls, []).extend(items)
72
+ out = {}
73
+ for cls in PEER_CLASSES:
74
+ items = pooled.get(cls, [])
75
+ out[cls] = ({"status": "ok", "gpus": sum(w for _v, w in items),
76
+ "median": round(weighted_percentile(items, 0.5), 4)}
77
+ if items else {"status": "missing"})
78
+ return out
79
+
80
+
81
+ def performance_adjusted(median_price_per_gpu_hour, throughputs_per_second, min_rigs=5):
82
+ """Method 5: price per million units of measured work (for inference,
83
+ tokens). `throughputs_per_second` is one first-session value per graded
84
+ rig. Returns None until `min_rigs` rigs exist."""
85
+ vals = sorted(throughputs_per_second)
86
+ if median_price_per_gpu_hour is None or len(vals) < min_rigs:
87
+ return None
88
+ mid = len(vals) // 2
89
+ med = vals[mid] if len(vals) % 2 else (vals[mid - 1] + vals[mid]) / 2
90
+ return round(median_price_per_gpu_hour / (med * 3600) * 1e6, 4)