Skip to content

feat(api): extend /api/health with model load diagnostics#28

Open
Swatikantamishra8 wants to merge 2 commits intoClimate-Vision:mainfrom
Swatikantamishra8:feat/health-model-diagnostics
Open

feat(api): extend /api/health with model load diagnostics#28
Swatikantamishra8 wants to merge 2 commits intoClimate-Vision:mainfrom
Swatikantamishra8:feat/health-model-diagnostics

Conversation

@Swatikantamishra8
Copy link
Copy Markdown

Summary

Closes #20

Extends the /api/health endpoint to report per-model load status, addressing the feature request in issue #20.

Changes

  • Added model_diagnostics dict to /api/health response
  • For each enabled analysis type, attempts to load the model via _load_model()
  • Reports loaded (bool), path (checkpoint path), and error (if any) per model
  • Health status is marked as degraded if any model fails to load

Example Response

{
  "status": "ok",
  "version": "0.2.0",
  "analysis_types": ["deforestation", "ice_melt", "flooding"],
  "config_valid": true,
  "config_issues": [],
  "model_diagnostics": {
    "deforestation": {"loaded": true, "path": "models/best_model.pth", "error": null},
    "ice_melt": {"loaded": false, "path": null, "error": "No checkpoint found"}
  }
}

Notes

  • model_diagnostics values are dict[str, Any] with keys: loaded, path, error
  • Models that load successfully will have error: null
  • This is non-breaking: existing fields are unchanged

Closes Climate-Vision#20

- Try to load each enabled model via _load_model()
- Report loaded status, checkpoint path, and any errors
- Return model_diagnostics dict in health response
- Mark health as degraded if any model fails to load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue] Extend /api/health with model load diagnostics

1 participant