### [LibreChat](https://github.com/danny-avila/LibreChat)

> Handle: `librechat`<br/>
> URL: [http://localhost:33891](http://localhost:33891)

<p align="center">
  <a href="https://librechat.ai">
    <img src="https://raw.githubusercontent.com/danny-avila/LibreChat/main/client/public/assets/logo.svg" height="256">
  </a>
</p>

<p align="center">
  <a href="https://discord.librechat.ai">
    <img
      src="https://img.shields.io/discord/1086345563026489514?label=&logo=discord&style=for-the-badge&logoWidth=20&logoColor=white&labelColor=000000&color=blueviolet">
  </a>
  <a href="https://www.youtube.com/@LibreChat">
    <img
      src="https://img.shields.io/badge/YOUTUBE-red.svg?style=for-the-badge&logo=youtube&logoColor=white&labelColor=000000&logoWidth=20">
  </a>
  <a href="https://docs.librechat.ai">
    <img
      src="https://img.shields.io/badge/DOCS-blue.svg?style=for-the-badge&logo=read-the-docs&logoColor=white&labelColor=000000&logoWidth=20">
  </a>
  <a aria-label="Sponsors" href="https://github.com/sponsors/danny-avila">
    <img
      src="https://img.shields.io/badge/SPONSORS-brightgreen.svg?style=for-the-badge&logo=github-sponsors&logoColor=white&labelColor=000000&logoWidth=20">
  </a>
</p>

Enhanced ChatGPT Clone: Features OpenAI, Assistants API, Azure, Groq, GPT-4 Vision, Mistral, Bing, Anthropic, OpenRouter, Vertex AI, Gemini, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. More features in development.

#### Starting

```bash
# Will start librechat alongside
# the default webui
harbor up librechat
```

If you want to make LibreChat your default UI, please see the information below:
```bash
# Replace the default webui with librechat
# afterwards, you can just run `harbor up`
harbor defaults rm webui
harbor defaults add librechat

# You'll also want to set librechat as a main UI
harbor config set ui.main librechat

# That'll allow you to open the librechat
# directly with
harbor open
harbor qr
harbor tunnel
```

#### Integrations

`librechat` is a full-stack chat UI (with MongoDB, Meilisearch, pgvector, and a RAG API sidecar) that is pre-configured to talk to several local Harbor backends and a wide range of external providers out of the box. No manual endpoint setup is required for the built-in ones.

**Pre-configured local backends**

The `endpoints.custom` section in the mounted `services/librechat/librechat.yml` (merged at startup via the yaml config merger) defines ready-to-use providers:

- **Ollama** — points at `${HARBOR_OLLAMA_INTERNAL_URL}/v1/chat/completions`; dynamically fetches models when `ollama` is running alongside.
- **SGLang** — points at `http://sglang:30000/v1`; appears automatically when `sglang` is started together with librechat.
- **Boost** — points at `http://boost:8000/v1`; appears automatically when `boost` is started together with librechat.

**External providers (key-injected)**

The base `compose.librechat.yml` injects many `HARBOR_*_KEY` / `HARBOR_*_TOKEN` environment variables (Anyscale, Groq, Fireworks, Mistral, OpenRouter, Perplexity, Together.ai, Cohere, Anthropic, Google, OpenAI, etc.) into the container. These power the corresponding pre-defined endpoints in the config (with fallbacks to `user_provided`).

**RAG and vector store**

- `librechat-rag` (always started as a dependency) is hardcoded to use `ollama` for embeddings (`EMBEDDINGS_PROVIDER=ollama`, `OLLAMA_BASE_URL=${HARBOR_OLLAMA_INTERNAL_URL}`, model `mxbai-embed-large`).
- Embeddings live in the `librechat-vector` (pgvector) instance.
- Message/search indexing uses the `librechat-search` (Meilisearch) instance.
- All supporting services (`librechat-db`, `librechat-search`, `librechat-vector`, `librechat-rag`) are brought up via `depends_on` and wired over the `harbor-network`.

**Reverse proxy / external access**

- With `traefik` present: `compose.x.traefik.librechat.yml` adds labels so the UI is reachable at `https://librechat.${HARBOR_TRAEFIK_DOMAIN}` (websecure entrypoint).

**UI replacement**

- LibreChat can replace the default `webui` entirely (see the "Starting" section for the `harbor defaults` + `harbor config set ui.main librechat` flow). After that, `harbor open`, `harbor qr`, and `harbor tunnel` target LibreChat.

**Host / volume interactions**

- **Persistent user data & chats**: `./services/librechat/data` (host) ↔ `/data/db` (inside librechat-db mongo container).
- **Search index**: `./services/librechat/meili_data_v1.12` ↔ `/meili_data`.
- **Vector embeddings (RAG)**: `./services/librechat/vectordb` ↔ `/var/lib/postgresql/data`.
- **Custom branding / assets**: `./services/librechat/images` ↔ `/app/client/public/images`.
- Config, secrets, and startup script (`librechat.yml`, `.env`, `override.env`, `start_librechat.sh`) live under `./services/librechat/` on the host and are bind-mounted. The custom entrypoint runs the yaml merger over all `*.yml` files in `/app/configs` (arrays such as `custom` endpoints are concatenated), allowing users to drop extra endpoint definitions without touching the base file.

This wiring means that starting `harbor up librechat ollama sglang boost` (for example) immediately surfaces all three local providers inside the LibreChat UI with working chat, title generation, and RAG capabilities.

#### Configuration

LibreChat comes with a lot of features and settings that can be adjusted to your liking. Harbor will keep all the relevant files in the `librechat` folder of the workspace.

- [Official Configuration reference](https://www.librechat.ai/docs/configuration)
- [`services/librechat/librechat.yml`](https://github.com/av/harbor/blob/main/services/librechat/librechat.yml) - main configuration file
- [`services/librechat/override.env`](https://github.com/av/harbor/blob/main/services/librechat/override.env) - service-specific environment variable overrides
