LibreChat
Use Cortecs models in a self-hosted LibreChat deployment
LibreChat is an open-source, self-hosted chat platform. Because Cortecs provides an OpenAI-compatible API, you can add Cortecs as a custom endpoint while keeping LibreChat as your chat interface.
1. Add your Cortecs API key
Add the following variable to the .env file used by the LibreChat API service:
CORTECS_API_KEY=your_cortecs_api_keyKeep the key in an environment variable. Do not add the key itself to librechat.yaml or commit it to source control.
2. Configure the Cortecs endpoint
Create or edit librechat.yaml in the LibreChat project root. Keep any existing top-level settings and add the Cortecs configuration below.
version: 1.3.13
cache: true
interface:
agents: false
modelSelect: false
endpoints:
custom:
- name: "Cortecs"
apiKey: "${CORTECS_API_KEY}"
baseURL: "https://api.cortecs.ai/v1"
models:
default:
- "<MODEL_ID>"
fetch: false
titleConvo: true
titleModel: "<MODEL_ID>"
modelDisplayLabel: "Cortecs"
modelSpecs:
prioritize: true
enforce: true
list:
- name: "cortecs-chat"
label: "Cortecs"
default: true
showOnLanding: true
preset:
endpoint: "Cortecs"
model: "<MODEL_ID>"Replace each <MODEL_ID> with the same exact ID from the model catalog.
Use https://api.cortecs.ai/v1 as the base URL. LibreChat appends /chat/completions when it sends a message, so do not include that path in baseURL.
The example creates a focused chat setup in which Cortecs is selected by default. If your LibreChat release requires a different configuration version, keep the version value from its librechat.example.yaml file.
3. Mount the configuration
For Docker Compose deployments, create or edit docker-compose.override.yml and mount the configuration into the API container:
For other deployment methods, follow LibreChat's custom configuration guide to make the file available to the API service.
4. Restart LibreChat
If the file was already mounted, restart the API service:
If you added the mount for the first time, recreate the containers:
Open LibreChat, sign in, and start a new conversation. Cortecs should appear as the selected model.
Troubleshooting
Cortecs or its models do not appear
Check that:
CORTECS_API_KEYis available inside the LibreChat API container.librechat.yamlis mounted at/app/librechat.yamlfor Docker deployments.The model ID exactly matches an ID from the model catalog.
LibreChat was restarted after the configuration changed.
Requests return 401 or 403
Confirm that the API key is valid and that the endpoint references it as apiKey: "${CORTECS_API_KEY}".
Requests return 404
Set baseURL to https://api.cortecs.ai/v1, not the full Chat Completions URL. Also verify the model ID.
Requests contain unsupported parameters
Custom endpoints use LibreChat's OpenAI parameter set. If an added parameter is not supported by the selected model, remove it and retry with only model and messages.
For more configuration options, see LibreChat's custom endpoints documentation and custom endpoint field reference.
Last updated