diff --git a/services/planner-agent/src/llm_router.py b/services/planner-agent/src/llm_router.py index b820803..5213ad6 100644 --- a/services/planner-agent/src/llm_router.py +++ b/services/planner-agent/src/llm_router.py @@ -337,13 +337,16 @@ class LLMRouter: **cfg.extra_kwargs, } if cfg.api_base: - kwargs["api_base"] = cfg.api_base + # Use "base_url" — the officially named param of litellm.acompletion(). + # "api_base" also works (via **kwargs → kwargs.get("api_base")), but + # "base_url" is what acompletion() maps directly into completion_kwargs. + kwargs["base_url"] = cfg.api_base - # DEBUG — temporary, remove after confirming OLLAMA_API_BASE routing - logger.info( - "[llm_router][DEBUG] calling litellm model=%s api_base=%s", - cfg.name, - kwargs.get("api_base", ""), + # DEBUG [TEMP] — print() to stdout so it's always visible regardless of log level + print( + f"[llm_router][DEBUG] litellm call: model={cfg.name!r}" + f" base_url={kwargs.get('base_url', '')!r}", + flush=True, ) try: