[GH-ISSUE #4808] [BUG]: LiteLLM Connection Error #3025

Closed
opened 2026-02-22 18:32:18 -05:00 by yindo · 3 comments
Owner

Originally created by @Ne0nd0g on GitHub (Dec 24, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4808

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

My issue is similar to #4691 and noticed it was closed without resolution. I've tried all of the options mentioned here and I'm still unable to get the models listed. I've tried:

I also noticed that despite putting my api key in every time, when I come back, that field is empty. For other providers, the secret field has dots indicating it has the password.

The backend logs show a connection error. How do I get more information to understand what the connection error is?

{"level":"info","message":"\u001b[32m[Event Logged]\u001b[0m - update_llm_provider","service":"backend"}
{"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"}
{"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"}
{"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"}
{"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"}
{"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"}

Are there known steps to reproduce?

Open Settings -> AI Providers: LLM -> Set LLM provider to LiteLLM -> Add API Key -> Add Base URL -> Save
Notice that Chat Model Selection never populates.
Exit from this menu and come back and see the API Key is no longer populated.

Originally created by @Ne0nd0g on GitHub (Dec 24, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4808 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? My issue is similar to #4691 and noticed it was closed without resolution. I've tried all of the options mentioned here and I'm still unable to get the models listed. I've tried: - https://my.internal.service:8080/v1 - https://my.internal.service:8080/v1/models - https://myinternal.service:8080/models I also noticed that despite putting my api key in every time, when I come back, that field is empty. For other providers, the secret field has dots indicating it has the password. The backend logs show a connection error. How do I get more information to understand what the connection error is? ``` {"level":"info","message":"\u001b[32m[Event Logged]\u001b[0m - update_llm_provider","service":"backend"} {"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"} {"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"} {"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"} {"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"} {"level":"error","message":"LiteLLM:listModels Connection error.","service":"backend"} ``` ### Are there known steps to reproduce? Open Settings -> AI Providers: LLM -> Set LLM provider to LiteLLM -> Add API Key -> Add Base URL -> Save Notice that Chat Model Selection never populates. Exit from this menu and come back and see the API Key is no longer populated.
yindo added the possible bug label 2026-02-22 18:32:18 -05:00
yindo closed this issue 2026-02-22 18:32:18 -05:00
Author
Owner

@Ne0nd0g commented on GitHub (Dec 24, 2025):

I don't think that models should be included in the Base URL. I temporarily sent the traffic over plain-text HTTP (the service doesn't actually listen on that protocol) and captured the HTTP traffic. If you include models in the URL you get: GET /v1/models/models HTTP/1.1

@Ne0nd0g commented on GitHub (Dec 24, 2025): I don't think that `models` should be included in the Base URL. I temporarily sent the traffic over plain-text HTTP (the service doesn't actually listen on that protocol) and captured the HTTP traffic. If you include `models` in the URL you get: `GET /v1/models/models HTTP/1.1`
Author
Owner

@Ne0nd0g commented on GitHub (Dec 24, 2025):

I executed a curl command with the exact same format and headers as the captured HTTP traffic of LiteLLM talking to LiteLLM, and it worked successfully. I'm still thinking the original connection error is more about the Certificate Authority and AnythingLLM not trusting my internal service's certificate.

@Ne0nd0g commented on GitHub (Dec 24, 2025): I executed a curl command with the exact same format and headers as the captured HTTP traffic of LiteLLM talking to LiteLLM, and it worked successfully. I'm still thinking the original connection error is more about the Certificate Authority and AnythingLLM not trusting my internal service's certificate.
Author
Owner

@Ne0nd0g commented on GitHub (Dec 24, 2025):

OK, got it resolved. I ran the following command to get NodeJS to use the custom Certificate Authority. I would be nice if this can be done inside of AnythingLLM and not have to set an environment variable.

launchctl setenv NODE_EXTRA_CA_CERTS /Users/me/Documents/my-custom-ca-chain.crt

Following this, relaunch AnythingLLM and it worked for me.

@Ne0nd0g commented on GitHub (Dec 24, 2025): OK, got it resolved. I ran the following command to get NodeJS to use the custom Certificate Authority. I would be nice if this can be done inside of AnythingLLM and not have to set an environment variable. `launchctl setenv NODE_EXTRA_CA_CERTS /Users/me/Documents/my-custom-ca-chain.crt` Following this, relaunch AnythingLLM and it worked for me.
yindo changed title from [BUG]: LiteLLM Connection Error to [GH-ISSUE #4808] [BUG]: LiteLLM Connection Error 2026-06-05 14:49:55 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3025