Guides

LibreChat with EU-hosted AI models: a GDPR-friendly setup with the LLMBase API

Self-host LibreChat and use EU-hosted open-weight models: custom endpoint in librechat.yaml, API key, model ID and privacy, with no OpenAI account required.

Guides

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:

  1. A running LibreChat installation, for example with Docker Compose as described in the official LibreChat documentation.
  2. An LLMBase inference API key starting with llmbase_.... Create it in the dashboard under API keys.
  3. 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:

FieldValueNote
nameLLMBaseThe provider name shown in LibreChat’s model selector.
apiKey${LLMBASE_API_KEY}Points to the environment variable from step 1.
baseURLhttps://api.llmbase.ai/v1Include /v1. LibreChat adds /chat/completions itself.
models.defaultYour model IDsFallback list if fetching models fails.
models.fetchtrueLibreChat 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

ProblemFix
Missing API Key or 401Check that LLMBASE_API_KEY is in .env, starts with llmbase_, contains no spaces, and that the container has been restarted.
404 when sendingbaseURL must be exactly https://api.llmbase.ai/v1, without /chat/completions at the end.
No models in the selectorAdd at least one valid model ID under models.default, or test /v1/models with curl.
LLMBase does not appear at alllibrechat.yaml is not being loaded. Check the YAML indentation and how the file is mounted in Docker.
400 for certain featuresThe 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

  1. Create an inference API key in the dashboard
  2. Choose a model in the model catalog
  3. Add the custom endpoint above to librechat.yaml and 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.

All guides