Skip to content

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

Description

@Edge-Explorer

Currently, the FastAPI backend downloads and loads model.onnx from Hugging Face on startup. We want to expose a new endpoint /api/v1/ml/metadata that returns the metadata properties stored inside the ONNX model structure (e.g., training date, feature lists, and win-rate/accuracy scores).
This will allow the frontend to display actual model performance metrics directly to the user instead of hardcoded indicators.

Requirements

  1. Create Endpoint:
    • Expose a new GET /api/v1/ml/metadata route in the FastAPI backend.
  2. Retrieve ONNX Metadata:
    • Access the loaded ONNX session inside backend/app/services/ml.py.
    • Read custom properties using:
      meta = session.get_modelmeta()
      custom_meta = meta.custom_metadata_map
  3. API Response:
    • Return a JSON payload containing the metadata details, such as:
      {
        "trained_date": "2026-07-15",
        "features": ["rsi_14", "macd", "ema_ratio"],
        "accuracy": 0.68
      }

Code Pointers

  • Backend routes: check backend/app/api/v1/
  • ONNX Model loading service: check backend/app/services/ml.py

How to run locally

Refer to CONTRIBUTING.md for local environment setup with uv.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions