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
- Create Endpoint:
- Expose a new
GET /api/v1/ml/metadata route in the FastAPI backend.
- 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
- 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.
Currently, the FastAPI backend downloads and loads
model.onnxfrom Hugging Face on startup. We want to expose a new endpoint/api/v1/ml/metadatathat 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
GET /api/v1/ml/metadataroute in the FastAPI backend.backend/app/services/ml.py.{ "trained_date": "2026-07-15", "features": ["rsi_14", "macd", "ema_ratio"], "accuracy": 0.68 }Code Pointers
backend/app/api/v1/backend/app/services/ml.pyHow to run locally
Refer to CONTRIBUTING.md for local environment setup with
uv.