From 6debd0ab19ff720dfc7d63fba7facd733344d132 Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Wed, 27 May 2026 13:21:58 +0400 Subject: [PATCH] =?UTF-8?q?Studio:=20fix=20RAG=20VLM=20probe=20=E2=80=94?= =?UTF-8?q?=20import=20singleton=20from=20routes.inference,=20not=20core.i?= =?UTF-8?q?nference.llama=5Fcpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- studio/backend/core/rag/ingestion.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/studio/backend/core/rag/ingestion.py b/studio/backend/core/rag/ingestion.py index 3f460617ab..2b2d830e73 100644 --- a/studio/backend/core/rag/ingestion.py +++ b/studio/backend/core/rag/ingestion.py @@ -667,12 +667,18 @@ def _probe_loaded_vlm() -> tuple[str | None, str | None]: unsloth in-process VLMs would need a different bridge. """ try: - from core.inference.llama_cpp import get_llama_cpp_backend - except Exception: + # The singleton getter lives in routes.inference, not the + # llama_cpp module. Importing from the wrong place silently + # returned None for every probe — captioner always fell back + # to the helper VLM even when the chat model was vision-capable. + from routes.inference import get_llama_cpp_backend + except Exception as exc: + logger.debug("RAG probe: get_llama_cpp_backend import failed: %s", exc) return None, None try: backend = get_llama_cpp_backend() - except Exception: + except Exception as exc: + logger.debug("RAG probe: get_llama_cpp_backend() raised: %s", exc) return None, None if not getattr(backend, "is_loaded", False): return None, None