How to use internal AI endpoints?

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 :slight_smile:

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)

If you are running it on the same server, you will need to allow it via DISCOURSE_ALLOWED_INTERNAL_HOSTS env variable.

I did it on UI like I saw on a previous similar post. Tried also with the variable on my app.yml file but still getting the error.

What can be wrong if my credentials are OK and I can use the API endpoint on the host? Can I debug more?

How exactly did you add it to the app.yml ? It expects either an IP or a hostname.