Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

debug: use print to stderr instead of loguru for debugging

LearningCircuit5709b9553580
diff --git a/src/local_deep_research/api/research_functions.py b/src/local_deep_research/api/research_functions.py
index 91e6d09e32..4d6e00db86 100644
--- a/src/local_deep_research/api/research_functions.py
+++ b/src/local_deep_research/api/research_functions.py
@@ -108,15 +108,29 @@ def _init_search_system(
"search.tool", settings_snapshot=settings_snapshot
)
- # Debug logging
- logger.info(f"DEBUG: search_tool={search_tool}, type={type(search_tool)}")
- logger.info(
- f"DEBUG: settings_snapshot present={settings_snapshot is not None}"
+ # Debug with print to stderr
+ import sys
+
+ print(
+ f"[LDR-DEBUG] search_tool={search_tool}, type={type(search_tool)}",
+ file=sys.stderr,
+ )
+ print(
+ f"[LDR-DEBUG] settings_snapshot present={settings_snapshot is not None}",
+ file=sys.stderr,
)
- logger.info(f"DEBUG: programmatic_mode={programmatic_mode}")
+ print(f"[LDR-DEBUG] programmatic_mode={programmatic_mode}", file=sys.stderr)
+ if settings_snapshot and "search.tool" in settings_snapshot:
+ print(
+ f"[LDR-DEBUG] search.tool in snapshot={settings_snapshot['search.tool']}",
+ file=sys.stderr,
+ )
if search_tool:
- logger.info(f"DEBUG: Calling get_search with search_tool={search_tool}")
+ print(
+ f"[LDR-DEBUG] Calling get_search with search_tool={search_tool}",
+ file=sys.stderr,
+ )
search_engine = get_search(
search_tool,
llm_instance=llm,
@@ -124,16 +138,18 @@ def _init_search_system(
settings_snapshot=settings_snapshot,
programmatic_mode=programmatic_mode,
)
- logger.info(
- f"DEBUG: get_search returned: {type(search_engine) if search_engine else 'None'}"
+ print(
+ f"[LDR-DEBUG] get_search returned: {type(search_engine) if search_engine else 'None'}",
+ file=sys.stderr,
)
if search_engine is None:
logger.warning(
f"Could not create search engine '{search_tool}', using default."
)
else:
- logger.error(
- f"DEBUG: search_tool is falsy! search_tool={repr(search_tool)}"
+ print(
+ f"[LDR-DEBUG] search_tool is falsy! search_tool={repr(search_tool)}",
+ file=sys.stderr,
)
# Create search system with custom parameters