Custom endpoints defined in librechat.yaml are added to the model selection even if the ENDPOINTS configuration does not include "custom" #7634
Unanswered
jegraham-amplify
asked this question in
Troubleshooting
Replies: 1 comment 1 reply
|
I moved this to "Troubleshooting" because a possible solution has already been implemented. You can utilize the new Config: modelSpecs:
enforce: false
prioritize: true
addedEndpoints: ["agents"]
list:
- name: "Sonnet 3.7"
label: "Sonnet 3.7"
iconURL: "anthropic"
description: "Smart, Efficient Conversational AI"
default: false
preset:
endpoint: "OpenRouter"
model: "anthropic/claude-3.7-sonnet"
modelLabel: "Sonnet 3.7"Note, I am using OpenRouter for my model spec, and I have only allowed "Agents" to be another option. Furthermore, you could limit the providers available to agents, in case you didn't want your custom endpoint to be used with Agents (in this case, OpenRouter is not included): agents:
allowedProviders: ["openAI", "azureOpenAI", "anthropic", "google"]You could limit the model selections for your endpoints by defining them explicitly. More info: https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/agents#allowedproviders |
1 reply
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.
What happened?
Expected behavior
Per the documentation, the
ENDPOINTSenvironment variable is meant to customize the available endpoints in LibreChat. Ifcustomis not present in theENDPOINTSenvironment variable, I would expect that custom endpoints should not be loaded into the model selection dropdown.Actual behavior
If any custom endpoints are defined in the
librechat.yamlfile, they are loaded into the model selection dropdown even ifcustomis NOT present in theENDPOINTSenvironment variableWhy is this a problem?
It is easy to make the argument that "if you defined the custom endpoint, obviously you must want to make it available". However, this does not account for the case of using an LLM gateway.
In my organization, we only want a few models to be available on production, and with specific settings. To achieve this, we can use the
modelSpecsparameter in thelibrechat.yamlfile.We also use LiteLLM as a gateway. This means that we need to define a custom endpoint in the
librechat.yamlfile, so that the definitions inmodelSpecscan access the models.We do NOT want these endpoints to show outside of how we've defined them in
modelSpecs. We only want them to be available in the specific way that we've defined them. Our environment file hasENDPOINTS=agents- we want to include agents in the model selection list, but we do NOT want to include the endpoint that we defined (remember, we only defined it so that we could use it withmodelSpecs).Technical details
api / server / services / Config / getEndpointsConfig.js > getEndpointsConfig- line 19 (at the time of writing this) loads the custom endpoints REGARDLESS of whethercustomis included in theENDPOINTSenvironment variable.Suggested fix
Only load call
loadConfigEndpointsifcustomis present in theENDPOINTSenvironment variable configuration.Current code:
Potential fix:
NOTE: While this does work, it results in
getEnabledEndpoints()being called twice (it is already called once inloadDefaultEndpointsConfig). A more elegant solution may be to updateloadDefaultEndpointsConfigto either take in the list of enabled endpoints, or perhaps to includecustomin its returned values ifcustomis present in theENDPOINTSenvironment variable.Version Information
The last source commit we have in our mirror-pushed repository is commit c4f1da2, related to PR #6687. However, I have verified that the
mainbranch of the LibreChat repository still contains the problematic code.Steps to Reproduce
ENDPOINTSvariable with a value that does not includecustom.librechat.yamlfile, define a custom endpoint.What browsers are you seeing the problem on?
No response
Relevant log output
Screenshots
.env file:

librechat.yaml (individual. model specs collapsed for the sake of a smaller screenshot):

UI:

Code of Conduct
All reactions