flip_api.private_services.save_training_metrics

Attributes

router

Functions

save_training_metrics_endpoint(, _)

Receives and saves training metrics for a given model ID and trust.

Module Contents

flip_api.private_services.save_training_metrics.router
flip_api.private_services.save_training_metrics.save_training_metrics_endpoint(model_id: uuid.UUID, training_metrics: flip_api.domain.schemas.private.TrainingMetrics, request: fastapi.Request, db: sqlmodel.Session = Depends(get_session), _: None = Depends(authenticate_internal_service)) None

Receives and saves training metrics for a given model ID and trust.

This endpoint is internal-only: it accepts requests from the fl-server on the Central Hub (authenticated via INTERNAL_SERVICE_KEY_HEADER).

Parameters:
  • model_id (UUID) – The unique identifier for the model.

  • training_metrics (TrainingMetrics) – The training metrics to be saved.

  • request (Request) – The FastAPI request object, used for logging and context.

  • db (Session) – Database session dependency.

Returns:

HTTP 204 No Content on success, or appropriate error response.

Return type:

Response

Raises:
  • HTTPException – If the trust is not associated with the model.

  • HTTPException – If an internal server error occurs during processing.