diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 4c874f70..4c6179c5 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -182,6 +182,7 @@ DEFAULT_CONFIG = { "model": "", # e.g. "google/gemini-2.5-flash", "gpt-4o" "base_url": "", # direct OpenAI-compatible endpoint (takes precedence over provider) "api_key": "", # API key for base_url (falls back to OPENAI_API_KEY) + "timeout": 30, # seconds — increase for slow local vision models }, "web_extract": { "provider": "auto", diff --git a/tools/vision_tools.py b/tools/vision_tools.py index a6d73a05..657cd479 100644 --- a/tools/vision_tools.py +++ b/tools/vision_tools.py @@ -298,12 +298,23 @@ async def vision_analyze_tool( logger.info("Processing image with vision model...") - # Call the vision API via centralized router + # Call the vision API via centralized router. + # Read timeout from config.yaml (auxiliary.vision.timeout), default 30s. + vision_timeout = 30.0 + try: + from hermes_cli.config import load_config + _cfg = load_config() + _vt = _cfg.get("auxiliary", {}).get("vision", {}).get("timeout") + if _vt is not None: + vision_timeout = float(_vt) + except Exception: + pass call_kwargs = { "task": "vision", "messages": messages, "temperature": 0.1, "max_tokens": 2000, + "timeout": vision_timeout, } if model: call_kwargs["model"] = model diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.md index 6bb1b313..10cb92b4 100644 --- a/website/docs/user-guide/configuration.md +++ b/website/docs/user-guide/configuration.md @@ -907,6 +907,7 @@ auxiliary: model: "" # e.g. "openai/gpt-4o", "google/gemini-2.5-flash" base_url: "" # Custom OpenAI-compatible endpoint (overrides provider) api_key: "" # API key for base_url (falls back to OPENAI_API_KEY) + timeout: 30 # seconds — increase for slow local vision models # Web page summarization + browser page text extraction web_extract: