dev-0.9.x -> main #76

Merged
alpha-nerd merged 15 commits from dev-0.9.x into main 2026-05-15 09:16:11 +02:00
Showing only changes of commit ad0be90a70 - Show all commits

View file

@ -3121,15 +3121,19 @@ async def affinity_stats(request: Request):
now = time.monotonic()
entries: list[dict] = []
llama_eps = set(config.llama_server_endpoints)
async with _affinity_lock:
for fp, (ep, mdl, expires_at) in list(_affinity_map.items()):
remaining = expires_at - now
if remaining <= 0:
_affinity_map.pop(fp, None)
continue
# Mirror the normalisation used by /api/ps_details so the dashboard
# can join affinity entries to PS rows by (endpoint, model).
display_model = _normalize_llama_model_name(mdl) if ep in llama_eps else mdl
entries.append({
"endpoint": ep,
"model": mdl,
"model": display_model,
"remaining": round(remaining, 2),
})
return {