I wonder what the right approach is for using internal AI API endpoints (like LiteLLM) on self-hosted Discourse instances.
I tried enabling docker bridge, container IPs, and proper SSL-terminated endpoints (to the same public IP where Discourse is hosted), but nothing works. I allowed internal hosts, but I get a 500 error when testing on the LLM-AI UI within Discourse.
It’s probably related to my own configuration, and I know I probably made some mistakes. So, I hope to solve this with the help of the community
Our main use case is to try Vertex AI (OpenAI) endpoints that did not work out of the box on Discourse because they are not supported. But we also want the layer that LiteLLM adds to our workflow.
Logs:
FinalDestination::SSRFDetector::DisallowedIpError (FinalDestination: all resolved IPs were disallowed)
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:182:in 'DiscourseAi::Completions::Endpoints::Base#perform_completion!'
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/open_ai_shared.rb:28:in 'DiscourseAi::Completions::Endpoints::OpenAiShared#perform_completion!'
/var/www/discourse/plugins/discourse-ai/lib/completions/llm.rb:214:in 'DiscourseAi::Completions::Llm#generate'
pitchfork-0.18.2/lib/pitchfork/soft_timeout.rb:46:in 'Pitchfork::SoftTimeout::Request#interrupt'
pitchfork-0.18.2/lib/pitchfork/soft_timeout.rb:94:in 'block (2 levels) in Pitchfork::SoftTimeout#create_timeout_thread'
pitchfork-0.18.2/lib/pitchfork/soft_timeout.rb:93:in 'Array#each'
pitchfork-0.18.2/lib/pitchfork/soft_timeout.rb:93:in 'block in Pitchfork::SoftTimeout#create_timeout_thread'
It’s strange, and I’ve been trying to get it done for weeks.
Already tried this:
EDIT 1:DISCOURSE_ALLOWED_INTERNAL_HOSTS: 172.16.X.X(LiteLLM container IP, 127.0.0.1 and the SSL terminated LLM domain host I understand is not requested to be here)
EDIT 2: And I see the same 500 error when trying to enter to configure my MCP server (MCP discourse-ai tab configuration).