aiinfra-tools 0.0.0-stage → 0.2.0

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 (236) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +8 -0
  4. package/README.md +94 -3
  5. package/bin/aiinfra.mjs +47 -0
  6. package/fleetops/Dockerfile +18 -0
  7. package/fleetops/README.md +216 -0
  8. package/fleetops/deploy/compose/grafana/provisioning/dashboards/fleetops.yaml +6 -0
  9. package/fleetops/deploy/compose/grafana/provisioning/datasources/fleetops.yaml +11 -0
  10. package/fleetops/deploy/docker-compose.yml +36 -0
  11. package/fleetops/deploy/fleetops.yaml +75 -0
  12. package/fleetops/deploy/grafana-dashboard.json +266 -0
  13. package/fleetops/docs/ADMISSION.md +147 -0
  14. package/fleetops/docs/AGENT.md +168 -0
  15. package/fleetops/docs/BENCHMARK.md +167 -0
  16. package/fleetops/docs/CALIBRATION.md +81 -0
  17. package/fleetops/docs/DATA-LAYER.md +97 -0
  18. package/fleetops/docs/FABRIC-STORAGE.md +91 -0
  19. package/fleetops/docs/GOODPUT.md +98 -0
  20. package/fleetops/docs/INCIDENTS.md +79 -0
  21. package/fleetops/docs/INSTALL.md +88 -0
  22. package/fleetops/docs/OPTIMIZE.md +98 -0
  23. package/fleetops/docs/POWER.md +127 -0
  24. package/fleetops/docs/RCA.md +63 -0
  25. package/fleetops/docs/SCALE.md +116 -0
  26. package/fleetops/docs/SDC.md +69 -0
  27. package/fleetops/docs/SERVICE.md +84 -0
  28. package/fleetops/docs/SERVING.md +174 -0
  29. package/fleetops/docs/SIGNALS.md +99 -0
  30. package/fleetops/docs/TRACING.md +70 -0
  31. package/fleetops/docs/TUNE.md +137 -0
  32. package/fleetops/docs/WORKLOADS.md +39 -0
  33. package/fleetops/examples/agent-policy.realtime.json +12 -0
  34. package/fleetops/examples/agent.example.json +11 -0
  35. package/fleetops/examples/dcgm.example.prom +3 -0
  36. package/fleetops/examples/gameday-plan.example.json +5 -0
  37. package/fleetops/examples/postmortems.example.jsonl +3 -0
  38. package/fleetops/examples/test-cluster.allow +4 -0
  39. package/fleetops/install/install-docker.sh +38 -0
  40. package/fleetops/install/install-k8s.sh +69 -0
  41. package/fleetops/install/install-serving.sh +75 -0
  42. package/fleetops/install/install.sh +138 -0
  43. package/fleetops/install/lib.sh +14 -0
  44. package/fleetops/install/uninstall.sh +17 -0
  45. package/fleetops/package.json +15 -0
  46. package/fleetops/src/adapters/fabric.mjs +117 -0
  47. package/fleetops/src/adapters/live.mjs +176 -0
  48. package/fleetops/src/adapters/logs.mjs +145 -0
  49. package/fleetops/src/adapters/philly.mjs +71 -0
  50. package/fleetops/src/adapters/public.mjs +61 -0
  51. package/fleetops/src/adapters/storage.mjs +79 -0
  52. package/fleetops/src/adapters/time.mjs +30 -0
  53. package/fleetops/src/adapters/topology.mjs +154 -0
  54. package/fleetops/src/admission.mjs +126 -0
  55. package/fleetops/src/agent.mjs +386 -0
  56. package/fleetops/src/api.mjs +94 -0
  57. package/fleetops/src/bench.mjs +411 -0
  58. package/fleetops/src/bundle.mjs +187 -0
  59. package/fleetops/src/calibrate.mjs +217 -0
  60. package/fleetops/src/detect.mjs +173 -0
  61. package/fleetops/src/duck-worker.mjs +68 -0
  62. package/fleetops/src/export.mjs +85 -0
  63. package/fleetops/src/goodput-report.mjs +91 -0
  64. package/fleetops/src/goodput.mjs +281 -0
  65. package/fleetops/src/incidents.mjs +189 -0
  66. package/fleetops/src/ingest.mjs +231 -0
  67. package/fleetops/src/inject.mjs +123 -0
  68. package/fleetops/src/lines.mjs +14 -0
  69. package/fleetops/src/live.mjs +221 -0
  70. package/fleetops/src/llmd.mjs +93 -0
  71. package/fleetops/src/memstore.mjs +49 -0
  72. package/fleetops/src/migrate.mjs +38 -0
  73. package/fleetops/src/optimize.mjs +266 -0
  74. package/fleetops/src/parquet-store.mjs +91 -0
  75. package/fleetops/src/power.mjs +207 -0
  76. package/fleetops/src/proto.mjs +133 -0
  77. package/fleetops/src/pull.mjs +83 -0
  78. package/fleetops/src/rca.mjs +703 -0
  79. package/fleetops/src/retention.mjs +95 -0
  80. package/fleetops/src/rollout.mjs +213 -0
  81. package/fleetops/src/schema.mjs +85 -0
  82. package/fleetops/src/sdc.mjs +114 -0
  83. package/fleetops/src/security.mjs +92 -0
  84. package/fleetops/src/serving.mjs +326 -0
  85. package/fleetops/src/store.mjs +132 -0
  86. package/fleetops/src/traces.mjs +114 -0
  87. package/fleetops/src/tune.mjs +405 -0
  88. package/fleetops/src/workloads.mjs +110 -0
  89. package/fleetops/tests/fixtures/real/README.md +19 -0
  90. package/fleetops/tests/fixtures/real/philly-job-log-2017-11-07-15.json.gz +0 -0
  91. package/fleetops/tests/fixtures/real/philly-machine-list.csv +553 -0
  92. package/fleetops/tools/admit-node.sh +139 -0
  93. package/fleetops/tools/bench-scale.mjs +85 -0
  94. package/fleetops/tools/collect.sh +150 -0
  95. package/fleetops/tools/fetch-public-data.sh +45 -0
  96. package/fleetops/tools/fleetops.mjs +1353 -0
  97. package/fleetops/tools/loop-demo.mjs +119 -0
  98. package/fleetops/tools/sdc-canary.py +82 -0
  99. package/fleetops/tools/workload-profile.mjs +52 -0
  100. package/fleetscope/README.md +281 -0
  101. package/fleetscope/build.mjs +37 -0
  102. package/fleetscope/dist/index.html +7130 -0
  103. package/fleetscope/docs/ASK.md +48 -0
  104. package/fleetscope/docs/CALIBRATION.md +39 -0
  105. package/fleetscope/docs/CI.md +33 -0
  106. package/fleetscope/docs/CLUSTER.md +63 -0
  107. package/fleetscope/docs/INFERENCE.md +31 -0
  108. package/fleetscope/docs/LIVE.md +34 -0
  109. package/fleetscope/docs/PHYSICS.md +34 -0
  110. package/fleetscope/docs/PLANNING.md +33 -0
  111. package/fleetscope/docs/SCENARIO.md +28 -0
  112. package/fleetscope/docs/SPEC.md +249 -0
  113. package/fleetscope/docs/STRESS.md +82 -0
  114. package/fleetscope/docs/TRACES.md +83 -0
  115. package/fleetscope/docs/TRAINING.md +42 -0
  116. package/fleetscope/package.json +14 -0
  117. package/fleetscope/scenarios/README.md +18 -0
  118. package/fleetscope/scenarios/hybrid-chat/cluster.json +142 -0
  119. package/fleetscope/scenarios/hybrid-chat/graph.json +167 -0
  120. package/fleetscope/scenarios/hybrid-chat/kueue.yaml +42 -0
  121. package/fleetscope/scenarios/hybrid-chat/thresholds.json +6 -0
  122. package/fleetscope/src/ask.js +138 -0
  123. package/fleetscope/src/calibrate.js +211 -0
  124. package/fleetscope/src/cluster-ui.js +395 -0
  125. package/fleetscope/src/cluster.js +534 -0
  126. package/fleetscope/src/engine.js +1439 -0
  127. package/fleetscope/src/forecast.js +149 -0
  128. package/fleetscope/src/index.src.html +2585 -0
  129. package/fleetscope/src/inference-ui.js +226 -0
  130. package/fleetscope/src/ingest.js +265 -0
  131. package/fleetscope/src/optimize.js +163 -0
  132. package/fleetscope/src/plan.js +177 -0
  133. package/fleetscope/src/scenario.js +95 -0
  134. package/fleetscope/src/templates.js +111 -0
  135. package/fleetscope/src/training-ui.js +411 -0
  136. package/fleetscope/src/training.js +231 -0
  137. package/fleetscope/tools/convert-trace.mjs +58 -0
  138. package/fleetscope/tools/fleetscope-plan.mjs +72 -0
  139. package/fleetscope/tools/fleetscope.mjs +150 -0
  140. package/fleetscope/tools/live-twin.mjs +88 -0
  141. package/gpu-health/README.md +204 -0
  142. package/gpu-health/deploy/rbac.yaml +57 -0
  143. package/gpu-health/docs/CONFIG.md +114 -0
  144. package/gpu-health/docs/FLAKINESS.md +60 -0
  145. package/gpu-health/docs/RISK-PREDICTION.md +120 -0
  146. package/gpu-health/docs/VENDORS.md +105 -0
  147. package/gpu-health/examples/config.example.json +19 -0
  148. package/gpu-health/package.json +17 -0
  149. package/gpu-health/src/actions.mjs +169 -0
  150. package/gpu-health/src/analyze.mjs +47 -0
  151. package/gpu-health/src/config.mjs +155 -0
  152. package/gpu-health/src/efficiency.mjs +135 -0
  153. package/gpu-health/src/executors.mjs +64 -0
  154. package/gpu-health/src/flakiness.mjs +342 -0
  155. package/gpu-health/src/fragmentation.mjs +49 -0
  156. package/gpu-health/src/health.mjs +274 -0
  157. package/gpu-health/src/ingest.mjs +104 -0
  158. package/gpu-health/src/report.mjs +103 -0
  159. package/gpu-health/src/risk.mjs +39 -0
  160. package/gpu-health/src/savings.mjs +84 -0
  161. package/gpu-health/src/server.mjs +106 -0
  162. package/gpu-health/src/synth.mjs +201 -0
  163. package/gpu-health/src/vendors.mjs +181 -0
  164. package/gpu-health/tools/gpu-health.mjs +237 -0
  165. package/gpu-health/tools/tpu-collect.py +93 -0
  166. package/gpu-ledger/README.md +114 -0
  167. package/gpu-ledger/docs/METHOD.md +146 -0
  168. package/gpu-ledger/examples/ledger.example.json +25 -0
  169. package/gpu-ledger/examples/people.example.csv +4 -0
  170. package/gpu-ledger/package.json +11 -0
  171. package/gpu-ledger/src/adapters.mjs +193 -0
  172. package/gpu-ledger/src/core.mjs +123 -0
  173. package/gpu-ledger/src/demo.mjs +55 -0
  174. package/gpu-ledger/src/export.mjs +97 -0
  175. package/gpu-ledger/src/html.mjs +59 -0
  176. package/gpu-ledger/src/insights.mjs +166 -0
  177. package/gpu-ledger/src/ledger.mjs +110 -0
  178. package/gpu-ledger/tools/ledger.mjs +118 -0
  179. package/hybrid-tracing/Dockerfile +9 -0
  180. package/hybrid-tracing/README.md +101 -0
  181. package/hybrid-tracing/clock/Dockerfile +8 -0
  182. package/hybrid-tracing/clock/check-clock.sh +61 -0
  183. package/hybrid-tracing/clock/neocloud-node.chrony.conf +24 -0
  184. package/hybrid-tracing/clock/onprem-node.chrony.conf +21 -0
  185. package/hybrid-tracing/clock/onprem-timeserver.chrony.conf +33 -0
  186. package/hybrid-tracing/clock/ptp4l.conf +13 -0
  187. package/hybrid-tracing/collector/agent.yaml +73 -0
  188. package/hybrid-tracing/collector/gateway-neocloud.yaml +67 -0
  189. package/hybrid-tracing/collector/gateway-onprem.yaml +63 -0
  190. package/hybrid-tracing/collector/tailsampler.yaml +69 -0
  191. package/hybrid-tracing/deploy/chrony-daemonset.yaml +59 -0
  192. package/hybrid-tracing/deploy/skew-corrector.yaml +57 -0
  193. package/hybrid-tracing/docs/CLOCKS.md +64 -0
  194. package/hybrid-tracing/docs/pipeline.svg +52 -0
  195. package/hybrid-tracing/package.json +16 -0
  196. package/hybrid-tracing/src/service.mjs +111 -0
  197. package/hybrid-tracing/src/skew.mjs +245 -0
  198. package/hybrid-tracing/src/synth.mjs +72 -0
  199. package/hybrid-tracing/tools/fix-skew.mjs +47 -0
  200. package/hybrid-tracing/tools/skew-corrector.mjs +39 -0
  201. package/inference-sizer/README.md +108 -0
  202. package/inference-sizer/build.mjs +28 -0
  203. package/inference-sizer/dist/index.html +1733 -0
  204. package/inference-sizer/docs/METHOD.md +60 -0
  205. package/inference-sizer/docs/SPEC-SHEETS.md +76 -0
  206. package/inference-sizer/package.json +15 -0
  207. package/inference-sizer/specs/example.json +43 -0
  208. package/inference-sizer/src/catalog.js +240 -0
  209. package/inference-sizer/src/fit-ui.js +113 -0
  210. package/inference-sizer/src/fit.js +118 -0
  211. package/inference-sizer/src/fleetscope.js +78 -0
  212. package/inference-sizer/src/index.src.html +247 -0
  213. package/inference-sizer/src/model.js +360 -0
  214. package/inference-sizer/src/ui.js +577 -0
  215. package/inference-sizer/tools/size.mjs +136 -0
  216. package/mcp/README.md +49 -0
  217. package/mcp/server.mjs +173 -0
  218. package/package.json +75 -6
  219. package/schemas/README.md +32 -0
  220. package/schemas/commands.mjs +30 -0
  221. package/schemas/fix-skew.demo.schema.json +171 -0
  222. package/schemas/fleetops.power.plan.schema.json +323 -0
  223. package/schemas/fleetops.power.report.schema.json +113 -0
  224. package/schemas/fleetops.rca.diagnose.schema.json +133 -0
  225. package/schemas/fleetops.serving.capacity.schema.json +226 -0
  226. package/schemas/fleetops.serving.fit.schema.json +321 -0
  227. package/schemas/fleetscope.ask.schema.json +244 -0
  228. package/schemas/fleetscope.run.schema.json +72 -0
  229. package/schemas/fleetscope.templates.schema.json +25 -0
  230. package/schemas/gpu-health.analyze.schema.json +422 -0
  231. package/schemas/gpu-health.flakiness.schema.json +397 -0
  232. package/schemas/ledger.insights.schema.json +89 -0
  233. package/schemas/ledger.report.schema.json +390 -0
  234. package/schemas/sizer.compare.schema.json +195 -0
  235. package/schemas/sizer.list.schema.json +175 -0
  236. package/schemas/sizer.plan.schema.json +176 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ All notable changes. Versions follow [Semantic Versioning](https://semver.org/); before 1.0, a minor version may
4
+ change the `--json` output, and when it does the change is listed here (see [schemas/](schemas/README.md)).
5
+
6
+ ## 0.2.0 (2026-11)
7
+
8
+ From four utilities to one loop: Observe → Diagnose → Simulate → Approve → Optimize → Verify. First release as an npm
9
+ package and under a license.
10
+
11
+ ### New
12
+
13
+ - **fleetops**, the shared data layer under the tools (#29–#42):
14
+ - one store for device telemetry, inventory, jobs, serving metrics and changes;
15
+ - adapters for exporters, Kubernetes, Slurm, change feeds and public traces;
16
+ - a Parquet/DuckDB backend measured at 90M samples;
17
+ - remote_write and OTLP ingest.
18
+ - **Root-cause analysis:** rules with evidence, CUSUM detection, a benchmark with fault injection, and logs, topology and versions as signals (#31, #34, #35).
19
+ - **Incidents as a workflow:** lifecycle, paging (dry run unless `--live`), timelines and drafted postmortems (#39).
20
+ - **Run as a service:** read API, scoped tokens and tenants, audit, redaction, on-prem installers (#40, #41).
21
+ - **Live agent** that mitigates within approval guardrails, with a dashboard (#42).
22
+ - **Training goodput** and silent-data-corruption detection (#44); **workload profiles** for agents, chat, RAG and others (#45).
23
+ - **Tuning from real traces:** recommendations with predicted impact, then measured before/after (#46).
24
+ - **Serving:** what fits on given GPUs, what a model carries, one-command vLLM deployment (#47), and disaggregated prefill/decode on llm-d (#52).
25
+ - **gpu-ledger**, GPU billing and waste for any cluster:
26
+ - GPU-hours and cost by org, team, person and use case, split into useful, idle and lost;
27
+ - ranked savings with owners;
28
+ - FOCUS 1.4 export (#48).
29
+ - **Node admission and staged rollouts** with canary-vs-control checks (#49), **power-aware capacity** with per-job GPU power caps (#50), and **fabric and storage stalls** traced to the port and storage target (#51).
30
+ - **Inference Sizer:** a "What fits on my GPUs" view (#53).
31
+ - **gpu-health:** early-warning signals, risk triage, multi-vendor support (AMD, SambaNova, Cloud TPU), and a flakiness dashboard (#23, #25–#28).
32
+ - **Distribution:**
33
+ - the `aiinfra-tools` npm package and `aiinfra` command (#56);
34
+ - an MCP server (`aiinfra mcp`) for any MCP client (#60);
35
+ - JSON Schemas for the `--json` output (#59);
36
+ - a GitHub Pages site with both browser tools (#57);
37
+ - `aiinfra demo`, the whole loop on a real cluster week (#61);
38
+ - a devcontainer.
39
+
40
+ ### Changed
41
+
42
+ - **Apache-2.0 license**, with NOTICE, SECURITY.md and CONTRIBUTING.md (#55).
43
+ - The skills' copies of the tools are regenerated on `main`; pull requests no longer commit them (#56).
44
+ - Rollout checks allow for clustered failures: on a real Philly week, false alarms fell from 17 in 100 to 1 (#49 follow-up).
45
+ - Power predictions flag caps under 60% of the limit, where measured slowdowns are more than twice the model's (#50 follow-up).
46
+
47
+ ### Fixed
48
+
49
+ - `fleetops` and `gpu-health` did nothing when run through npm's bin symlinks (#56).
50
+ - Fabric: CNP and ECN counters are read from RDMA `hw_counters` (they aren't `ethtool -S` names). Lustre files read from `/proc` get their target from the path. Lustre `punch` and `sync` no longer count as writes (#51 follow-up).
51
+ - The collector test no longer depends on the host's network cards (#54).
52
+
53
+ See [docs/RESULTS.md](docs/RESULTS.md) for what is checked against real data.
54
+
55
+ ## 0.1.0 (2026-11-20)
56
+
57
+ FleetScope, the Inference Sizer, hybrid-tracing and gpu-health, packaged as Agent Skills and a Claude Code plugin.
package/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.
package/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ AIInfraTools
2
+ Copyright 2026 the AIInfraTools authors
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Third-party data used by the tests, each under its own license, is listed with its source in
7
+ fleetops/tests/fixtures/real/README.md. Public traces and benchmark results that the tools download at run time
8
+ (Philly, Alibaba, MLPerf and others) are not part of this repository and keep their own licenses.
package/README.md CHANGED
@@ -1,3 +1,94 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # AIInfraTools
2
+
3
+ **Open tools for running GPU fleets.** Size LLM inference, simulate capacity on a hybrid fleet, find why jobs fail or
4
+ slow down, cap power, deploy on llm-d, and charge back every GPU-hour. Node.js and nothing else; dry run by default,
5
+ and a person approves every change. Each tool is also an Agent Skill.
6
+
7
+ **Try it in your browser:** [Inference Sizer](https://hardikashah-eng.github.io/AIInfraTools/sizer/) ·
8
+ [What fits on my GPUs](https://hardikashah-eng.github.io/AIInfraTools/sizer/#fit) ·
9
+ [FleetScope](https://hardikashah-eng.github.io/AIInfraTools/fleetscope/) ·
10
+ **Install:** `npx aiinfra-tools --help`
11
+
12
+ Each tool lives in its own folder with its own README. What has been checked against real data, and what it found:
13
+ [docs/RESULTS.md](docs/RESULTS.md).
14
+
15
+ | Tool | What it is |
16
+ | --- | --- |
17
+ | [fleetscope](fleetscope/) | Node editor for replaying LLM traffic on a modelled hybrid (on-prem + neocloud) GPU fleet |
18
+ | [inference-sizer](inference-sizer/) | How many GPUs, in what layout, serve a model at TTFT/TPOT targets; exports to FleetScope |
19
+ | [gpu-health](gpu-health/) | Health checks, utilization and savings for GPU fleets, with suggested fixes that run once approved |
20
+ | [hybrid-tracing](hybrid-tracing/) | One trace view across on-prem and neocloud: shared clock reference (PTP/chrony), collector tiers, and clock-skew correction for traces |
21
+ | [gpu-ledger](gpu-ledger/) | GPU billing and waste for any cluster: GPU-hours and cost by org, team, person and use case, split into useful, idle and lost; where to save, with an owner; serving cost per token; FOCUS export. Runs on its own against Kubernetes, DCGM, vLLM, Slurm, OpenCost or CSV |
22
+ | [fleetops](fleetops/) | The shared data layer under the tools: one store of device telemetry, inventory, jobs, serving metrics and changes, with adapters for exporters, Kubernetes, Slurm, change feeds and public traces. On top of it: root-cause analysis, incidents, and a live agent and dashboard that mitigate training and inference issues in real time within approval guardrails |
23
+
24
+ Where this is going, from four utilities to one Observe → Diagnose → Simulate → Approve → Optimize → Verify loop: [ROADMAP.md](ROADMAP.md).
25
+
26
+ ## Install
27
+
28
+ Node.js 20+ and nothing else:
29
+
30
+ ```bash
31
+ npx aiinfra-tools demo # the whole loop on a real week of a GPU cluster
32
+ npx aiinfra-tools --help # every tool, one entry point
33
+ npx aiinfra-tools sizer --model llama33-70b --gpu H100 # or: npm i -g aiinfra-tools, then `aiinfra sizer …`
34
+ ```
35
+
36
+ Every command takes `--json`; the output of the ones agents rely on is described by [JSON Schemas](schemas/README.md). Or open the repository in a Codespace ([.devcontainer](.devcontainer/devcontainer.json)): `aiinfra` is ready on the path. The package also installs each tool's own command (`fleetops`, `gpu-health`, `gpu-ledger`, `inference-sizer`,
37
+ `fleetscope`, `fix-skew`). Or clone the repository and run any tool from its folder.
38
+
39
+ ## The loop in one command
40
+
41
+ `aiinfra demo` runs Observe → Diagnose → Simulate → Approve → Optimize → Verify on one real week of the Microsoft
42
+ Philly GPU cluster (552 machines, 23,000 jobs), which ships with the repository. It finds the week's failure spikes
43
+ and pins most of them on one team's jobs, flags ten flaky nodes, plans a fix worth about $6,900 a week, and stops for
44
+ you to approve it. Then `aiinfra demo --continue DIR` rolls it out (dry run) and checks the flaky nodes on the second
45
+ half of the week, which they fail at 3.3× the expected rate. It prints every command, so you can repeat each step on
46
+ your own data.
47
+
48
+ ## Use with LLMs (skills)
49
+
50
+ Each tool is also packaged as an [Agent Skill](https://agentskills.io/specification) in [skills/](skills/). A skill tells a model when to use the tool, what to ask the user, which command to run and how to read the JSON it returns. A model can then answer questions like "how many H200s for Llama 70B at 25 ms TPOT?", "what if the cloud link drops to 25 Gbps?", "why do our cross-site traces look out of order?" "which GPUs should we pull before they fail?" or "why did half the training jobs fail last night?" by running the tools itself.
51
+
52
+ | Skill | Wraps |
53
+ | --- | --- |
54
+ | [inference-sizer](skills/inference-sizer/SKILL.md) | GPU count, layout and cost for TTFT/TPOT targets; compares GPUs |
55
+ | [fleetscope](skills/fleetscope/SKILL.md) | Stress suite, plain-English what-ifs and scenario diffs on a hybrid fleet |
56
+ | [hybrid-tracing](skills/hybrid-tracing/SKILL.md) | Clock-skew correction for traces, clock checks, and collector, chrony and PTP configs |
57
+ | [gpu-health](skills/gpu-health/SKILL.md) | Health, efficiency and savings analysis, with an approval queue the model may not approve on its own |
58
+ | [gpu-ledger](skills/gpu-ledger/SKILL.md) | Chargeback and showback, useful vs idle vs lost GPU-hours per team and person, ranked savings, cost per million tokens, FOCUS export |
59
+ | [fleetops](skills/fleetops/SKILL.md) | Root-cause analysis of job failures, latency and training slowdowns; a live agent that mitigates within approval guardrails, with a live dashboard; incidents, postmortems, accuracy backtests and game days; installers |
60
+
61
+ **MCP.** Every tool is also an MCP tool, for Claude Desktop, Cursor and any other MCP client:
62
+ `claude mcp add aiinfra -- npx -y aiinfra-tools mcp`. It only reads, simulates and plans. See [mcp/README.md](mcp/README.md).
63
+
64
+ **Claude Code.** The repo is a plugin marketplace:
65
+
66
+ ```
67
+ /plugin marketplace add hardikashah-eng/AIInfraTools
68
+ /plugin install aiinfra-tools@aiinfra-tools
69
+ ```
70
+
71
+ On Claude Code 2.1.275 or later, this one step does both: `/plugin install aiinfra-tools --marketplace hardikashah-eng/AIInfraTools`.
72
+
73
+ **Claude apps.** Run `node scripts/build-skills.mjs --zip dist/skills`, or download the `skills` artifact from the Skills CI run. Then upload a zip as a custom skill in Claude's settings. Each zip is self-contained.
74
+
75
+ **Other agents.** Any agent that reads Agent Skills can use the skill folders as they are: copy them into its skills directory. For an agent without skill support, every command the skills use takes `--json` and returns one JSON object, so you can wrap each one as a function tool.
76
+
77
+ All skills need Node.js 20+ and nothing else.
78
+
79
+ **Changing a tool.** The skill folders carry copies of the tools' code (`scripts/`), docs (`references/`) and examples (`assets/`), so each folder works on its own. After editing a tool, run `node scripts/build-skills.mjs`. CI fails while the copies are out of date. `node --test scripts/test-skills.mjs` runs each skill's documented commands from an isolated copy.
80
+
81
+ ## Workload Intelligence
82
+
83
+ FleetOps now includes a [workload profiler](fleetops/docs/WORKLOADS.md) with six synthetic application profiles (coding agents, chat, report generation, RAG search, deep research and autocomplete). It can inspect existing request logs or FleetOps request records, report workload fingerprints and export privacy-conscious session replay CSVs compatible with FleetScope.
84
+
85
+ ```bash
86
+ node fleetops/tools/workload-profile.mjs list
87
+ node fleetops/tools/workload-profile.mjs synth --type coding-agent --sessions 100 --out agent.csv
88
+ node fleetops/tools/workload-profile.mjs inspect --input gateway.jsonl --type coding-agent --out profile.json --csv replay.csv
89
+ ```
90
+
91
+ ## License
92
+
93
+ [Apache License 2.0](LICENSE). Test data from other projects keeps its own license; see [NOTICE](NOTICE).
94
+ To report a security problem, see [SECURITY.md](SECURITY.md); to contribute, [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ // aiinfra: one entry point for every AIInfraTools command. `aiinfra <tool> [args…]` runs that tool's CLI with the
3
+ // same Node.js, so `npx aiinfra-tools sizer --help` works with nothing installed but Node 20+.
4
+ import { spawnSync } from 'node:child_process';
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
10
+ export const TOOLS = {
11
+ sizer: { file: 'inference-sizer/tools/size.mjs', what: 'GPU count, layout and cost for a model at TTFT/TPOT targets' },
12
+ fleetscope: { file: 'fleetscope/tools/fleetscope.mjs', what: 'replay LLM traffic on a modelled hybrid GPU fleet; what-ifs and stress suites' },
13
+ 'fleetscope-plan': { file: 'fleetscope/tools/fleetscope-plan.mjs', what: 'capacity plans from FleetScope scenarios' },
14
+ 'live-twin': { file: 'fleetscope/tools/live-twin.mjs', what: 'forecast traffic from Prometheus and predict SLO breaches' },
15
+ 'convert-trace': { file: 'fleetscope/tools/convert-trace.mjs', what: 'convert public traces to FleetScope workloads' },
16
+ 'gpu-health': { file: 'gpu-health/tools/gpu-health.mjs', what: 'health checks, utilization and savings, fixes behind an approval queue' },
17
+ ledger: { file: 'gpu-ledger/tools/ledger.mjs', what: 'GPU-hours and cost by org, team and person: useful, idle, lost; FOCUS export' },
18
+ fleetops: { file: 'fleetops/tools/fleetops.mjs', what: 'shared data layer, root-cause analysis, incidents, tuning, power, admission, serving' },
19
+ 'workload-profile': { file: 'fleetops/tools/workload-profile.mjs', what: 'profile and synthesize application workloads (agents, chat, RAG…)' },
20
+ 'fix-skew': { file: 'hybrid-tracing/tools/fix-skew.mjs', what: 'estimate and remove clock skew from OTLP traces' },
21
+ 'skew-corrector': { file: 'hybrid-tracing/tools/skew-corrector.mjs', what: 'run the skew-corrector service' },
22
+ mcp: { file: 'mcp/server.mjs', what: 'run every tool as an MCP server over stdio (for Claude, Cursor and other MCP clients)' },
23
+ };
24
+ TOOLS.demo = { file: 'fleetops/tools/loop-demo.mjs', what: 'the whole loop on a real week of a GPU cluster: observe → diagnose → simulate → approve → optimize → verify' };
25
+ const ALIASES = { 'inference-sizer': 'sizer', 'gpu-ledger': 'ledger', tracing: 'fix-skew', 'hybrid-tracing': 'fix-skew' };
26
+ const version = () => JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8')).version;
27
+
28
+ function help() {
29
+ const w = Math.max(...Object.keys(TOOLS).map(k => k.length));
30
+ return `aiinfra ${version()}: AIInfraTools from one command\n\nUsage: aiinfra <tool> [args…] (every tool takes --help; most take --json)\n\n` +
31
+ Object.entries(TOOLS).map(([k, t]) => ` ${k.padEnd(w)} ${t.what}`).join('\n') +
32
+ `\n\nAlso: aiinfra version · aiinfra path <tool> (the script's path, for skills and scripts)\nDocs: https://github.com/hardikashah-eng/AIInfraTools\n`;
33
+ }
34
+
35
+ export function main(argv) {
36
+ const [cmd, ...rest] = argv;
37
+ if (!cmd || cmd === '--help' || cmd === '-h' || cmd === 'help') { process.stdout.write(help()); return 0; }
38
+ if (cmd === 'version' || cmd === '--version' || cmd === '-v') { process.stdout.write(version() + '\n'); return 0; }
39
+ if (cmd === 'path') { const t = TOOLS[ALIASES[rest[0]] || rest[0]]; if (!t) { process.stderr.write(`unknown tool: ${rest[0]}\n`); return 2; } process.stdout.write(path.join(ROOT, t.file) + '\n'); return 0; }
40
+ const t = TOOLS[ALIASES[cmd] || cmd];
41
+ if (!t) { process.stderr.write(`aiinfra: unknown tool "${cmd}"\n\n${help()}`); return 2; }
42
+ const r = spawnSync(process.execPath, [path.join(ROOT, t.file), ...rest], { stdio: 'inherit' });
43
+ if (r.error) { process.stderr.write(`aiinfra: ${r.error.message}\n`); return 1; }
44
+ return r.status === null ? 1 : r.status;
45
+ }
46
+
47
+ if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) process.exit(main(process.argv.slice(2)));
@@ -0,0 +1,18 @@
1
+ # fleetops service (ingest + read API) with the Parquet backend.
2
+ # docker build -f fleetops/Dockerfile -t <registry>/fleetops:0.1 . (from the repository root: fleetops reads
3
+ # gpu-health, fleetscope and inference-sizer sources)
4
+ FROM node:22-slim
5
+ WORKDIR /app
6
+ COPY gpu-health/src ./gpu-health/src
7
+ COPY fleetscope/src ./fleetscope/src
8
+ COPY inference-sizer/src ./inference-sizer/src
9
+ COPY fleetops/package.json ./fleetops/
10
+ COPY fleetops/src ./fleetops/src
11
+ COPY fleetops/tools ./fleetops/tools
12
+ WORKDIR /app/fleetops
13
+ RUN npm install --no-save --no-package-lock --no-audit --no-fund @duckdb/node-api@2.0.1-r.1 && npm cache clean --force
14
+ RUN mkdir -p /data && chown node:node /data # a named volume mounted here starts owned by the service user
15
+ USER node
16
+ EXPOSE 9400
17
+ ENTRYPOINT ["node", "tools/fleetops.mjs"]
18
+ CMD ["serve", "--agent", "--host", "0.0.0.0", "--port", "9400", "--store", "/data", "--backend", "parquet", "--tokens", "/etc/fleetops/tokens.jsonl"]