diff --git a/router/router.py b/router/router.py index 06eeb60..67b49a9 100644 --- a/router/router.py +++ b/router/router.py @@ -424,7 +424,7 @@ def performance(): return jsonify({"models": [], "reasons": [], "agents": [], "summary": {"total_requests": 0}}) def pct(values, p): - if not values: return 0 + if len(values) < 2: return round(values[0], 1) if values else 0 return round(statistics.quantiles(sorted(values), n=100, method='inclusive')[min(p-1, 98)], 1) # Per-model stats