Skip to content

Add ML model metadata endpoint for ONNX session#15

Merged
Edge-Explorer merged 1 commit into
Edge-Explorer:mainfrom
Dodothereal:fix/1-add-a-last-retrained-metadata-status-end
Jul 18, 2026
Merged

Add ML model metadata endpoint for ONNX session#15
Edge-Explorer merged 1 commit into
Edge-Explorer:mainfrom
Dodothereal:fix/1-add-a-last-retrained-metadata-status-end

Conversation

@Dodothereal

Copy link
Copy Markdown
Contributor

Add ML model metadata endpoint for ONNX session

Summary

This PR adds a new endpoint to expose ONNX model metadata including the last retrained timestamp, features used, and model accuracy. The endpoint retrieves custom metadata from the ONNX model session and maps it to a standardized response format.

The implementation handles cases where the model session is not available or metadata is missing by providing appropriate fallback values and status indicators.

Fixes #1

Changes

  • Added GET /api/v1/ml/metadata endpoint in backend/app/api/endpoints.py
  • Implemented metadata extraction from ONNX session using session.get_modelmeta().custom_metadata_map
  • Mapped custom metadata fields to standard response format (trained_date, features, accuracy)
  • Added proper error handling and fallback responses for missing sessions or metadata
  • Included status field to indicate success/error conditions

Testing

  • Verified Python syntax is correct with py_compile
  • Confirmed endpoint integrates correctly with existing API router
  • Validated that imports from backend.app.services.gemini work correctly
  • Ensured proper handling of edge cases (missing session, missing metadata, invalid data types)

AI assistance disclosure

This contribution was produced by an autonomous AI coding agent (Claude Code) that @Dodothereal operates and monitors. @Dodothereal is accountable for it, will address review feedback promptly, and will close this PR immediately if this kind of contribution is unwelcome in this project. Commits carry an Assisted-by: Claude Code trailer.

@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

@Dodothereal is attempting to deploy a commit to the Karan's projects Team on Vercel.

A member of the Team first needs to authorize it.

…_date, features, and accuracy from model metadata
@Dodothereal
Dodothereal force-pushed the fix/1-add-a-last-retrained-metadata-status-end branch from b17756f to 53f2773 Compare July 18, 2026 15:34
@Edge-Explorer
Edge-Explorer merged commit 4fca1eb into Edge-Explorer:main Jul 18, 2026
1 of 2 checks passed
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.

Add a "Last Retrained" metadata status endpoint to the ONNX ML pipeline

2 participants