fix: model naming for affinity status for llama endpoints
This commit is contained in:
parent
aa7ec6354a
commit
ad0be90a70
1 changed files with 5 additions and 1 deletions
|
|
@ -3121,15 +3121,19 @@ async def affinity_stats(request: Request):
|
||||||
|
|
||||||
now = time.monotonic()
|
now = time.monotonic()
|
||||||
entries: list[dict] = []
|
entries: list[dict] = []
|
||||||
|
llama_eps = set(config.llama_server_endpoints)
|
||||||
async with _affinity_lock:
|
async with _affinity_lock:
|
||||||
for fp, (ep, mdl, expires_at) in list(_affinity_map.items()):
|
for fp, (ep, mdl, expires_at) in list(_affinity_map.items()):
|
||||||
remaining = expires_at - now
|
remaining = expires_at - now
|
||||||
if remaining <= 0:
|
if remaining <= 0:
|
||||||
_affinity_map.pop(fp, None)
|
_affinity_map.pop(fp, None)
|
||||||
continue
|
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({
|
entries.append({
|
||||||
"endpoint": ep,
|
"endpoint": ep,
|
||||||
"model": mdl,
|
"model": display_model,
|
||||||
"remaining": round(remaining, 2),
|
"remaining": round(remaining, 2),
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue