
Sovereign AI
LibreChat vs Open WebUI: Choosing the Chat Layer You Run
LibreChat vs Open WebUI, with AnythingLLM as a third option: SSO, RBAC, RAG, MCP, the branding clause, and what each one stores about every chat.
Most comparisons of these tools are feature tables, and several still describe Open WebUI's licence wrongly. This one reads the primary documentation for the three questions a platform or security lead will be asked after launch: where does the chat text land, who can see it, and what does leaving cost.
The chat layer is where the conversations live
A self-hosted AI stack has four layers. At the bottom is a model runtime such as Ollama, vLLM or llama.cpp, compared in Stribog's LM Studio vs Ollama vs llama.cpp and vLLM vs Ollama analyses. Above it may sit a gateway that routes requests and holds keys, the subject of LiteLLM alternatives. Above that is the chat application people actually open in a browser, and above that the identity provider that tells the application who they are.
The runtime is stateless about people: it sees a prompt, produces tokens and forgets. The chat layer is the opposite. It authenticates every user, keeps every prompt and answer, stores every uploaded file, embeds those files into a vector store, and decides which tools the model may call. If keeping inference on your own hardware was the point, the chat layer is where that promise is either kept or quietly broken.
So the selection criteria here are storage, identity, retention and exit. Version references are dated as of 3 December 2026: Open WebUI v0.13.5 (published 25 November 2026), LibreChat v0.8.9 (published 17 November 2026, though GitHub marks it as a prerelease) and AnythingLLM v1.20.0 (published 17 November 2026). All three ship often, so re-check any setting below against the current documentation before you rely on it.
Three architectures: one process, a service set, a workspace app
Open WebUI is one container. Authentication, role-based access control, retrieval, tool calling and the interface all live in a single Python process. Its database defaults to SQLite at sqlite:///${DATA_DIR}/webui.db; DATABASE_URL switches it to Postgres, and the documentation warns that changing the URL does not migrate existing data. Pick the database on day one. Retrieval uses VECTOR_DB, which defaults to chroma, or pgvector on the slim image. The default Chroma is embedded, keeping its data in local SQLite files that only one process may write, and the docs state plainly that it is not safe for multi-replica deployments. The alternatives include pgvector, Qdrant, Milvus, OpenSearch, Elasticsearch and Weaviate.
LibreChat is a set of services. MongoDB is required: it holds users, conversations, messages and settings. Document retrieval runs in a separate FastAPI service, the RAG API, backed by PostgreSQL with pgvector, which is optional if you do not need file search. The project's default docker-compose.yml starts MongoDB 8.0, Meilisearch for chat search, a pgvector database and the RAG API alongside the app. Two details in that file matter before production: MongoDB is started with --noauth, and the app and RAG images are pulled as :latest. Both are fine on a laptop and wrong on a shared server.
AnythingLLM is a single container organised around workspaces. It keeps its state under STORAGE_DIR (/app/server/storage in the Docker template) and ships a built-in vector database powered by LanceDB, so by default vectors never leave the instance. It has the fewest moving parts of the three and the thinnest access model, which is the trade.
Identity: SSO, groups and who becomes admin
All three should sit behind your own identity provider. Stribog's comparison of Keycloak, Authentik and Zitadel covers that layer; what matters here is how each chat app consumes it.
Open WebUI
Open WebUI has a full OAuth/OIDC section. OAUTH_AUTO_REDIRECT, default False, sends unauthenticated visitors straight to the provider, and fires only when it is true, exactly one provider is configured and ENABLE_LOGIN_FORM is False; otherwise users see a Continue with SSO button. ENABLE_OAUTH_GROUP_MANAGEMENT and ENABLE_OAUTH_GROUP_CREATION, both off by default, map groups from token claims and create missing ones. SCIM 2.0 endpoints at /api/v1/scim/v2 let the identity provider create, update and deactivate users and groups, and the docs state this is included in the free edition with no licence key and no user limit. Deprovisioning then happens in one place.
Two settings deserve care. OAUTH_MERGE_ACCOUNTS_BY_EMAIL defaults to False, and the docs call enabling it unsafe because not all providers verify email addresses, which can lead to account takeover. Leave it off. And ENABLE_PERSISTENT_CONFIG defaults to True, which means values saved in the admin UI override environment variables. If your deployment file is meant to be the source of truth, set it to False, or an admin's click will silently win over your reviewed configuration; even then, UI edits apply until the next restart. Authorisation is additive: a user holds the union of rights from roles and groups, and the RBAC page notes it does not replace least-privilege credentials for the providers behind it.
LibreChat
LibreChat's OpenID settings live in .env. OPENID_REQUIRED_ROLE accepts one role or a comma-separated list with OR logic: a user needs any one of them to sign in. OPENID_ADMIN_ROLE names the role that makes someone a LibreChat admin. Generic role sync (OPENID_ROLE_SYNC_ENABLED, off by default) handles non-admin roles and cannot assign ADMIN, so elevation always goes through the dedicated variable. That is a sensible separation: the claim that grants admin is named explicitly, not inferred.
# LibreChat .env: OIDC sign-in, email login off. Values are placeholders.
OPENID_ISSUER=https://id.example.com/realms/internal
OPENID_CLIENT_ID=librechat
OPENID_CLIENT_SECRET=replace-me
OPENID_SESSION_SECRET=replace-me-too
OPENID_CALLBACK_URL=/oauth/openid/callback
OPENID_SCOPE="openid profile email"
OPENID_REQUIRED_ROLE=chat-user,chat-admin
OPENID_REQUIRED_ROLE_TOKEN_KIND=access
OPENID_REQUIRED_ROLE_PARAMETER_PATH="realm_access.roles"
OPENID_ADMIN_ROLE=chat-admin
OPENID_ADMIN_ROLE_TOKEN_KIND=access
OPENID_ADMIN_ROLE_PARAMETER_PATH="realm_access.roles"
ALLOW_SOCIAL_LOGIN=true
ALLOW_EMAIL_LOGIN=false
ALLOW_REGISTRATION=falseAnythingLLM
AnythingLLM starts in single-user mode, where anyone with the instance password can use it, change any setting and view all chats. Multi-user mode adds three roles: Admin has full access, Manager can see all workspaces and manage everything except the LLM, embedder and vector database settings, and Default users can only chat in workspaces they are explicitly added to. For external identity, the Docker template offers a "simple SSO passthrough" (SIMPLE_SSO_ENABLED), where another service asks AnythingLLM to issue a per-user login link, valid ten minutes and single use; it is not OIDC and not an inbound token exchange. As of December 2026 the Docker environment template documents no OIDC or SAML settings beyond it. If your policy requires sign-in through your IdP with group-based access, plan to put an authenticating proxy in front or choose one of the other two.
What each one stores about every conversation
Open WebUI documents this with unusual candour. Chat titles are stored as plain text and chat content as plain JSON in the database. Uploaded files sit unencrypted under DATA_DIR/uploads or the configured object store. Document chunks are plain text in the vector store by default; pgvector can encrypt chunk text with PGVECTOR_PGCRYPTO=true, which then requires PGVECTOR_PGCRYPTO_KEY. That flag does not touch chat rows or uploads. WEBUI_SECRET_KEY signs sessions and encrypts stored OAuth tokens and secrets; it does not encrypt chat data. SQLCipher is not supported, so a SQLite deployment needs an encrypted filesystem such as LUKS. One path is different: encrypted chats in direct messages and private groups are end-to-end encrypted in the browser and never stored on the server. That covers users messaging each other, not users talking to a model.
The schema makes it concrete. The chat_message table holds one row per message, with columns for content, model_id, attached files, retrieval sources and token usage. The shared_chat table keeps a JSON snapshot of a chat at the moment it was shared. Note the naming trap: the table called message holds channel traffic, not chat transcripts.
On access, ENABLE_ADMIN_CHAT_ACCESS defaults to True. An admin can then open any user's chat, read-only in the interface, while the API also lets that admin edit or delete messages, delete the chat and change its sharing. Setting it and ENABLE_ADMIN_EXPORT to false hides chats and exports in the interface only. Open WebUI's privacy page says to treat every admin as able to read every chat, because an admin can still reach the data, for example by installing a function or tool that runs code on the server. Apply the same assumption to all three tools: whoever operates the database can read whatever it stores unencrypted.
LibreChat keeps users, conversations and messages in MongoDB, and Meilisearch holds a search index of them, so the index is part of the chat record and belongs in the same backup, access and retention scope. File embeddings go to pgvector through the RAG API. Treat at-rest protection as the operator's job here too: encrypt the MongoDB, Meilisearch and pgvector volumes. AnythingLLM's single-user caveat above is the storage caveat too: in that mode the instance password is the only boundary around every chat. Its DISABLE_VIEW_CHAT_HISTORY setting hides the admin history browser, the administrator included, and embed-widget history; users still see their own chats, API keys can still read histories, and nothing is deleted. It also collects anonymous telemetry, which you can switch off in its settings.
An auditor's first question is what the system holds right now. This inventory answers it for the two database-backed tools:
#!/usr/bin/env bash
# What does the chat layer hold right now? Read-only queries.
set -euo pipefail
# Open WebUI on Postgres: chats, and messages per model.
psql "$OPENWEBUI_DATABASE_URL" -c "SELECT count(*) AS chats FROM chat;"
psql "$OPENWEBUI_DATABASE_URL" -c \
"SELECT model_id, count(*) AS messages
FROM chat_message
GROUP BY model_id
ORDER BY messages DESC;"
# LibreChat on MongoDB: conversations with and without a deletion deadline.
mongosh "$LIBRECHAT_MONGO_URI" --quiet --eval '
printjson({
withDeadline: db.conversations.countDocuments({ expiredAt: { $ne: null } }),
noDeadline: db.conversations.countDocuments({ expiredAt: null }),
messages: db.messages.countDocuments({})
})'Retention and deletion: the axis an auditor asks about
LibreChat's retention is configured under interface in librechat.yaml with retentionMode. The default, temporary, expires only chats a user marks as temporary. all gives every conversation and message a deadline while keeping chats visible in history until they expire. ephemeral makes every chat temporary for the whole deployment, and the server enforces it: a client asking to save a chat as permanent is overridden. Periods are set in hours, from 1 to 8760, with a default of 720.
The mechanism is a MongoDB TTL index on expiredAt, which removes conversations, messages and shared links, usually within about a minute of the deadline. Read the edges first. Each save of a conversation moves its deadline forward, so a chat in active use is not deleted, but each message keeps the deadline it got when it was saved. Files are removed by a separate periodic sweep in LibreChat. Memories have no expiry under any mode. Changing the mode or period only affects records saved afterwards; existing deadlines are not rewritten.
version: 1.3.19
interface:
retentionMode: 'all'
generalChatRetention: 2160 # 90 days from each save
temporaryChatRetention: 24 # chats users mark temporary
endpoints:
custom:
- name: 'vLLM'
apiKey: '${VLLM_API_KEY}'
baseURL: 'http://vllm.internal:8000/v1'
models:
default: ['google/gemma-3-27b-it']
fetch: true
titleConvo: true
titleModel: 'current_model'
titleMessageRole: 'user'
mcpServers:
docs-search:
type: streamable-http
url: https://mcp.internal.example/mcp
timeout: 60000Open WebUI's documented lever is Temporary Chat. USER_PERMISSIONS_CHAT_TEMPORARY_ENFORCED=true makes every chat a non-admin user starts temporary; for users who also hold USER_PERMISSIONS_CHAT_TEMPORARY, the server refuses to save a chat on every route, including the API, import, clone and fork. Administrators are exempt, and chats that already exist stay. As of 3 December 2026, the environment reference documents no time-based retention period for saved chats, so "delete after 90 days" is a scheduled job you write and evidence yourself. AnythingLLM's JWT_EXPIRY is a session lifetime, not chat retention, and its configuration documentation describes no chat-content retention setting.
None of these is a deletion certificate. A TTL index is a good mechanism, and what an auditor wants is the policy, the configuration that enforces it, and a recurring query showing nothing older than the deadline survives, including in backups and the search index. Stribog's records retention analysis covers how to evidence that.
RAG, files and MCP tools
Open WebUI has retrieval built in, with the vector store selected by VECTOR_DB, and has supported MCP natively since v0.6.31, configured as an external tool server of type MCP (Streamable HTTP). Its MCP documentation adds an operational trap: WEBUI_SECRET_KEY must be set explicitly, or OAuth-connected MCP tools break on every container restart with "Error decrypting tokens". LibreChat retrieves through the RAG API on pgvector and configures tools under mcpServers in librechat.yaml; servers can be attached to a regular chat or their tools added to an agent. AnythingLLM retrieves per workspace from LanceDB and supports MCP tools for its agents.
Treat tool configuration as a privilege boundary, because a tool runs with the server's network position and credentials. LibreChat draws that line in code: MCP servers using type: stdio, or process fields such as command, args and env, must be configured in librechat.yaml, and the admin configuration API rejects them. Spawning processes on the host is a change to a reviewed file, not a click. On Open WebUI, Tools and Functions run code on the server, which is exactly why its privacy guidance keeps them restricted to trusted admins. Route model traffic through one gateway as well; LiteLLM as an MCP gateway shows how that centralises keys and residency.
Licence, governance and the exit ramp
Open WebUI's licence is the part most often misreported. Clause 4 of its LICENSE file prohibits altering, removing, obscuring or replacing any "Open WebUI" branding in any deployment or distribution, with three exceptions:
(i) deployments or distributions where the total number of end users (defined as individual natural persons with direct access to the application) does not exceed fifty (50) within any rolling thirty (30) day period; (ii) the licensee has obtained specific prior written permission from the copyright holder; or (iii) where the licensee has obtained a duly executed enterprise license expressly permitting such modification.
Read precisely, this restricts rebranding, not use. The licence page says organisations can use Open WebUI internally at any scale with the original branding. The 50-person rolling window is not a seat cap. It applies only if you want to rename or restyle the product. The clause took effect with v0.6.6, dated 19 April 2025 on the licence page; code up to and including v0.6.5 remains BSD-3-Clause, and the project itself points to forking from v0.6.5 as the path with zero restrictions. Open WebUI states that the v0.6.6+ licence is not OSI-approved, and new contributions after v0.6.5 require a CLA. For a sovereignty test, that combination matters more than the branding itself: a project that has changed its terms once, and now takes contributions under a CLA, is one whose terms you should expect to reread.
LibreChat and AnythingLLM are both MIT-licensed. LibreChat's governance changed in a different way: on 4 November 2025, ClickHouse announced it had acquired LibreChat, bringing founder Danny Avila and his team in-house, and said existing deployments continue unchanged with ongoing investment in the open-source project. Code already released under MIT stays usable under MIT whatever happens next, which is the property that makes an acquisition a watch item rather than a risk.
If you choose Open WebUI, make the compose file the reviewed source of truth:
services:
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: openwebui
POSTGRES_USER: openwebui
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql/data
open-webui:
image: ghcr.io/open-webui/open-webui:v0.13.5
restart: unless-stopped
depends_on: [db]
ports:
- "127.0.0.1:3000:8080"
environment:
DATABASE_URL: postgresql://openwebui:${POSTGRES_PASSWORD}@db:5432/openwebui
VECTOR_DB: pgvector
PGVECTOR_DB_URL: postgresql://openwebui:${POSTGRES_PASSWORD}@db:5432/openwebui
WEBUI_SECRET_KEY: ${WEBUI_SECRET_KEY}
WEBUI_URL: https://chat.example.com
ENABLE_PERSISTENT_CONFIG: "false"
ENABLE_ADMIN_CHAT_ACCESS: "false"
ENABLE_ADMIN_EXPORT: "false"
ENABLE_OAUTH_SIGNUP: "true"
OAUTH_MERGE_ACCOUNTS_BY_EMAIL: "false"
ENABLE_LOGIN_FORM: "false"
OPENID_PROVIDER_URL: https://id.example.com/.well-known/openid-configuration
OAUTH_PROVIDER_NAME: Company SSO
OAUTH_CLIENT_ID: open-webui
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET}
ENABLE_OAUTH_GROUP_MANAGEMENT: "true"
ENABLE_OLLAMA_API: "false"
OPENAI_API_BASE_URL: http://gateway.internal:4000/v1
OPENAI_API_KEY: ${GATEWAY_KEY}
volumes:
- openwebui-data:/app/backend/data
volumes:
pgdata:
openwebui-data:Leaving is cheap only if you design for it. Identities stay in your IdP, so users and groups move with configuration, not migration. Plan to re-ingest and re-embed documents rather than copy vectors between tools, since each one chunks and indexes on its own terms. Conversation history is the hard part, because each tool's schema is its own; decide early whether history must move at all, or whether a retention policy means there is little to move. Keep every app speaking to an OpenAI-compatible gateway, never to a runtime directly, and the runtime stays swappable whichever chat layer sits on top.
Choosing for the long game
- Choose Open WebUI when one team wants a single integrated image with RAG, SCIM provisioning and MCP built in, keeps the original branding, and accepts that admins can read chats. Start on Postgres, set
ENABLE_PERSISTENT_CONFIG=false, and own retention as a scheduled job. - Choose LibreChat when a documented, server-enforced retention policy, an MIT licence or routing across many providers decides it, and the team can operate MongoDB with authentication on, Meilisearch and the RAG API.
- Choose AnythingLLM for a small, workspace-scoped group in multi-user mode where the lightest operational footprint matters more than OIDC and group mapping.
- In every case, run separate instances per trust boundary, put an OpenAI-compatible gateway between the app and the runtime, and keep the deployment file, not the admin UI, as the source of truth.
The interface is what users judge on day one. The stores behind it are what an auditor, a successor team and a regulator will judge in year five. Choose the chat layer whose storage, retention and licence you can explain in a sentence each, and keep the layers below it portable enough that this decision never has to be the permanent one.
§FAQ/Common questions
Frequently asked
What is the main difference between LibreChat and Open WebUI?
Architecture, retention and licence. Open WebUI is one container with built-in RAG, RBAC, SCIM and MCP, on SQLite or Postgres. LibreChat is MIT-licensed and runs as a set of services around MongoDB, Meilisearch and a pgvector RAG API, and documents deployment-wide chat retention enforced by a MongoDB TTL index.
Do I need an enterprise licence to run Open WebUI for more than 50 users?
Not to use it. Clause 4 of the licence restricts altering or removing the Open WebUI branding unless the deployment has no more than 50 end users in any rolling 30-day period, you have written permission, or you hold an enterprise licence permitting it. The licence page says organisations can use it internally at any scale with the original branding.
Can Open WebUI admins read users' chats?
Yes. ENABLE_ADMIN_CHAT_ACCESS defaults to True, and Open WebUI's privacy documentation says to treat every admin as able to read every chat, because disabling admin chat access and export only hides them in the interface. Chat content is stored as plain JSON in the database, so at-rest protection comes from the database, volume or storage layer.
How does LibreChat delete old chats?
Set interface.retentionMode in librechat.yaml to all or ephemeral. Conversations, messages and shared links get an expiredAt deadline and are removed by a MongoDB TTL index, usually within about a minute of it; files go through a separate periodic sweep. Periods run from 1 to 8760 hours, default 720, and each save of a conversation moves its deadline forward, while each message keeps the deadline from when it was saved.
What are the main Open WebUI alternatives for local models?
LibreChat and AnythingLLM are the two self-hosted alternatives compared here, both MIT-licensed. LibreChat suits multi-user deployments that need OIDC roles and enforced retention; AnythingLLM suits smaller workspace-scoped groups. All three can talk to Ollama, vLLM or an OpenAI-compatible gateway.
Further reading
- LM Studio vs Ollama vs llama.cpp: One Engine, Two Wrappers
- vLLM vs Ollama: Run Both, and Draw the Concurrency Line
- LiteLLM Alternatives: Where Your LLM Gateway Should Live
- LiteLLM as an MCP Gateway: Sovereign AI Data Residency
- Keycloak vs Authentik vs Zitadel: Self-Hosted SSO After Okta
- Records Retention Policy: Delete the Data or Destroy the Key
- Langfuse vs LangSmith: Where Your Prompts and Traces Live
Executive Briefing
Thirty minutes to clarify your infrastructure risk
Walk us through your vendor footprint and regulatory constraints. We will tell you honestly where sovereignty creates leverage — and where it does not. No pitch deck. No obligation.