Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/api/v1beta/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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}
Expand Down
Loading