From 4600a69cacdb764286dcd95c242c25b96ffc2e42 Mon Sep 17 00:00:00 2001 From: inference-bot Date: Sat, 26 Sep 2026 16:21:11 -0600 Subject: [PATCH] Fix dashboard 500s: raise httpx read timeout on /team/list + /spend/logs calls --- app/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 60237ba..dbf1784 100644 --- a/app/main.py +++ b/app/main.py @@ -788,7 +788,9 @@ async def litellm_get_or_create_team(email: str, budget: float) -> str: check /team/list first. """ alias = f"member:{email}" - async with httpx.AsyncClient() as client: + # /team/list has grown slow as usage accumulates; the httpx default 5s + # read timeout was too short (root cause of dashboard 500s on 2026-09-26). + async with httpx.AsyncClient(timeout=httpx.Timeout(connect=15.0, read=60.0, write=15.0, pool=15.0)) as client: r = await client.get( f"{LITELLM_BASE}/team/list", headers={"Authorization": f"Bearer {LITELLM_MASTER_KEY}"}, @@ -1490,7 +1492,10 @@ async def broker_get_usage(email: str) -> dict: spend = 0.0 reset_at = None - async with httpx.AsyncClient() as client: + # /team/list and /spend/logs have grown slow as usage accumulates; the + # httpx default 5s read timeout was too short and made /broker/usage 500. + client_timeout = httpx.Timeout(connect=15.0, read=60.0, write=15.0, pool=15.0) + async with httpx.AsyncClient(timeout=client_timeout) as client: # 1. Team spend + budget r = await client.get( f"{LITELLM_BASE}/team/list",