LibreChat is one of the most popular open-source interfaces for AI chat. It is self-hosted, supports multiple users and feels like ChatGPT. You decide which models answer and where your data goes, and that is where LLMBase comes in. The OpenAI-compatible LLMBase Inference API lets you connect EU-hosted open-weight models to LibreChat. You do not need an OpenAI account, and your prompts do not have to go to the US.
This article shows you how to add LLMBase to LibreChat as a custom endpoint in a few minutes. It also covers what to check on the privacy side.
Why use LibreChat with LLMBase?
LibreChat is the interface, and LLMBase provides the models. Each part has a clear job:
- Your interface, your rules: LibreChat runs on your server. You control user accounts, sign-in, chat storage and which models people can use.
- EU hosting instead of a US cloud: LLMBase runs its Inference API in EU data centers. The model catalog shows which models are available and how each one is processed.
- Privacy from the start: Your data is not used for training. A DPA (data processing agreement) is available in the dashboard, and your contracting party is a German company.
- OpenAI-compatible: LibreChat uses the Chat Completions format, which is the interface LLMBase provides. You do not need a plugin or adapter.
- Pay-per-use: You pay only for the tokens your LibreChat users actually use. There is no per-seat fee.
Prerequisites
Before you connect LibreChat to LLMBase, you need:
- A running LibreChat installation, for example with Docker Compose as described in the official LibreChat documentation.
- An LLMBase inference API key starting with
llmbase_.... Create it in the dashboard under API keys. - At least one model ID from the current model catalog or from
GET https://api.llmbase.ai/v1/models.
Important: use an inference key (llmbase_...), not an llmbase_chat_... key. Chat agent keys belong to a separate endpoint and do not work in LibreChat.
Set up a LibreChat custom endpoint for LLMBase
LibreChat connects to OpenAI-compatible providers through custom endpoints in librechat.yaml. The setup takes three steps.
Step 1: Add the API key to .env
Store the key as an environment variable in the .env file of your LibreChat installation, not directly in the YAML file:
LLMBASE_API_KEY=llmbase_...
Do not commit .env to a repository or show the key in screenshots. Create a dedicated key for LibreChat so you can revoke it at any time without affecting other applications.
Step 2: Add LLMBase to librechat.yaml
Add an LLMBase entry under endpoints.custom. Keep the version and cache settings from your existing file:
endpoints:
custom:
- name: "LLMBase"
apiKey: "${LLMBASE_API_KEY}"
baseURL: "https://api.llmbase.ai/v1"
models:
default:
- "<model-id>"
fetch: true
titleConvo: true
titleModel: "current_model"
modelDisplayLabel: "LLMBase"
The key fields:
| Field | Value | Note |
|---|---|---|
name | LLMBase | The provider name shown in LibreChat’s model selector. |
apiKey | ${LLMBASE_API_KEY} | Points to the environment variable from step 1. |
baseURL | https://api.llmbase.ai/v1 | Include /v1. LibreChat adds /chat/completions itself. |
models.default | Your model IDs | Fallback list if fetching models fails. |
models.fetch | true | LibreChat loads available models from /v1/models. |
The base URL is the most common source of errors. LibreChat builds the endpoint by adding /chat/completions to baseURL, which gives you:
POST https://api.llmbase.ai/v1/chat/completions
So do not enter only https://api.llmbase.ai without /v1, and do not enter the full completions URL. The full URL only works if you deliberately set directEndpoint: true, which LLMBase does not need.
Step 3: Restart LibreChat
LibreChat reads librechat.yaml and .env at startup. For a Docker installation, a restart is enough:
docker compose down
docker compose up -d
Depending on your LibreChat version and setup, you may need to mount librechat.yaml into the container with docker-compose.override.yml. The LibreChat documentation on the configuration file explains how.
LLMBase then appears in the model selector. Choose a model and start a new chat.
Choosing models: fetch automatically or use a fixed list
With fetch: true, LibreChat gets the model list directly from LLMBase. This is the easiest option: new models from the catalog appear automatically, with no configuration changes.
If your organization should only use specific, reviewed models, use a fixed list instead:
models:
default:
- "<model-id-1>"
- "<model-id-2>"
fetch: false
Copy model IDs exactly from the model catalog or from the response of GET /v1/models. Do not copy IDs from old blog posts or other providers. Before you approve a model, check its context length, input types such as images, tool support and price in the catalog.
A quick curl test shows whether the key and base URL are correct:
curl https://api.llmbase.ai/v1/models \
-H "Authorization: Bearer $LLMBASE_API_KEY"
Privacy: what LibreChat and LLMBase each cover
A privacy-friendly setup has two layers:
LibreChat (your server): This is where user accounts, chat history and uploaded files are stored. You decide on storage location, access rights, backups and retention periods.
LLMBase (inference): This is where models process your prompts. LLMBase states publicly:
- EU hosting: Inference runs in EU data centers.
- No training on your data: Prompts and responses are not used to train models.
- GDPR and DPA: The data processing agreement is available in the dashboard.
- German contracting party: LLMBase is operated by a company based in Germany.
If your data must be processed only in Germany, the API with location Germany is available on request as a separate, optional offer. It is not the default for the standard API. See Data centers and location for details.
This article is not legal advice. Check your setup with your data protection officer and keep a record of the approved models.
Common errors and fixes
| Problem | Fix |
|---|---|
Missing API Key or 401 | Check that LLMBASE_API_KEY is in .env, starts with llmbase_, contains no spaces, and that the container has been restarted. |
404 when sending | baseURL must be exactly https://api.llmbase.ai/v1, without /chat/completions at the end. |
| No models in the selector | Add at least one valid model ID under models.default, or test /v1/models with curl. |
| LLMBase does not appear at all | librechat.yaml is not being loaded. Check the YAML indentation and how the file is mounted in Docker. |
400 for certain features | The selected model does not support a feature such as images or tools. Choose a suitable model in the catalog. |
FAQ: LibreChat with LLMBase
What is the difference between LibreChat and the ChatGPT interface?
ChatGPT is a hosted OpenAI service that uses OpenAI models. LibreChat is open source, runs on your own server and connects to any compatible API. With LLMBase, you use EU-hosted open-weight models in LibreChat while keeping control of the interface and your chat data.
Can I use my LLMBase chat subscription key in LibreChat?
No. LibreChat needs an inference API key (llmbase_...), which uses your prepaid inference balance. The LLMBase chat subscription and llmbase_chat_... keys are a separate product.
Does streaming work in LibreChat with LLMBase?
Yes. LibreChat streams responses by default, and the LLMBase Chat Completions API supports streaming. You do not need any extra settings.
Why does LibreChat show “Missing API Key”?
Usually the environment variable does not reach the container. Check that the name is the same in .env and librechat.yaml (LLMBASE_API_KEY), then fully restart LibreChat.
Is LibreChat with LLMBase GDPR-compliant?
LLMBase provides EU hosting, no training on your data and a DPA. As the operator, you are responsible for GDPR compliance of your whole setup, including how your LibreChat instance is hosted, who can access it and how long data is kept.
Connect LibreChat to LLMBase now
- Create an inference API key in the dashboard
- Choose a model in the model catalog
- Add the custom endpoint above to
librechat.yamland restart LibreChat
For technical details, see the OpenAI compatibility guide, the Chat Completions reference and how to use the OpenAI SDK with LLMBase. Current prices per model are on the European AI API page.
