From 10c83c3e1efc5cf6231c117c2c3f778fd6d1e3c0 Mon Sep 17 00:00:00 2001 From: alpha-nerd-nomyo Date: Mon, 2 Mar 2026 08:54:46 +0100 Subject: [PATCH] fix(router): treat missing status as loaded for llama model check Add check for `status is None` in `_is_llama_model_loaded`. Models without a status field (e.g., single-model servers) are assumed to be always loaded rather than failing the check. Also updated docstring to clarify this behavior. --- router.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/router.py b/router.py index 442721a..b817eac 100644 --- a/router.py +++ b/router.py @@ -374,8 +374,11 @@ def _extract_llama_quant(name: str) -> str: def _is_llama_model_loaded(item: dict) -> bool: """Return True if a llama-server /v1/models item has status 'loaded'. - Handles both dict format ({"value": "loaded"}) and plain string ("loaded").""" + Handles both dict format ({"value": "loaded"}) and plain string ("loaded"). + If no status field is present, the model is always-loaded (not dynamically managed).""" status = item.get("status") + if status is None: + return True # No status field: model is always loaded (e.g. single-model servers) if isinstance(status, dict): return status.get("value") == "loaded" if isinstance(status, str):