Setup
The librechat.yaml file should be placed in the root of the project where the .env file is located.
You can copy the example config file as a good starting point while reading the rest of the guide.
The example config file has some options ready to go for Mistral AI, Groq and Openrouter.
Note: You can set an alternate filepath for the librechat.yaml file through an environment variable:
CONFIG_PATH="/alternative/path/to/librechat.yaml"Docker Setup
For Docker, you need to make use of an override file, named docker-compose.override.yml, to ensure the config file works for you.
- First, make sure your containers stop running with
docker compose down - Create or edit existing
docker-compose.override.ymlat the root of the project:
version: '3.4'
services:
api:
volumes:
- type: bind
source: ./librechat.yaml
target: /app/librechat.yaml-
Note: If you are using
CONFIG_PATHfor an alternative filepath for this file, make sure to specify it accordingly. -
Start docker again, and you should see your config file settings apply
docker compose upTroubleshooting
Server Exits Immediately on Startup
If your server exits immediately after starting with exit code 1, this is likely due to configuration validation errors in your librechat.yaml file.
To diagnose the issue:
-
Check the server logs for validation error messages:
View Docker logsdocker compose logs api -
Validate your YAML syntax using the YAML Validator or tools like yamlchecker.com
-
Common validation errors include:
- Invalid YAML syntax (incorrect indentation, missing colons, etc.)
- Unknown configuration keys or typos in property names
- Invalid values for specific configuration options
- Missing required fields
Temporary workaround:
If you need to start the server urgently while debugging configuration issues, you can bypass validation by setting:
CONFIG_BYPASS_VALIDATION=true