diff --git a/app/api/v1beta/router.py b/app/api/v1beta/router.py index 89b65ff..357560b 100644 --- a/app/api/v1beta/router.py +++ b/app/api/v1beta/router.py @@ -113,8 +113,8 @@ def post_estimations( examples=[300], description="Number of tokens generated by the model.", ), - request_latency: float = Body( - ..., + request_latency: float | None = Body( + default=None, embed=True, examples=[1.5], description="Measured request latency in seconds.", @@ -131,7 +131,10 @@ def post_estimations( provider=provider, model_name=model_name, output_token_count=output_token_count, - request_latency=request_latency, + # Use high request latency if not provided, to default the latency estimation made with + # the TPS and TTFT data from OpenRouter. + # TODO: remove the high value when the estimations module in EcoLogits (Python) is ready + request_latency=request_latency if request_latency is not None else 1e6, electricity_mix_zone=electricity_mix_zone, ) return {"impacts": impacts}