green-ai-advisor 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 (350) hide show
  1. green_ai_advisor-0.1.0/.env.example +21 -0
  2. green_ai_advisor-0.1.0/CHANGELOG.md +14 -0
  3. green_ai_advisor-0.1.0/CONTRIBUTING.md +58 -0
  4. green_ai_advisor-0.1.0/LICENSE +21 -0
  5. green_ai_advisor-0.1.0/MANIFEST.in +17 -0
  6. green_ai_advisor-0.1.0/PKG-INFO +211 -0
  7. green_ai_advisor-0.1.0/README.md +141 -0
  8. green_ai_advisor-0.1.0/SECURITY.md +19 -0
  9. green_ai_advisor-0.1.0/config.example.toml +17 -0
  10. green_ai_advisor-0.1.0/docs/architecture/advisor-engine.md +53 -0
  11. green_ai_advisor-0.1.0/docs/architecture/catalog-library.md +108 -0
  12. green_ai_advisor-0.1.0/docs/architecture/cli-flow.md +69 -0
  13. green_ai_advisor-0.1.0/docs/architecture/data-flow.md +94 -0
  14. green_ai_advisor-0.1.0/docs/architecture/dataset-infrastructure.md +98 -0
  15. green_ai_advisor-0.1.0/docs/architecture/energy-measurement.md +56 -0
  16. green_ai_advisor-0.1.0/docs/architecture/experiment-execution.md +70 -0
  17. green_ai_advisor-0.1.0/docs/architecture/hardware-catalog.md +102 -0
  18. green_ai_advisor-0.1.0/docs/architecture/hardware-detection.md +144 -0
  19. green_ai_advisor-0.1.0/docs/architecture/hardware-overrides.md +58 -0
  20. green_ai_advisor-0.1.0/docs/architecture/prediction-system.md +65 -0
  21. green_ai_advisor-0.1.0/docs/architecture/system.md +123 -0
  22. green_ai_advisor-0.1.0/docs/audits/COMPLETE_PROJECT_AUDIT.md +519 -0
  23. green_ai_advisor-0.1.0/docs/cloud-platform-guide.md +137 -0
  24. green_ai_advisor-0.1.0/docs/cloud-storage-advisor.md +101 -0
  25. green_ai_advisor-0.1.0/docs/compatibility-matrix.md +27 -0
  26. green_ai_advisor-0.1.0/docs/demo-guide.md +133 -0
  27. green_ai_advisor-0.1.0/docs/impact-and-recommendations.md +286 -0
  28. green_ai_advisor-0.1.0/docs/local-application-guide.md +247 -0
  29. green_ai_advisor-0.1.0/docs/online-documentation.md +14 -0
  30. green_ai_advisor-0.1.0/docs/predictor.md +280 -0
  31. green_ai_advisor-0.1.0/docs/release-notes-v0.1.0.md +103 -0
  32. green_ai_advisor-0.1.0/docs/reports/phase10-local-application-report.md +22 -0
  33. green_ai_advisor-0.1.0/docs/reports/phase11-cloud-sync-report.md +39 -0
  34. green_ai_advisor-0.1.0/docs/reports/phase12-cloud-storage-report.md +22 -0
  35. green_ai_advisor-0.1.0/docs/reports/phase13-public-website-report.md +137 -0
  36. green_ai_advisor-0.1.0/docs/reports/phase14-final-release-report.md +150 -0
  37. green_ai_advisor-0.1.0/docs/reports/phase8-prediction-evaluation-report.md +66 -0
  38. green_ai_advisor-0.1.0/docs/reports/phase9-advisor-report.md +84 -0
  39. green_ai_advisor-0.1.0/docs/reports/v1.8-pilot-report.md +306 -0
  40. green_ai_advisor-0.1.0/docs/reports/v2.0-b-main-dataset-report.md +480 -0
  41. green_ai_advisor-0.1.0/docs/reports/v2.0-b1-integrity-audit.md +500 -0
  42. green_ai_advisor-0.1.0/docs/reports/v2.0-b2-energy-predictor-report.md +496 -0
  43. green_ai_advisor-0.1.0/docs/reports/v2.0-b3-generalization-report.md +348 -0
  44. green_ai_advisor-0.1.0/docs/reports/v2.0-b4-predictor-packaging-report.md +262 -0
  45. green_ai_advisor-0.1.0/docs/reports/v2.0-eda-report.md +590 -0
  46. green_ai_advisor-0.1.0/docs/reports/v3.0-impact-recommendation-report.md +265 -0
  47. green_ai_advisor-0.1.0/docs/reports/v4.0-application-delivery-report.md +221 -0
  48. green_ai_advisor-0.1.0/docs/reports/v5.0-web-dashboard-report.md +285 -0
  49. green_ai_advisor-0.1.0/docs/reports/v6.0-intelligent-advisor-report.md +211 -0
  50. green_ai_advisor-0.1.0/docs/reports/v6.0-regression-integrity-report.md +262 -0
  51. green_ai_advisor-0.1.0/docs/reports/v6.5-prototype-finalization-report.md +223 -0
  52. green_ai_advisor-0.1.0/docs/reports/v7.0-hardware-calibration-report.md +167 -0
  53. green_ai_advisor-0.1.0/docs/reports/v8.2-historical-data-audit-report.md +55 -0
  54. green_ai_advisor-0.1.0/docs/research/literature-review.md +58 -0
  55. green_ai_advisor-0.1.0/docs/research/measurement-methodology.md +68 -0
  56. green_ai_advisor-0.1.0/docs/research/references.md +50 -0
  57. green_ai_advisor-0.1.0/docs/specifications/benchmark-workloads.md +265 -0
  58. green_ai_advisor-0.1.0/docs/specifications/dataset-schema.md +337 -0
  59. green_ai_advisor-0.1.0/docs/specifications/energy-measurement.md +257 -0
  60. green_ai_advisor-0.1.0/docs/specifications/experiment-protocol.md +693 -0
  61. green_ai_advisor-0.1.0/docs/specifications/experiment-runner.md +240 -0
  62. green_ai_advisor-0.1.0/docs/specifications/green-ai-score.md +53 -0
  63. green_ai_advisor-0.1.0/docs/specifications/recommendation-engine.md +70 -0
  64. green_ai_advisor-0.1.0/docs/specifications/telemetry.md +280 -0
  65. green_ai_advisor-0.1.0/docs/user-guide.md +898 -0
  66. green_ai_advisor-0.1.0/pyproject.toml +120 -0
  67. green_ai_advisor-0.1.0/setup.cfg +4 -0
  68. green_ai_advisor-0.1.0/src/green_ai_advisor.egg-info/PKG-INFO +211 -0
  69. green_ai_advisor-0.1.0/src/green_ai_advisor.egg-info/SOURCES.txt +348 -0
  70. green_ai_advisor-0.1.0/src/green_ai_advisor.egg-info/dependency_links.txt +1 -0
  71. green_ai_advisor-0.1.0/src/green_ai_advisor.egg-info/entry_points.txt +2 -0
  72. green_ai_advisor-0.1.0/src/green_ai_advisor.egg-info/requires.txt +50 -0
  73. green_ai_advisor-0.1.0/src/green_ai_advisor.egg-info/top_level.txt +1 -0
  74. green_ai_advisor-0.1.0/src/greenai/__init__.py +8 -0
  75. green_ai_advisor-0.1.0/src/greenai/advisor/__init__.py +133 -0
  76. green_ai_advisor-0.1.0/src/greenai/advisor/candidates.py +443 -0
  77. green_ai_advisor-0.1.0/src/greenai/advisor/carbon_cost.py +210 -0
  78. green_ai_advisor-0.1.0/src/greenai/advisor/constraints.py +291 -0
  79. green_ai_advisor-0.1.0/src/greenai/advisor/contracts.py +544 -0
  80. green_ai_advisor-0.1.0/src/greenai/advisor/engine.py +406 -0
  81. green_ai_advisor-0.1.0/src/greenai/advisor/evidence.py +727 -0
  82. green_ai_advisor-0.1.0/src/greenai/advisor/explanations.py +185 -0
  83. green_ai_advisor-0.1.0/src/greenai/advisor/formatter.py +201 -0
  84. green_ai_advisor-0.1.0/src/greenai/advisor/models.py +210 -0
  85. green_ai_advisor-0.1.0/src/greenai/advisor/objectives.py +378 -0
  86. green_ai_advisor-0.1.0/src/greenai/advisor/reasoning.py +592 -0
  87. green_ai_advisor-0.1.0/src/greenai/advisor/schemas.py +141 -0
  88. green_ai_advisor-0.1.0/src/greenai/advisor/service.py +283 -0
  89. green_ai_advisor-0.1.0/src/greenai/advisor/simulator.py +104 -0
  90. green_ai_advisor-0.1.0/src/greenai/analyzer/__init__.py +6 -0
  91. green_ai_advisor-0.1.0/src/greenai/api/__init__.py +16 -0
  92. green_ai_advisor-0.1.0/src/greenai/api/advisor_v9_routes.py +333 -0
  93. green_ai_advisor-0.1.0/src/greenai/api/app.py +164 -0
  94. green_ai_advisor-0.1.0/src/greenai/api/cloud_client_routes.py +487 -0
  95. green_ai_advisor-0.1.0/src/greenai/api/dataset_routes.py +393 -0
  96. green_ai_advisor-0.1.0/src/greenai/api/energy_routes.py +248 -0
  97. green_ai_advisor-0.1.0/src/greenai/api/experiment_routes.py +421 -0
  98. green_ai_advisor-0.1.0/src/greenai/api/hardware_catalog_routes.py +548 -0
  99. green_ai_advisor-0.1.0/src/greenai/api/hardware_overrides_routes.py +259 -0
  100. green_ai_advisor-0.1.0/src/greenai/api/local_routes.py +457 -0
  101. green_ai_advisor-0.1.0/src/greenai/api/prediction_routes.py +216 -0
  102. green_ai_advisor-0.1.0/src/greenai/api/public_routes.py +618 -0
  103. green_ai_advisor-0.1.0/src/greenai/api/routes.py +457 -0
  104. green_ai_advisor-0.1.0/src/greenai/api/schemas.py +199 -0
  105. green_ai_advisor-0.1.0/src/greenai/api/security.py +199 -0
  106. green_ai_advisor-0.1.0/src/greenai/app/__init__.py +75 -0
  107. green_ai_advisor-0.1.0/src/greenai/app/cloud_client.py +679 -0
  108. green_ai_advisor-0.1.0/src/greenai/app/data_manager.py +509 -0
  109. green_ai_advisor-0.1.0/src/greenai/app/doctor.py +483 -0
  110. green_ai_advisor-0.1.0/src/greenai/app/launcher.py +469 -0
  111. green_ai_advisor-0.1.0/src/greenai/app/logging_utils.py +157 -0
  112. green_ai_advisor-0.1.0/src/greenai/app/paths.py +363 -0
  113. green_ai_advisor-0.1.0/src/greenai/app/server.py +53 -0
  114. green_ai_advisor-0.1.0/src/greenai/app/setup.py +281 -0
  115. green_ai_advisor-0.1.0/src/greenai/calibration/__init__.py +46 -0
  116. green_ai_advisor-0.1.0/src/greenai/calibration/identity.py +102 -0
  117. green_ai_advisor-0.1.0/src/greenai/calibration/models.py +259 -0
  118. green_ai_advisor-0.1.0/src/greenai/calibration/quality.py +209 -0
  119. green_ai_advisor-0.1.0/src/greenai/calibration/repository.py +251 -0
  120. green_ai_advisor-0.1.0/src/greenai/calibration/service.py +402 -0
  121. green_ai_advisor-0.1.0/src/greenai/calibration_dataset/builder.py +317 -0
  122. green_ai_advisor-0.1.0/src/greenai/calibration_dataset/evaluation.py +339 -0
  123. green_ai_advisor-0.1.0/src/greenai/calibration_dataset/models.py +231 -0
  124. green_ai_advisor-0.1.0/src/greenai/calibration_dataset/repository.py +124 -0
  125. green_ai_advisor-0.1.0/src/greenai/calibration_dataset/schema.py +84 -0
  126. green_ai_advisor-0.1.0/src/greenai/calibration_dataset/validation.py +89 -0
  127. green_ai_advisor-0.1.0/src/greenai/carbon/__init__.py +10 -0
  128. green_ai_advisor-0.1.0/src/greenai/catalog/__init__.py +94 -0
  129. green_ai_advisor-0.1.0/src/greenai/catalog/data/checkpoints.json +166 -0
  130. green_ai_advisor-0.1.0/src/greenai/catalog/data/datasets.json +532 -0
  131. green_ai_advisor-0.1.0/src/greenai/catalog/data/models.json +463 -0
  132. green_ai_advisor-0.1.0/src/greenai/catalog/data/profiles.json +57 -0
  133. green_ai_advisor-0.1.0/src/greenai/catalog/data/workloads.json +459 -0
  134. green_ai_advisor-0.1.0/src/greenai/catalog/downloads.py +205 -0
  135. green_ai_advisor-0.1.0/src/greenai/catalog/enums.py +79 -0
  136. green_ai_advisor-0.1.0/src/greenai/catalog/models.py +397 -0
  137. green_ai_advisor-0.1.0/src/greenai/catalog/profiles.py +198 -0
  138. green_ai_advisor-0.1.0/src/greenai/catalog/registry.py +334 -0
  139. green_ai_advisor-0.1.0/src/greenai/catalog/reproducibility.py +144 -0
  140. green_ai_advisor-0.1.0/src/greenai/catalog/validation.py +438 -0
  141. green_ai_advisor-0.1.0/src/greenai/cli/__init__.py +1 -0
  142. green_ai_advisor-0.1.0/src/greenai/cli/advise.py +174 -0
  143. green_ai_advisor-0.1.0/src/greenai/cli/advisor.py +322 -0
  144. green_ai_advisor-0.1.0/src/greenai/cli/advisor_v9.py +301 -0
  145. green_ai_advisor-0.1.0/src/greenai/cli/calibrate.py +192 -0
  146. green_ai_advisor-0.1.0/src/greenai/cli/catalog.py +379 -0
  147. green_ai_advisor-0.1.0/src/greenai/cli/cloud.py +213 -0
  148. green_ai_advisor-0.1.0/src/greenai/cli/dashboard.py +34 -0
  149. green_ai_advisor-0.1.0/src/greenai/cli/dataset.py +378 -0
  150. green_ai_advisor-0.1.0/src/greenai/cli/energy.py +250 -0
  151. green_ai_advisor-0.1.0/src/greenai/cli/experiment.py +709 -0
  152. green_ai_advisor-0.1.0/src/greenai/cli/hardware.py +187 -0
  153. green_ai_advisor-0.1.0/src/greenai/cli/hardware_catalog.py +337 -0
  154. green_ai_advisor-0.1.0/src/greenai/cli/hardware_overrides.py +199 -0
  155. green_ai_advisor-0.1.0/src/greenai/cli/impact.py +145 -0
  156. green_ai_advisor-0.1.0/src/greenai/cli/local_app.py +758 -0
  157. green_ai_advisor-0.1.0/src/greenai/cli/main.py +1486 -0
  158. green_ai_advisor-0.1.0/src/greenai/cli/monitor.py +215 -0
  159. green_ai_advisor-0.1.0/src/greenai/cli/predict.py +233 -0
  160. green_ai_advisor-0.1.0/src/greenai/cli/storage.py +109 -0
  161. green_ai_advisor-0.1.0/src/greenai/cli/workload.py +206 -0
  162. green_ai_advisor-0.1.0/src/greenai/cloud/__init__.py +57 -0
  163. green_ai_advisor-0.1.0/src/greenai/cloud/app.py +110 -0
  164. green_ai_advisor-0.1.0/src/greenai/cloud/auth.py +412 -0
  165. green_ai_advisor-0.1.0/src/greenai/cloud/config.py +117 -0
  166. green_ai_advisor-0.1.0/src/greenai/cloud/consent.py +194 -0
  167. green_ai_advisor-0.1.0/src/greenai/cloud/contributions.py +162 -0
  168. green_ai_advisor-0.1.0/src/greenai/cloud/devices.py +153 -0
  169. green_ai_advisor-0.1.0/src/greenai/cloud/migrations/001_initial_cloud_schema.sql +222 -0
  170. green_ai_advisor-0.1.0/src/greenai/cloud/migrations/002_rls_and_indexes.sql +55 -0
  171. green_ai_advisor-0.1.0/src/greenai/cloud/migrations/003_cloud_storage_advisor.sql +350 -0
  172. green_ai_advisor-0.1.0/src/greenai/cloud/models.py +351 -0
  173. green_ai_advisor-0.1.0/src/greenai/cloud/privacy.py +115 -0
  174. green_ai_advisor-0.1.0/src/greenai/cloud/repository.py +1649 -0
  175. green_ai_advisor-0.1.0/src/greenai/cloud/routes.py +583 -0
  176. green_ai_advisor-0.1.0/src/greenai/cloud/security.py +208 -0
  177. green_ai_advisor-0.1.0/src/greenai/cloud/storage/__init__.py +34 -0
  178. green_ai_advisor-0.1.0/src/greenai/cloud/storage/advisor.py +619 -0
  179. green_ai_advisor-0.1.0/src/greenai/cloud/storage/classifier.py +130 -0
  180. green_ai_advisor-0.1.0/src/greenai/cloud/storage/costing.py +184 -0
  181. green_ai_advisor-0.1.0/src/greenai/cloud/storage/credentials.py +232 -0
  182. green_ai_advisor-0.1.0/src/greenai/cloud/storage/duplicates.py +172 -0
  183. green_ai_advisor-0.1.0/src/greenai/cloud/storage/forecasting.py +170 -0
  184. green_ai_advisor-0.1.0/src/greenai/cloud/storage/models.py +497 -0
  185. green_ai_advisor-0.1.0/src/greenai/cloud/storage/providers.py +439 -0
  186. green_ai_advisor-0.1.0/src/greenai/cloud/storage/repository.py +1105 -0
  187. green_ai_advisor-0.1.0/src/greenai/cloud/storage/service.py +901 -0
  188. green_ai_advisor-0.1.0/src/greenai/cloud/storage_routes.py +462 -0
  189. green_ai_advisor-0.1.0/src/greenai/cloud/sync.py +650 -0
  190. green_ai_advisor-0.1.0/src/greenai/config/__init__.py +40 -0
  191. green_ai_advisor-0.1.0/src/greenai/config/settings.py +557 -0
  192. green_ai_advisor-0.1.0/src/greenai/cost/__init__.py +9 -0
  193. green_ai_advisor-0.1.0/src/greenai/data/__init__.py +69 -0
  194. green_ai_advisor-0.1.0/src/greenai/data/audit.py +604 -0
  195. green_ai_advisor-0.1.0/src/greenai/data/campaign.py +731 -0
  196. green_ai_advisor-0.1.0/src/greenai/data/database.py +113 -0
  197. green_ai_advisor-0.1.0/src/greenai/data/pilot.py +526 -0
  198. green_ai_advisor-0.1.0/src/greenai/data/repository.py +723 -0
  199. green_ai_advisor-0.1.0/src/greenai/data/schema.py +222 -0
  200. green_ai_advisor-0.1.0/src/greenai/dataset/__init__.py +153 -0
  201. green_ai_advisor-0.1.0/src/greenai/dataset/comparability.py +279 -0
  202. green_ai_advisor-0.1.0/src/greenai/dataset/enums.py +254 -0
  203. green_ai_advisor-0.1.0/src/greenai/dataset/exporter.py +276 -0
  204. green_ai_advisor-0.1.0/src/greenai/dataset/grouping.py +234 -0
  205. green_ai_advisor-0.1.0/src/greenai/dataset/historical_audit.py +278 -0
  206. green_ai_advisor-0.1.0/src/greenai/dataset/ingestion.py +795 -0
  207. green_ai_advisor-0.1.0/src/greenai/dataset/models.py +546 -0
  208. green_ai_advisor-0.1.0/src/greenai/dataset/partitioning.py +252 -0
  209. green_ai_advisor-0.1.0/src/greenai/dataset/privacy.py +136 -0
  210. green_ai_advisor-0.1.0/src/greenai/dataset/repository.py +541 -0
  211. green_ai_advisor-0.1.0/src/greenai/dataset/schema.py +270 -0
  212. green_ai_advisor-0.1.0/src/greenai/dataset/service.py +372 -0
  213. green_ai_advisor-0.1.0/src/greenai/dataset/validation.py +429 -0
  214. green_ai_advisor-0.1.0/src/greenai/dataset/versioning.py +171 -0
  215. green_ai_advisor-0.1.0/src/greenai/energy/__init__.py +87 -0
  216. green_ai_advisor-0.1.0/src/greenai/energy/baseline.py +262 -0
  217. green_ai_advisor-0.1.0/src/greenai/energy/capabilities.py +161 -0
  218. green_ai_advisor-0.1.0/src/greenai/energy/engine.py +288 -0
  219. green_ai_advisor-0.1.0/src/greenai/energy/integrator.py +224 -0
  220. green_ai_advisor-0.1.0/src/greenai/energy/measurement.py +329 -0
  221. green_ai_advisor-0.1.0/src/greenai/energy/models.py +494 -0
  222. green_ai_advisor-0.1.0/src/greenai/energy/providers/__init__.py +36 -0
  223. green_ai_advisor-0.1.0/src/greenai/energy/providers/amd.py +427 -0
  224. green_ai_advisor-0.1.0/src/greenai/energy/providers/base.py +103 -0
  225. green_ai_advisor-0.1.0/src/greenai/energy/providers/cpu.py +601 -0
  226. green_ai_advisor-0.1.0/src/greenai/energy/providers/intel.py +381 -0
  227. green_ai_advisor-0.1.0/src/greenai/energy/providers/nvidia.py +513 -0
  228. green_ai_advisor-0.1.0/src/greenai/energy/providers/system.py +675 -0
  229. green_ai_advisor-0.1.0/src/greenai/energy/quality.py +202 -0
  230. green_ai_advisor-0.1.0/src/greenai/energy/sources.py +547 -0
  231. green_ai_advisor-0.1.0/src/greenai/execution/__init__.py +93 -0
  232. green_ai_advisor-0.1.0/src/greenai/execution/audit.py +158 -0
  233. green_ai_advisor-0.1.0/src/greenai/execution/energy_integration.py +359 -0
  234. green_ai_advisor-0.1.0/src/greenai/execution/enums.py +147 -0
  235. green_ai_advisor-0.1.0/src/greenai/execution/models.py +368 -0
  236. green_ai_advisor-0.1.0/src/greenai/execution/orchestrator.py +868 -0
  237. green_ai_advisor-0.1.0/src/greenai/execution/repository.py +533 -0
  238. green_ai_advisor-0.1.0/src/greenai/execution/reproducibility.py +173 -0
  239. green_ai_advisor-0.1.0/src/greenai/execution/statistics.py +154 -0
  240. green_ai_advisor-0.1.0/src/greenai/execution/validation.py +363 -0
  241. green_ai_advisor-0.1.0/src/greenai/experiment/__init__.py +39 -0
  242. green_ai_advisor-0.1.0/src/greenai/experiment/enums.py +41 -0
  243. green_ai_advisor-0.1.0/src/greenai/experiment/id.py +45 -0
  244. green_ai_advisor-0.1.0/src/greenai/experiment/models.py +490 -0
  245. green_ai_advisor-0.1.0/src/greenai/experiment/validation.py +196 -0
  246. green_ai_advisor-0.1.0/src/greenai/frontend_dist/assets/main-BhpG5gsH.css +1 -0
  247. green_ai_advisor-0.1.0/src/greenai/frontend_dist/assets/main-DI1AYeLK.js +215 -0
  248. green_ai_advisor-0.1.0/src/greenai/frontend_dist/assets/triangle-alert-J8SFDdZC.js +180 -0
  249. green_ai_advisor-0.1.0/src/greenai/frontend_dist/assets/website-52W8SIo4.js +111 -0
  250. green_ai_advisor-0.1.0/src/greenai/frontend_dist/assets/website-CxNJWTFx.css +1 -0
  251. green_ai_advisor-0.1.0/src/greenai/frontend_dist/data/public-benchmarks.json +3389 -0
  252. green_ai_advisor-0.1.0/src/greenai/frontend_dist/data/public-catalog.json +2262 -0
  253. green_ai_advisor-0.1.0/src/greenai/frontend_dist/data/public-overview.json +217 -0
  254. green_ai_advisor-0.1.0/src/greenai/frontend_dist/index.html +18 -0
  255. green_ai_advisor-0.1.0/src/greenai/frontend_dist/robots.txt +9 -0
  256. green_ai_advisor-0.1.0/src/greenai/frontend_dist/sitemap.xml +20 -0
  257. green_ai_advisor-0.1.0/src/greenai/frontend_dist/website/index.html +47 -0
  258. green_ai_advisor-0.1.0/src/greenai/hardware/__init__.py +69 -0
  259. green_ai_advisor-0.1.0/src/greenai/hardware/cpu.py +502 -0
  260. green_ai_advisor-0.1.0/src/greenai/hardware/gpu.py +178 -0
  261. green_ai_advisor-0.1.0/src/greenai/hardware/gpu_providers.py +743 -0
  262. green_ai_advisor-0.1.0/src/greenai/hardware/identity.py +273 -0
  263. green_ai_advisor-0.1.0/src/greenai/hardware/memory.py +184 -0
  264. green_ai_advisor-0.1.0/src/greenai/hardware/models.py +292 -0
  265. green_ai_advisor-0.1.0/src/greenai/hardware/platform_info.py +292 -0
  266. green_ai_advisor-0.1.0/src/greenai/hardware/service.py +178 -0
  267. green_ai_advisor-0.1.0/src/greenai/hardware/software.py +131 -0
  268. green_ai_advisor-0.1.0/src/greenai/hardware/storage.py +305 -0
  269. green_ai_advisor-0.1.0/src/greenai/hardware/system.py +168 -0
  270. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/__init__.py +85 -0
  271. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/cooling.json +89 -0
  272. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/cpus.json +511 -0
  273. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/desktops.json +180 -0
  274. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/gpus.json +583 -0
  275. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/laptops.json +709 -0
  276. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/motherboards.json +165 -0
  277. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/psus.json +86 -0
  278. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/ram.json +117 -0
  279. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/data/storage.json +117 -0
  280. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/enums.py +118 -0
  281. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/matching.py +724 -0
  282. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/models.py +812 -0
  283. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/provenance.py +147 -0
  284. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/registry.py +786 -0
  285. green_ai_advisor-0.1.0/src/greenai/hardware_catalog/validation.py +174 -0
  286. green_ai_advisor-0.1.0/src/greenai/hardware_overrides/__init__.py +51 -0
  287. green_ai_advisor-0.1.0/src/greenai/hardware_overrides/enums.py +301 -0
  288. green_ai_advisor-0.1.0/src/greenai/hardware_overrides/models.py +189 -0
  289. green_ai_advisor-0.1.0/src/greenai/hardware_overrides/repository.py +255 -0
  290. green_ai_advisor-0.1.0/src/greenai/hardware_overrides/service.py +924 -0
  291. green_ai_advisor-0.1.0/src/greenai/hardware_overrides/validation.py +239 -0
  292. green_ai_advisor-0.1.0/src/greenai/impact/__init__.py +37 -0
  293. green_ai_advisor-0.1.0/src/greenai/impact/calculator.py +155 -0
  294. green_ai_advisor-0.1.0/src/greenai/impact/carbon.py +70 -0
  295. green_ai_advisor-0.1.0/src/greenai/impact/cost.py +48 -0
  296. green_ai_advisor-0.1.0/src/greenai/impact/metrics.py +70 -0
  297. green_ai_advisor-0.1.0/src/greenai/impact/models.py +63 -0
  298. green_ai_advisor-0.1.0/src/greenai/impact/validation.py +93 -0
  299. green_ai_advisor-0.1.0/src/greenai/monitoring/__init__.py +41 -0
  300. green_ai_advisor-0.1.0/src/greenai/monitoring/aggregator.py +187 -0
  301. green_ai_advisor-0.1.0/src/greenai/monitoring/cpu.py +62 -0
  302. green_ai_advisor-0.1.0/src/greenai/monitoring/gpu.py +214 -0
  303. green_ai_advisor-0.1.0/src/greenai/monitoring/memory.py +38 -0
  304. green_ai_advisor-0.1.0/src/greenai/monitoring/models.py +256 -0
  305. green_ai_advisor-0.1.0/src/greenai/monitoring/service.py +195 -0
  306. green_ai_advisor-0.1.0/src/greenai/package_data/models/v2_0_b2/energy_predictor_random_forest.joblib +0 -0
  307. green_ai_advisor-0.1.0/src/greenai/package_data/models/v2_0_b2/metrics.json +478 -0
  308. green_ai_advisor-0.1.0/src/greenai/package_data/models/v2_0_b2/model_metadata.json +28 -0
  309. green_ai_advisor-0.1.0/src/greenai/prediction/__init__.py +107 -0
  310. green_ai_advisor-0.1.0/src/greenai/prediction/applicability.py +529 -0
  311. green_ai_advisor-0.1.0/src/greenai/prediction/data_loader.py +212 -0
  312. green_ai_advisor-0.1.0/src/greenai/prediction/enums.py +67 -0
  313. green_ai_advisor-0.1.0/src/greenai/prediction/evaluation.py +418 -0
  314. green_ai_advisor-0.1.0/src/greenai/prediction/features.py +546 -0
  315. green_ai_advisor-0.1.0/src/greenai/prediction/models.py +120 -0
  316. green_ai_advisor-0.1.0/src/greenai/prediction/registry.py +229 -0
  317. green_ai_advisor-0.1.0/src/greenai/prediction/service.py +633 -0
  318. green_ai_advisor-0.1.0/src/greenai/predictor/__init__.py +75 -0
  319. green_ai_advisor-0.1.0/src/greenai/predictor/artifacts.py +179 -0
  320. green_ai_advisor-0.1.0/src/greenai/predictor/dataset.py +145 -0
  321. green_ai_advisor-0.1.0/src/greenai/predictor/evaluation.py +305 -0
  322. green_ai_advisor-0.1.0/src/greenai/predictor/features.py +380 -0
  323. green_ai_advisor-0.1.0/src/greenai/predictor/firewall.py +166 -0
  324. green_ai_advisor-0.1.0/src/greenai/predictor/manifest.py +119 -0
  325. green_ai_advisor-0.1.0/src/greenai/predictor/models.py +200 -0
  326. green_ai_advisor-0.1.0/src/greenai/predictor/predictor.py +239 -0
  327. green_ai_advisor-0.1.0/src/greenai/predictor/schemas.py +209 -0
  328. green_ai_advisor-0.1.0/src/greenai/predictor/validation.py +135 -0
  329. green_ai_advisor-0.1.0/src/greenai/recommendation/__init__.py +36 -0
  330. green_ai_advisor-0.1.0/src/greenai/recommendation/candidates.py +147 -0
  331. green_ai_advisor-0.1.0/src/greenai/recommendation/constraints.py +121 -0
  332. green_ai_advisor-0.1.0/src/greenai/recommendation/engine.py +269 -0
  333. green_ai_advisor-0.1.0/src/greenai/recommendation/extrapolation.py +85 -0
  334. green_ai_advisor-0.1.0/src/greenai/recommendation/pareto.py +97 -0
  335. green_ai_advisor-0.1.0/src/greenai/recommendation/policies.py +116 -0
  336. green_ai_advisor-0.1.0/src/greenai/recommendation/schemas.py +86 -0
  337. green_ai_advisor-0.1.0/src/greenai/reporting/__init__.py +6 -0
  338. green_ai_advisor-0.1.0/src/greenai/runner/__init__.py +21 -0
  339. green_ai_advisor-0.1.0/src/greenai/runner/config.py +113 -0
  340. green_ai_advisor-0.1.0/src/greenai/runner/lifecycle.py +154 -0
  341. green_ai_advisor-0.1.0/src/greenai/runner/result.py +108 -0
  342. green_ai_advisor-0.1.0/src/greenai/runner/runner.py +297 -0
  343. green_ai_advisor-0.1.0/src/greenai/scoring/__init__.py +6 -0
  344. green_ai_advisor-0.1.0/src/greenai/workloads/__init__.py +48 -0
  345. green_ai_advisor-0.1.0/src/greenai/workloads/base.py +232 -0
  346. green_ai_advisor-0.1.0/src/greenai/workloads/classical.py +273 -0
  347. green_ai_advisor-0.1.0/src/greenai/workloads/datasets.py +273 -0
  348. green_ai_advisor-0.1.0/src/greenai/workloads/deep_learning.py +553 -0
  349. green_ai_advisor-0.1.0/src/greenai/workloads/models.py +142 -0
  350. green_ai_advisor-0.1.0/src/greenai/workloads/registry.py +90 -0
@@ -0,0 +1,21 @@
1
+ # ==============================================================================
2
+ # Green AI Advisor - Environment Configuration Example
3
+ # ==============================================================================
4
+ # Copy this file to .env and adjust the values according to your environment.
5
+
6
+ # Regional Grid Carbon Intensity (g CO2e per kWh)
7
+ # Default is global average (~475.0) or regional average (e.g. US average ~385.0)
8
+ GREENAI_CARBON_INTENSITY=385.0
9
+
10
+ # Electricity cost rate per kilowatt-hour in USD
11
+ GREENAI_ELECTRICITY_COST_PER_KWH=0.15
12
+
13
+ # Datacenter Power Usage Effectiveness (PUE) factor
14
+ # Use 1.0 for local bare-metal / workstation development; ~1.10 - 1.25 for cloud
15
+ GREENAI_DEFAULT_PUE=1.0
16
+
17
+ # Logging Level: DEBUG, INFO, WARNING, ERROR, CRITICAL
18
+ GREENAI_LOG_LEVEL=INFO
19
+
20
+ # Storage path for experiment telemetry data and local SQLite database
21
+ GREENAI_DATA_DIR=./data/experiments
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ All notable releases of **Green AI Advisor** are documented here. This project follows semantic versioning (`MAJOR.MINOR.PATCH`).
4
+
5
+ ## [0.1.0] — Initial Public Beta Release (2026-11-30)
6
+
7
+ **Release Classification**: **Beta (`Development Status :: 4 - Beta`)** — Core local measurement, empirical dataset, single-GPU prediction, deterministic Pareto advisor, unified local app/CLI, and public website/documentation are complete and verified. Pre-1.0 classification reflects that physical empirical calibration covers one GPU (`NVIDIA GeForce RTX 5060 Laptop GPU`), cross-device generalization is unvalidated, and optional cloud/storage adapters remain mock-tested.
8
+
9
+ ### Highlights
10
+ - **Python Packaging & Clean Installation**: Separated lightweight core runtime dependencies (`numpy`, `pandas`, `scikit-learn`, `psutil`, `joblib`, `fastapi`, `uvicorn`, `pydantic`) from optional extras (`[gpu]`, `[viz]`, `[dl]`, `[cloud]`, `[storage]`, `[dev]`, `[all]`). Bundled built dashboard/website assets, cloud SQL migrations, hardware/workload catalogs, and the frozen baseline predictor inside the wheel for CWD-independent execution outside a repository checkout.
11
+ - **Public Website & Online Documentation (Phase 13)**: Added Home, Features, Architecture, Hardware Compatibility & 64-entry Catalog Browser, Trusted Benchmark Explorer (`108` `VALID` + `REAL` GPU-scope runs), Scientific Methodology, searchable 8-section Online Docs, Source Installation, and Open-Source/Privacy pages.
12
+ - **Optional Cloud Sync & Storage Advisor (Phases 11–12)**: Opt-in account/device sync, granular default-`False` consents, and read-only AWS S3 / GCP GCS / Azure Blob storage advisor contracts (mock-tested only).
13
+ - **Local App, Advisor, Prediction & Measurement (Phases 1–10)**: Single-command `greenai app`, `greenai setup`, `greenai doctor`, SQLite backup/restore, scoped energy providers (NVML, AMD/Intel GPU, Linux RAPL), canonical empirical dataset pipeline, frozen `v2.0-B.4` Random Forest predictor (`SHA-256: e039513f097fbd7e4e7447413839d3f6dab11b8fe543016cdf51ec680347a433`), and Phase 9 deterministic Pareto advisor.
14
+ - **CI/CD & Release Automation (Phase 14)**: Added `.github/workflows/ci.yml` and protected `.github/workflows/release.yml` plus deterministic `scripts/build_release.py` generating `sdist`, `wheel`, and `SHA256SUMS.txt`.
@@ -0,0 +1,58 @@
1
+ # Contributing to Green AI Advisor
2
+
3
+ Thank you for your interest in contributing to **Green AI Advisor** (MIT License, [`Divyansh-2309git/Green-AI`](https://github.com/Divyansh-2309git/Green-AI)).
4
+
5
+ ## 1. Local Development Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/Divyansh-2309git/Green-AI.git
9
+ cd Green-AI
10
+ python3 -m venv .venv
11
+ source .venv/bin/activate
12
+ pip install -e ".[dev]"
13
+
14
+ # Optional extras as needed:
15
+ # pip install -e ".[dl]" # PyTorch / torchvision
16
+ # pip install -e ".[cloud]" # Cloud platform dependencies
17
+ # pip install -e ".[storage]" # Cloud storage SDKs
18
+
19
+ cd frontend && npm install && npm run build && cd ..
20
+ ```
21
+
22
+ ## 2. Running Tests & Builds
23
+
24
+ ```bash
25
+ # Backend unit & integration test suite
26
+ .venv/bin/pytest tests/unit -q
27
+
28
+ # Frontend TypeScript check + local dashboard & public website build
29
+ cd frontend && npx tsc --noEmit && npm run build && npm run build:website && cd ..
30
+
31
+ # Refresh static public website JSON exports after catalog/dataset updates
32
+ .venv/bin/python scripts/export_public_website_data.py
33
+ ```
34
+
35
+ ## 3. Scientific & Engineering Invariants
36
+
37
+ All pull requests must uphold these core project guarantees:
38
+
39
+ 1. **Scope Isolation**: Never equate GPU board energy to whole-system energy, and never sum CPU + GPU counters as AC wall draw.
40
+ 2. **Pre-Run Feature Firewall**: Never allow post-run telemetry (runtime, peak power, GPU utilization) into pre-run predictor features.
41
+ 3. **Catalog & Benchmark Integrity**: Never upgrade `UNVERIFIED`, `THIRD_PARTY_SOURCED`, `CONFLICTED`, or `OBSOLETE` hardware catalog entries without authoritative provenance; never mix synthetic, smoke-test, `QUARANTINED`, `REJECTED`, or `AUDIT_REQUIRED` observations into trusted public exports.
42
+ 4. **Local-First Independence**: Core detection, measurement, prediction, and optimization must remain functional without internet access or cloud accounts.
43
+ 5. **Production Predictor Safety**: Do not modify `models/v2_0_b2/energy_predictor_random_forest.joblib` outside an evaluated promotion workflow.
44
+
45
+ ## 4. Submitting Empirical Benchmark Data
46
+
47
+ To expand multi-device coverage beyond the initial RTX 5060 Laptop GPU baseline:
48
+
49
+ - Record physical measurements with explicit measurement scope (`GPU`, `CPU`, `SYSTEM`, `EXTERNAL_METER`) and repetition counts (`>= 3`).
50
+ - Validate and sanitize exports using `greenai dataset export --scope <SCOPE> --confirm` so hostnames, local user paths, MAC addresses, and raw serial identifiers are stripped.
51
+
52
+ ## 5. Issue Reporting
53
+
54
+ When filing bug reports on [GitHub Issues](https://github.com/Divyansh-2309git/Green-AI/issues), please include:
55
+
56
+ - Exact CLI command or API/UI workflow that triggered the issue.
57
+ - Output of `greenai doctor --json` (automatically redacted).
58
+ - Python version, OS, and hardware details (`greenai hardware --json`).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Green AI Advisor Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,17 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CONTRIBUTING.md
4
+ include SECURITY.md
5
+ include CHANGELOG.md
6
+ include pyproject.toml
7
+ include config.example.toml
8
+ include .env.example
9
+
10
+ recursive-include src/greenai/catalog/data *.json
11
+ recursive-include src/greenai/hardware_catalog/data *.json
12
+ recursive-include src/greenai/cloud/migrations *.sql
13
+ recursive-include src/greenai/frontend_dist *
14
+ recursive-include src/greenai/package_data *
15
+ recursive-include docs *.md
16
+
17
+ global-exclude __pycache__ *.py[cod] *.sqlite *.db *.db-wal *.db-shm
@@ -0,0 +1,211 @@
1
+ Metadata-Version: 2.4
2
+ Name: green-ai-advisor
3
+ Version: 0.1.0
4
+ Summary: An open-source, local-first AI energy intelligence platform for measurement, prediction, and Pareto optimization.
5
+ Author: Green AI Advisor Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Divyansh-2309git/Green-AI
8
+ Project-URL: Repository, https://github.com/Divyansh-2309git/Green-AI
9
+ Project-URL: Documentation, https://github.com/Divyansh-2309git/Green-AI/blob/main/docs/online-documentation.md
10
+ Project-URL: Issues, https://github.com/Divyansh-2309git/Green-AI/issues
11
+ Project-URL: Changelog, https://github.com/Divyansh-2309git/Green-AI/blob/main/CHANGELOG.md
12
+ Keywords: green-ai,sustainability,energy-efficiency,machine-learning,carbon-emissions,local-first
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: System :: Monitoring
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy>=1.26
28
+ Requires-Dist: pandas>=2.1
29
+ Requires-Dist: scikit-learn>=1.4
30
+ Requires-Dist: psutil>=5.9
31
+ Requires-Dist: joblib>=1.3
32
+ Requires-Dist: fastapi>=0.110
33
+ Requires-Dist: uvicorn>=0.27
34
+ Requires-Dist: pydantic>=2.6
35
+ Provides-Extra: gpu
36
+ Requires-Dist: nvidia-ml-py>=12.0; extra == "gpu"
37
+ Provides-Extra: viz
38
+ Requires-Dist: matplotlib>=3.8; extra == "viz"
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest>=7.0; extra == "dev"
41
+ Requires-Dist: httpx>=0.27; extra == "dev"
42
+ Requires-Dist: ruff>=0.6; extra == "dev"
43
+ Requires-Dist: pip-audit>=2.7; extra == "dev"
44
+ Requires-Dist: build>=1.2; extra == "dev"
45
+ Requires-Dist: twine>=5.0; extra == "dev"
46
+ Provides-Extra: dl
47
+ Requires-Dist: torch>=2.1; extra == "dl"
48
+ Requires-Dist: torchvision>=0.16; extra == "dl"
49
+ Provides-Extra: cloud
50
+ Requires-Dist: httpx>=0.27; extra == "cloud"
51
+ Requires-Dist: psycopg[binary]>=3.1; extra == "cloud"
52
+ Requires-Dist: argon2-cffi>=23.1; extra == "cloud"
53
+ Requires-Dist: cryptography>=42.0; extra == "cloud"
54
+ Provides-Extra: storage
55
+ Requires-Dist: cryptography>=42.0; extra == "storage"
56
+ Requires-Dist: boto3>=1.34; extra == "storage"
57
+ Requires-Dist: google-cloud-storage>=2.14; extra == "storage"
58
+ Requires-Dist: azure-storage-blob>=12.19; extra == "storage"
59
+ Provides-Extra: parquet
60
+ Requires-Dist: pyarrow>=15.0; extra == "parquet"
61
+ Provides-Extra: all
62
+ Requires-Dist: nvidia-ml-py>=12.0; extra == "all"
63
+ Requires-Dist: matplotlib>=3.8; extra == "all"
64
+ Requires-Dist: torch>=2.1; extra == "all"
65
+ Requires-Dist: torchvision>=0.16; extra == "all"
66
+ Requires-Dist: cryptography>=42.0; extra == "all"
67
+ Requires-Dist: pytest>=7.0; extra == "all"
68
+ Requires-Dist: httpx>=0.27; extra == "all"
69
+ Dynamic: license-file
70
+
71
+ # Green AI Advisor
72
+
73
+ **An open-source, local-first AI energy intelligence platform that helps developers measure, understand, predict, and optimize the energy consumption of AI workloads.**
74
+
75
+ [![License: MIT](https://img.shields.io/badge/License-MIT-emerald.svg)](LICENSE)
76
+
77
+ - **Repository**: [https://github.com/Divyansh-2309git/Green-AI](https://github.com/Divyansh-2309git/Green-AI)
78
+ - **Public Website & Online Documentation**: Built in [`frontend/website/`](frontend/website/index.html) (`http://127.0.0.1:8000/website/` when running `greenai app`, or standalone build via `npm run build:website`)
79
+ - **Documentation Index**: [`docs/online-documentation.md`](docs/online-documentation.md)
80
+ - **Contributing & Security**: [`CONTRIBUTING.md`](CONTRIBUTING.md) • [`SECURITY.md`](SECURITY.md)
81
+
82
+ ---
83
+
84
+ ## 1. Overview & Key Capabilities
85
+
86
+ Green AI Advisor runs 100% locally without requiring a cloud account or internet access for core workflows:
87
+
88
+ | Capability | Status | Details & Boundaries |
89
+ |---|---|---|
90
+ | **Hardware Detection & Fingerprinting** | Implemented & Locally Verified | Cross-platform CPU, RAM, SMBIOS/DMI chassis, NVIDIA (`nvidia-smi`), AMD (`amd-smi`/`rocm-smi`), Intel (`xpu-smi`), Apple Silicon (`system_profiler`), and Linux PCI/DRM probes. |
91
+ | **Hardware Specifications Catalog** | Implemented (64 Entries) | Curated 64-entry catalog across 9 categories with verification provenance (`MANUFACTURER_VERIFIED: 52`, `THIRD_PARTY_SOURCED: 6`, `UNVERIFIED: 4`, `CONFLICTED: 1`, `OBSOLETE: 1`). Not market-wide coverage. |
92
+ | **Scoped Energy Measurement** | Hardware & Permission Dependent | Direct counters (NVIDIA Volta+ NVML, readable Linux RAPL CPU/DRAM) & trapezoidal power integration estimates. Never sums CPU + GPU as whole-system energy. |
93
+ | **Experiment Engine & Empirical Dataset** | Implemented (108 Trusted Runs) | Standardized benchmark runner, repetitions, SQLite persistence, canonical validation (`VALID`/`AUDIT_REQUIRED`/`QUARANTINED`/`REJECTED`), and privacy-scrubbed exports. |
94
+ | **Hardware-Aware ML Prediction** | Single-Device Calibrated Baseline | Pre-run Random Forest surrogate (`v2.0-B.4`) with post-run feature firewall and applicability gating (`HARDWARE_NOT_CALIBRATED` outside RTX 5060 Laptop GPU). |
95
+ | **Deterministic Optimization Advisor** | Implemented & Locally Verified | Constraint feasibility (`PASS`/`FAIL`/`UNKNOWN`), Pareto trade-off frontier, tariff cost, and operational Scope 2 CO₂e accounting (excludes embodied carbon). |
96
+ | **Local App & Unified CLI** | Implemented & Locally Verified | Single-command launcher (`greenai app`), `greenai setup`, `greenai doctor`, SQLite backups, and React dashboard on `127.0.0.1`. |
97
+ | **Optional Cloud Sync & Storage Advisor** | Opt-In / Mock-Tested | Phase 11 sync and Phase 12 read-only cloud storage advisor (AWS S3, GCP GCS, Azure Blob) verified via unit/mock tests; live cloud endpoints not hosted. |
98
+
99
+ ---
100
+
101
+ ## 2. Installation & Quick Start
102
+
103
+ Green AI Advisor (`green-ai-advisor`, `0.1.0` Beta) is packaged as a standard Python wheel and source distribution (`sdist`) with bundled dashboard/website assets, hardware/workload catalogs, cloud SQL migrations, and the verified baseline predictor artifact.
104
+
105
+ ### Requirements
106
+ - **Python**: `>= 3.11` (validated on Python 3.11–3.14)
107
+ - **Node.js**: `>= 18.0` (needed only when modifying and rebuilding frontend/website source assets)
108
+
109
+ ### Install (Linux / macOS / Windows)
110
+
111
+ **Option A — Install from release wheel / PyPI (when published):**
112
+ ```bash
113
+ # Linux / macOS
114
+ python3 -m venv .venv
115
+ source .venv/bin/activate
116
+ pip install dist/green_ai_advisor-0.1.0-py3-none-any.whl
117
+ # Or once published to PyPI via protected tagged release:
118
+ # pip install green-ai-advisor
119
+ ```
120
+
121
+ Windows PowerShell:
122
+ ```powershell
123
+ python -m venv .venv
124
+ .venv\Scripts\Activate.ps1
125
+ pip install dist\green_ai_advisor-0.1.0-py3-none-any.whl
126
+ ```
127
+
128
+ **Option B — Install from source repository:**
129
+ ```bash
130
+ git clone https://github.com/Divyansh-2309git/Green-AI.git
131
+ cd Green-AI
132
+ python3 -m venv .venv
133
+ source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
134
+ pip install -e .
135
+ cd frontend && npm install && npm run build && npm run build:website && cd ..
136
+ ```
137
+
138
+ ### Optional Dependency Groups
139
+
140
+ Core installation remains lightweight (CPU, pre-run prediction, advisor, local app/website) without forcing GPU vendor SDKs, PyTorch, or cloud SDKs:
141
+
142
+ | Extra | Packages | Purpose |
143
+ |---|---|---|
144
+ | `[gpu]` | `nvidia-ml-py>=12.0` | NVIDIA NVML direct GPU energy counters & telemetry |
145
+ | `[viz]` | `matplotlib>=3.8` | Optional plotting & report figures |
146
+ | `[dl]` | `torch>=2.1`, `torchvision>=0.16` | Deep learning benchmark workload execution |
147
+ | `[cloud]` | `psycopg[binary]`, `argon2-cffi`, `cryptography` | Optional Phase 11 PostgreSQL cloud service & Argon2id |
148
+ | `[storage]` | `cryptography`, `boto3`, `google-cloud-storage`, `azure-storage-blob` | Optional Phase 12 cloud storage adapter SDKs |
149
+ | `[parquet]` | `pyarrow>=15.0` | Optional Parquet empirical dataset export |
150
+ | `[dev]` | `pytest`, `httpx`, `ruff`, `pip-audit`, `build`, `twine` | Testing, linting, security audit, and release packaging |
151
+ | `[all]` | Combined `[gpu,viz,dl]` + `cryptography` + test tools | Convenience developer/GPU bundle |
152
+
153
+ ### First Launch & Diagnostics
154
+
155
+ ```bash
156
+ greenai setup
157
+ greenai doctor
158
+ greenai hardware
159
+ greenai app
160
+ ```
161
+
162
+ Once running (`http://127.0.0.1:8000`):
163
+ - **Local Dashboard**: `http://127.0.0.1:8000/`
164
+ - **Public Website & Online Docs**: `http://127.0.0.1:8000/website/`
165
+ - **Interactive OpenAPI Docs**: `http://127.0.0.1:8000/docs`
166
+
167
+ ### Data Locations, Backup & Uninstallation
168
+
169
+ - **Installed outside a repository checkout**: User databases, configuration, backups, and logs are stored in standard OS directories (`~/.local/share/greenai` & `~/.config/greenai` on Linux, `%LOCALAPPDATA%\GreenAI\data` & `%APPDATA%\GreenAI` on Windows, `~/Library/Application Support/GreenAI` on macOS) or `$GREENAI_DATA_DIR`.
170
+ - **Backup & Restore**: Run `greenai data backup --confirm` and `greenai data restore <backup-file> --confirm` (creates SHA-256 manifests and pre-restore safety backups).
171
+ - **Uninstallation**: `pip uninstall green-ai-advisor` removes only package code and bundled assets; user SQLite databases, configuration files, and backups are preserved.
172
+ - **Release & Compatibility Docs**: See [`docs/compatibility-matrix.md`](docs/compatibility-matrix.md), [`docs/release-notes-v0.1.0.md`](docs/release-notes-v0.1.0.md), [`CHANGELOG.md`](CHANGELOG.md), and [`docs/reports/phase14-final-release-report.md`](docs/reports/phase14-final-release-report.md).
173
+
174
+ ---
175
+
176
+ ## 3. Architecture Overview
177
+
178
+ 1. **Local Execution Plane (Layers 1–8)**: Hardware detection, scoped energy providers, standardized workloads, SQLite persistence, empirical dataset validation, pre-run ML predictor + firewall, deterministic Pareto advisor, and local FastAPI + React UI.
179
+ 2. **Optional Cloud Plane (Layers 9–10)**: Opt-in Phase 11 sync + community contribution consent and Phase 12 read-only cloud storage advisor (strictly decoupled from local operation).
180
+
181
+ For full architectural diagrams and specifications, see [`docs/architecture/system.md`](docs/architecture/system.md) and `/website/architecture`.
182
+
183
+ ---
184
+
185
+ ## 4. Hardware Compatibility & Scientific Limitations
186
+
187
+ 1. **Detection ≠ Direct Measurement ≠ Calibration**: Detecting an Intel, AMD, Apple Silicon, or NVIDIA device works portably, but direct energy reading depends on vendor counters and OS permissions (e.g., Linux RAPL sysfs read permissions).
188
+ 2. **GPU Scope vs. Whole-System Energy**: All **108** trusted `VALID` + `REAL` observations in the repository are **GPU-scoped** NVML measurements on **1** `NVIDIA GeForce RTX 5060 Laptop GPU` configuration. They do not measure whole-system AC wall power.
189
+ 3. **Generalization Boundaries**: Cross-device prediction (`LEAVE_ONE_HARDWARE_OUT`) returns `INSUFFICIENT_DATA`, and unseen-architecture evaluation (`LEAVE_ONE_ARCHITECTURE_OUT`) yields negative `R²` (`-0.37` to `-56.87`) across the 3 baseline architectures.
190
+ 4. **Operational Carbon Only**: CO₂e estimates apply `Energy (kWh) × Grid Carbon Intensity × PUE` strictly for operational electricity emissions; embodied/lifecycle hardware emissions are excluded.
191
+ 5. **Curated Hardware Catalog (64 Entries)**: Covers 64 entries across 9 categories with explicit `MANUFACTURER_VERIFIED` / `THIRD_PARTY_SOURCED` / `UNVERIFIED` / `CONFLICTED` / `OBSOLETE` provenance—not a comprehensive market-wide catalog.
192
+
193
+ ---
194
+
195
+ ## 5. Verification & Testing
196
+
197
+ ```bash
198
+ # Run backend test suite
199
+ .venv/bin/pytest tests/unit -q
200
+
201
+ # Typecheck & build local dashboard + public website
202
+ cd frontend && npx tsc --noEmit && npm run build && npm run build:website && cd ..
203
+ ```
204
+
205
+ ---
206
+
207
+ ## 6. Contributing & License
208
+
209
+ - Contributions welcome under the guidelines in [`CONTRIBUTING.md`](CONTRIBUTING.md).
210
+ - Report security issues via [`SECURITY.md`](SECURITY.md).
211
+ - Released under the [MIT License](LICENSE).
@@ -0,0 +1,141 @@
1
+ # Green AI Advisor
2
+
3
+ **An open-source, local-first AI energy intelligence platform that helps developers measure, understand, predict, and optimize the energy consumption of AI workloads.**
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-emerald.svg)](LICENSE)
6
+
7
+ - **Repository**: [https://github.com/Divyansh-2309git/Green-AI](https://github.com/Divyansh-2309git/Green-AI)
8
+ - **Public Website & Online Documentation**: Built in [`frontend/website/`](frontend/website/index.html) (`http://127.0.0.1:8000/website/` when running `greenai app`, or standalone build via `npm run build:website`)
9
+ - **Documentation Index**: [`docs/online-documentation.md`](docs/online-documentation.md)
10
+ - **Contributing & Security**: [`CONTRIBUTING.md`](CONTRIBUTING.md) • [`SECURITY.md`](SECURITY.md)
11
+
12
+ ---
13
+
14
+ ## 1. Overview & Key Capabilities
15
+
16
+ Green AI Advisor runs 100% locally without requiring a cloud account or internet access for core workflows:
17
+
18
+ | Capability | Status | Details & Boundaries |
19
+ |---|---|---|
20
+ | **Hardware Detection & Fingerprinting** | Implemented & Locally Verified | Cross-platform CPU, RAM, SMBIOS/DMI chassis, NVIDIA (`nvidia-smi`), AMD (`amd-smi`/`rocm-smi`), Intel (`xpu-smi`), Apple Silicon (`system_profiler`), and Linux PCI/DRM probes. |
21
+ | **Hardware Specifications Catalog** | Implemented (64 Entries) | Curated 64-entry catalog across 9 categories with verification provenance (`MANUFACTURER_VERIFIED: 52`, `THIRD_PARTY_SOURCED: 6`, `UNVERIFIED: 4`, `CONFLICTED: 1`, `OBSOLETE: 1`). Not market-wide coverage. |
22
+ | **Scoped Energy Measurement** | Hardware & Permission Dependent | Direct counters (NVIDIA Volta+ NVML, readable Linux RAPL CPU/DRAM) & trapezoidal power integration estimates. Never sums CPU + GPU as whole-system energy. |
23
+ | **Experiment Engine & Empirical Dataset** | Implemented (108 Trusted Runs) | Standardized benchmark runner, repetitions, SQLite persistence, canonical validation (`VALID`/`AUDIT_REQUIRED`/`QUARANTINED`/`REJECTED`), and privacy-scrubbed exports. |
24
+ | **Hardware-Aware ML Prediction** | Single-Device Calibrated Baseline | Pre-run Random Forest surrogate (`v2.0-B.4`) with post-run feature firewall and applicability gating (`HARDWARE_NOT_CALIBRATED` outside RTX 5060 Laptop GPU). |
25
+ | **Deterministic Optimization Advisor** | Implemented & Locally Verified | Constraint feasibility (`PASS`/`FAIL`/`UNKNOWN`), Pareto trade-off frontier, tariff cost, and operational Scope 2 CO₂e accounting (excludes embodied carbon). |
26
+ | **Local App & Unified CLI** | Implemented & Locally Verified | Single-command launcher (`greenai app`), `greenai setup`, `greenai doctor`, SQLite backups, and React dashboard on `127.0.0.1`. |
27
+ | **Optional Cloud Sync & Storage Advisor** | Opt-In / Mock-Tested | Phase 11 sync and Phase 12 read-only cloud storage advisor (AWS S3, GCP GCS, Azure Blob) verified via unit/mock tests; live cloud endpoints not hosted. |
28
+
29
+ ---
30
+
31
+ ## 2. Installation & Quick Start
32
+
33
+ Green AI Advisor (`green-ai-advisor`, `0.1.0` Beta) is packaged as a standard Python wheel and source distribution (`sdist`) with bundled dashboard/website assets, hardware/workload catalogs, cloud SQL migrations, and the verified baseline predictor artifact.
34
+
35
+ ### Requirements
36
+ - **Python**: `>= 3.11` (validated on Python 3.11–3.14)
37
+ - **Node.js**: `>= 18.0` (needed only when modifying and rebuilding frontend/website source assets)
38
+
39
+ ### Install (Linux / macOS / Windows)
40
+
41
+ **Option A — Install from release wheel / PyPI (when published):**
42
+ ```bash
43
+ # Linux / macOS
44
+ python3 -m venv .venv
45
+ source .venv/bin/activate
46
+ pip install dist/green_ai_advisor-0.1.0-py3-none-any.whl
47
+ # Or once published to PyPI via protected tagged release:
48
+ # pip install green-ai-advisor
49
+ ```
50
+
51
+ Windows PowerShell:
52
+ ```powershell
53
+ python -m venv .venv
54
+ .venv\Scripts\Activate.ps1
55
+ pip install dist\green_ai_advisor-0.1.0-py3-none-any.whl
56
+ ```
57
+
58
+ **Option B — Install from source repository:**
59
+ ```bash
60
+ git clone https://github.com/Divyansh-2309git/Green-AI.git
61
+ cd Green-AI
62
+ python3 -m venv .venv
63
+ source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
64
+ pip install -e .
65
+ cd frontend && npm install && npm run build && npm run build:website && cd ..
66
+ ```
67
+
68
+ ### Optional Dependency Groups
69
+
70
+ Core installation remains lightweight (CPU, pre-run prediction, advisor, local app/website) without forcing GPU vendor SDKs, PyTorch, or cloud SDKs:
71
+
72
+ | Extra | Packages | Purpose |
73
+ |---|---|---|
74
+ | `[gpu]` | `nvidia-ml-py>=12.0` | NVIDIA NVML direct GPU energy counters & telemetry |
75
+ | `[viz]` | `matplotlib>=3.8` | Optional plotting & report figures |
76
+ | `[dl]` | `torch>=2.1`, `torchvision>=0.16` | Deep learning benchmark workload execution |
77
+ | `[cloud]` | `psycopg[binary]`, `argon2-cffi`, `cryptography` | Optional Phase 11 PostgreSQL cloud service & Argon2id |
78
+ | `[storage]` | `cryptography`, `boto3`, `google-cloud-storage`, `azure-storage-blob` | Optional Phase 12 cloud storage adapter SDKs |
79
+ | `[parquet]` | `pyarrow>=15.0` | Optional Parquet empirical dataset export |
80
+ | `[dev]` | `pytest`, `httpx`, `ruff`, `pip-audit`, `build`, `twine` | Testing, linting, security audit, and release packaging |
81
+ | `[all]` | Combined `[gpu,viz,dl]` + `cryptography` + test tools | Convenience developer/GPU bundle |
82
+
83
+ ### First Launch & Diagnostics
84
+
85
+ ```bash
86
+ greenai setup
87
+ greenai doctor
88
+ greenai hardware
89
+ greenai app
90
+ ```
91
+
92
+ Once running (`http://127.0.0.1:8000`):
93
+ - **Local Dashboard**: `http://127.0.0.1:8000/`
94
+ - **Public Website & Online Docs**: `http://127.0.0.1:8000/website/`
95
+ - **Interactive OpenAPI Docs**: `http://127.0.0.1:8000/docs`
96
+
97
+ ### Data Locations, Backup & Uninstallation
98
+
99
+ - **Installed outside a repository checkout**: User databases, configuration, backups, and logs are stored in standard OS directories (`~/.local/share/greenai` & `~/.config/greenai` on Linux, `%LOCALAPPDATA%\GreenAI\data` & `%APPDATA%\GreenAI` on Windows, `~/Library/Application Support/GreenAI` on macOS) or `$GREENAI_DATA_DIR`.
100
+ - **Backup & Restore**: Run `greenai data backup --confirm` and `greenai data restore <backup-file> --confirm` (creates SHA-256 manifests and pre-restore safety backups).
101
+ - **Uninstallation**: `pip uninstall green-ai-advisor` removes only package code and bundled assets; user SQLite databases, configuration files, and backups are preserved.
102
+ - **Release & Compatibility Docs**: See [`docs/compatibility-matrix.md`](docs/compatibility-matrix.md), [`docs/release-notes-v0.1.0.md`](docs/release-notes-v0.1.0.md), [`CHANGELOG.md`](CHANGELOG.md), and [`docs/reports/phase14-final-release-report.md`](docs/reports/phase14-final-release-report.md).
103
+
104
+ ---
105
+
106
+ ## 3. Architecture Overview
107
+
108
+ 1. **Local Execution Plane (Layers 1–8)**: Hardware detection, scoped energy providers, standardized workloads, SQLite persistence, empirical dataset validation, pre-run ML predictor + firewall, deterministic Pareto advisor, and local FastAPI + React UI.
109
+ 2. **Optional Cloud Plane (Layers 9–10)**: Opt-in Phase 11 sync + community contribution consent and Phase 12 read-only cloud storage advisor (strictly decoupled from local operation).
110
+
111
+ For full architectural diagrams and specifications, see [`docs/architecture/system.md`](docs/architecture/system.md) and `/website/architecture`.
112
+
113
+ ---
114
+
115
+ ## 4. Hardware Compatibility & Scientific Limitations
116
+
117
+ 1. **Detection ≠ Direct Measurement ≠ Calibration**: Detecting an Intel, AMD, Apple Silicon, or NVIDIA device works portably, but direct energy reading depends on vendor counters and OS permissions (e.g., Linux RAPL sysfs read permissions).
118
+ 2. **GPU Scope vs. Whole-System Energy**: All **108** trusted `VALID` + `REAL` observations in the repository are **GPU-scoped** NVML measurements on **1** `NVIDIA GeForce RTX 5060 Laptop GPU` configuration. They do not measure whole-system AC wall power.
119
+ 3. **Generalization Boundaries**: Cross-device prediction (`LEAVE_ONE_HARDWARE_OUT`) returns `INSUFFICIENT_DATA`, and unseen-architecture evaluation (`LEAVE_ONE_ARCHITECTURE_OUT`) yields negative `R²` (`-0.37` to `-56.87`) across the 3 baseline architectures.
120
+ 4. **Operational Carbon Only**: CO₂e estimates apply `Energy (kWh) × Grid Carbon Intensity × PUE` strictly for operational electricity emissions; embodied/lifecycle hardware emissions are excluded.
121
+ 5. **Curated Hardware Catalog (64 Entries)**: Covers 64 entries across 9 categories with explicit `MANUFACTURER_VERIFIED` / `THIRD_PARTY_SOURCED` / `UNVERIFIED` / `CONFLICTED` / `OBSOLETE` provenance—not a comprehensive market-wide catalog.
122
+
123
+ ---
124
+
125
+ ## 5. Verification & Testing
126
+
127
+ ```bash
128
+ # Run backend test suite
129
+ .venv/bin/pytest tests/unit -q
130
+
131
+ # Typecheck & build local dashboard + public website
132
+ cd frontend && npx tsc --noEmit && npm run build && npm run build:website && cd ..
133
+ ```
134
+
135
+ ---
136
+
137
+ ## 6. Contributing & License
138
+
139
+ - Contributions welcome under the guidelines in [`CONTRIBUTING.md`](CONTRIBUTING.md).
140
+ - Report security issues via [`SECURITY.md`](SECURITY.md).
141
+ - Released under the [MIT License](LICENSE).
@@ -0,0 +1,19 @@
1
+ # Security & Privacy Policy
2
+
3
+ ## 1. Local-First Security Boundaries
4
+
5
+ - **Loopback Binding**: `greenai app` and `greenai dashboard` bind to `127.0.0.1` by default and reject external `Host` headers and `X-Forwarded-Host` spoofing.
6
+ - **CSRF & Origin Protections**: `LocalSecurityMiddleware` restricts CORS to local application origins and enforces `X-GreenAI-CSRF` tokens, `SameSite=Strict` cookies, and `application/json` content types on mutating `/api/` routes.
7
+ - **No Unattended Destructive Actions**: Backup restores, dataset exports, calibration runs, and Phase 12 cloud storage previews enforce explicit confirmation and path-traversal guards.
8
+
9
+ ## 2. Privacy & Consent Guarantees
10
+
11
+ - **Zero Default Analytics**: Neither the local application nor the Phase 13 public website collects analytics or telemetry by default.
12
+ - **Public Website Isolation**: Read-only public endpoints (`/api/v1/public/*`) and static JSON exports (`frontend/public/data/`) enforce `sanitize_for_privacy()` and `contains_pii_or_sensitive_identifiers()`, exposing only `VALID` + `REAL` observations and curated hardware metadata with zero local paths, hostnames, credentials, or user identifiers.
13
+ - **Optional Cloud Consent**: Optional Phase 11 cloud sync and Phase 12 cloud storage consents default to `False`. Private sync and community benchmark contributions are strictly separated.
14
+
15
+ ## 3. Vulnerability Reporting
16
+
17
+ If you discover a security vulnerability, please report it privately via [GitHub Security Advisories](https://github.com/Divyansh-2309git/Green-AI/security/advisories) (or contact repository maintainers privately) before public disclosure.
18
+
19
+ *Disclosure Note: Green AI Advisor is an open-source MIT project and does not claim third-party security certifications.*
@@ -0,0 +1,17 @@
1
+ # Green AI Advisor - Example Configuration File
2
+ # Copy to ~/.config/greenai/config.toml or pass via --config <path>
3
+
4
+ # Economic & Environmental Tariffs
5
+ electricity_price = 8.0 # Electricity price per kWh
6
+ currency = "INR" # Currency symbol (e.g. INR, USD, EUR)
7
+ carbon_intensity = 700.0 # Grid carbon intensity in gCO2e/kWh
8
+ pue = 1.0 # Data center Power Usage Effectiveness
9
+
10
+ # Default Workload Strategy
11
+ policy = "energy" # Default policy: energy, cost, carbon, balanced, constraint, efficiency
12
+ precision = "fp32" # Default precision: fp32, amp
13
+ # gpu = "auto" # Optional target GPU override; defaults to auto-detected host hardware
14
+
15
+ # Candidate Exploration Space
16
+ allowed_batch_sizes = [32, 64, 128]
17
+ allowed_precisions = ["FP32", "AMP"]
@@ -0,0 +1,53 @@
1
+ # Phase 9: Intelligent Deterministic Advisor Architecture
2
+
3
+ **Module:** `src/greenai/advisor/` (`contracts.py`, `carbon_cost.py`, `candidates.py`, `evidence.py`, `constraints.py`, `objectives.py`, `engine.py`, `simulator.py`)
4
+ **Schema Version:** `9.0.0`
5
+ **API Prefix:** `/api/v1/advisor/v9/*`
6
+ **CLI Command:** `greenai optimize <recommend|candidates|constraints|tradeoffs|export>` (alias: `simulate`)
7
+ **Frontend View:** `Optimization Simulator` ([OptimizationSimulatorView.tsx](file:///home/divyansh/Documents/GreenAi/frontend/src/components/OptimizationSimulatorView.tsx))
8
+
9
+ ---
10
+
11
+ ## 1. Overview & Separation from Execution
12
+
13
+ Phase 9 provides a strictly read-only, deterministic optimization and decision-support engine built directly on top of Phases 2–8 without duplicating catalog validation, energy measurement, dataset auditing, or prediction logic:
14
+
15
+ - **Catalog & Compatibility Reuse (`src/greenai/catalog`):** Candidate generation validates every option via `CatalogRegistry` and `validate_workload_configuration()`, respecting model, dataset, precision, mode, device, and static memory constraints.
16
+ - **Empirical Evidence Reuse (`src/greenai/dataset`, Phase 7):** Queries `VALID` + `REAL` observations with matching hardware, measurement scope, and exact workload parameters, keeping `DIRECT_COUNTER` vs estimated energy separated.
17
+ - **Predictive Evidence Reuse (`src/greenai/prediction`, Phase 8):** Queries registered Phase 8 candidate models or applicability-gated `production_v2_0_b4` via `assess_calibration_compatibility()` and `assess_prediction_applicability()`, suppressing numeric outputs on `OUT_OF_DOMAIN`, `UNSUPPORTED_CONFIGURATION`, `INSUFFICIENT_EVIDENCE`, or `MODEL_UNAVAILABLE`.
18
+ - **Legacy Preservation:** Preserves `AdvisorService` (V4/V6), `RecommendationEngine` (V3), `/api/v1/advisor/analyze`, `/api/v1/advisor/report`, `greenai advise`, `greenai advisor`, and `models/v2_0_b2/energy_predictor_random_forest.joblib` (`e039513f097fbd7e4e7447413839d3f6dab11b8fe543016cdf51ec680347a433`) unchanged.
19
+
20
+ ---
21
+
22
+ ## 2. Candidate Generation Policy (`candidates.py`)
23
+
24
+ 1. Deterministic ordering by `(workload_id, mode, precision, batch_size, epochs)`.
25
+ 2. Respects `workload.supported_precisions`, `workload.supported_modes`, `workload.supported_batch_sizes`, and `workload.compatibility_requirements.supported_devices`.
26
+ 3. Never substitutes unsupported precisions (e.g. refuses `INT8` in training or on `resnet18`; refuses `FP16`/`AMP` on CPU-only PyTorch targets).
27
+ 4. Always preserves the original baseline configuration alongside rejected candidates with explicit reasons.
28
+
29
+ ---
30
+
31
+ ## 3. Evidence Hierarchy & Scope Restrictions (`evidence.py`)
32
+
33
+ 1. `DIRECT_PHYSICAL_MEASUREMENT` — Phase 7 `VALID` + `DIRECT_COUNTER` observations for matching hardware + scope.
34
+ 2. `ESTIMATED_ENERGY_MEASUREMENT` — Phase 7 `VALID` non-direct observations (excluded whenever `require_direct_measurement_only=True` or `allow_estimated_energy=False`).
35
+ 3. `HARDWARE_COMPATIBLE_CALIBRATED_PREDICTION` — In-domain applicability + `CALIBRATED_COMPATIBLE` prediction.
36
+ 4. `IN_DOMAIN_PREDICTION_WITH_CAVEATS` — In-domain prediction with extrapolation or reassessment warnings.
37
+ 5. `OUT_OF_DOMAIN_PREDICTION` / `INSUFFICIENT_EVIDENCE` — Numeric energy suppressed (`None`).
38
+
39
+ Incompatible scopes (`GPU`, `CPU`, `DRAM`, `SYSTEM`, `BATTERY`, `EXTERNAL_METER`) are never combined or compared.
40
+
41
+ ---
42
+
43
+ ## 4. Constraints, Objectives, Pareto & Impact
44
+
45
+ - **Constraints (`constraints.py`):** Evaluates `max_runtime_seconds`, `min_throughput_samples_per_sec`, `max_memory_mb`, `max_vram_mb`, `min_task_quality`, `energy_budget_wh`, `cost_budget`, `carbon_budget_gco2e`, `required_energy_scope`, and evidence policy. Missing metrics produce **`UNKNOWN`**, never `PASS`. Hard vs soft preference constraints are tracked separately.
46
+ - **Objectives (`objectives.py`):** Supports `MINIMIZE_ENERGY`, `MINIMIZE_COST`, `MINIMIZE_CARBON`, `MINIMIZE_RUNTIME_WITH_ENERGY_BUDGET`, `MAXIMIZE_THROUGHPUT_WITH_BUDGETS`, and `BALANCED_ENERGY_PERFORMANCE`. Computes multi-dimensional Pareto dominance over jointly populated comparable axes without combining Wh, seconds, currency, and grams into an arbitrary scalar score, recording `dominated_by` and `dominance_explanation`.
47
+ - **Cost, Carbon & Regional Carbon Intelligence (`carbon_cost.py`):** Computes `energy_kwh * electricity_price_per_kwh` and `energy_kwh * carbon_intensity_g_per_kwh * pue_applied` (`lifecycle_scope="OPERATIONAL_ONLY"`). Never fabricates missing tariffs, grid factors, regional databases, or facility PUE values.
48
+
49
+ ---
50
+
51
+ ## 5. Read-Only Simulator & Current Limitations
52
+
53
+ `OptimizationSimulatorService` never launches experiments or mutates configs; benchmarking routes users to `greenai experiment run ...` or the Experiment Runner UI tab. Physical empirical validation in the local repository currently spans 108 `VALID` observations on a single GPU (`NVIDIA GeForce RTX 5060 Laptop GPU`, `GPU` scope, `DIRECT_COUNTER`), so cross-device prediction cannot be claimed.