Replies: 1 comment
|
Thanks for pointing out the documentation mistake. We will update the docs. Unfortunately, not all langchain providers support the same set of environment variables. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello team! I wanted to share a troubleshooting experience and suggest a small update to the LLM Provider documentation to save other self-hosting users some debugging pain.
The Problem
I was configuring a local Ollama instance as the AI agent. I followed the official documentation and added the following to my
app.env:However, whenever I tried to use the AI chat in the SysReptor UI, I got a
500 Internal Error. The container logs showed:The Debugging Pain and root cause
Initially, I thought this was a Docker network or HTTP Proxy issue. I even ran a
wgetcommand from inside thesysreptor-appcontainer pointing to the Ollama container IP, and it worked perfectly. The container had network access, but the Python backend kept failing.The issue lies in how the underlying
langchain_ollamaand the officialollamaPython client handle environment variables. The Python library does not readOLLAMA_API_URL.Because the specific variable the library expects was missing, the client silently fell back to its default behavior: attempting to connect to
http://localhost:11434. Since SysReptor runs in its own isolated container, it was trying to find Ollama inside thesysreptor-appcontainer (localhost) instead of routing the traffic to my actual Ollama container/host. This resulted in the connection being immediately refused.The Solution
To fix this, you must pass the exact variables expected by the LangChain/Ollama Python client. Adding
OLLAMA_BASE_URL(andOLLAMA_HOSTjust to be completely safe) toapp.envinstantly resolved the issue:(Also, if using corporate proxies, making sure the Ollama hostname is added to
NO_PROXYandSYSREPTOR_NO_PROXYis highly recommended).Suggestion for the Docs
I recommend updating the [LLM Provider documentation] https://docs.sysreptor.com/setup/configuration/#llm-provider for Ollama to include this:
Thanks.... I spent almost 3 hours trying to understand the problem - lol
All reactions