Skip to content

feat: add env var support for custom endpoint default models#12661

Open
carbap wants to merge 1 commit into
danny-avila:devfrom
carbap:feat/custom-endpoint-models-default-env-var
Open

feat: add env var support for custom endpoint default models#12661
carbap wants to merge 1 commit into
danny-avila:devfrom
carbap:feat/custom-endpoint-models-default-env-var

Conversation

@carbap
Copy link
Copy Markdown

@carbap carbap commented Apr 14, 2026

Summary

Adds support for configuring the default models of custom endpoints via environment variables.

The models.default property can include ${ENV_VAR} references in addition to literal model names. If an env var resolves to a comma-separated string, it is automatically expanded into multiple model names.

Discussion: #12664
Documentation PR: LibreChat-AI/librechat.ai#592

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

Here is an example configuration:

librechat.yaml

endpoints:
 custom:
   - name: "Mistral"
     apiKey: "${MISTRAL_API_KEY}"
     baseURL: "${MISTRAL_BASE_URL}"
     models:
       default: ["${MISTRAL_MODEL}", "${MISTRAL_OTHER_MODELS}"]
       fetch: false
     modelDisplayLabel: "Mistral"
     dropParams: ["stop", "user", "frequency_penalty", "presence_penalty"]

.env

MISTRAL_MODEL=mistral-small-latest
MISTRAL_OTHER_MODELS=mistral-medium-latest,mistral-large-latest

Checklist

Please delete any irrelevant options.

  • I have made pertinent documentation changes
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • A pull request for updating the documentation has been submitted.

@carbap carbap force-pushed the feat/custom-endpoint-models-default-env-var branch from a5f3191 to a111cba Compare June 1, 2026 08:55
@carbap carbap changed the base branch from main to dev June 1, 2026 09:15
@carbap carbap marked this pull request as ready for review June 1, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant