ChatOllama built by esperanto has no timeout; ESPERANTO_LLM_TIMEOUT does not apply to transformations or chat
Author: lfnovoCreated Sep 5, 2026Updated Sep 5, 2026
Labelsbugarea: providersneeds-designesperanto
Summary
ESPERANTO_LLM_TIMEOUT (default 60s) only applies to esperanto's own httpx client. When Open Notebook uses a model through model.to_langchain(), which is the path for transformations, insights and chat, OllamaLanguageModel.to_langchain() builds a ChatOllama without a timeout. langchain_ollama then creates an ollama.Client with timeout=None, so a stalled Ollama request waits forever.
Two consequences:
- The FAQ entry suggesting
ESPERANTO_LLM_TIMEOUT=180for slow local models (docs/6-TROUBLESHOOTING/faq.md) has no effect on transformations or chat. - A hung Ollama call holds a worker slot (and the SSE connection for chat) indefinitely; the retry logic never gets a chance to run.
Surfaced while investigating #1264.
Where
- Upstream:
esperanto/providers/llm/ollama.py—to_langchain()(does not passclient_kwargs={"timeout": ...}) - Here:
open_notebook/ai/provision.py/open_notebook/domain/credential.pyif we want to pass a timeout from the credential config - Docs:
docs/6-TROUBLESHOOTING/faq.md
Open questions
- Fix upstream in esperanto (pass the configured timeout through
client_kwargs) or work around here by settingclient_kwargson the returnedChatOllama? - Should the timeout be a per-credential setting (like
num_ctx) or a global env var?
Acceptance criteria
- A transformation against an Ollama endpoint that never responds fails after the configured timeout instead of hanging.
- FAQ documents which setting actually governs the timeout for the LangChain path.
Source: lfnovo/open-notebook