From 6cef7ad79f8d4b83631cd74f34b20dc934858eb8 Mon Sep 17 00:00:00 2001 From: "stephane.david" Date: Sat, 12 Sep 2026 17:46:10 +0200 Subject: [PATCH] First version --- .env | 1438 ++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 120 ++++ librechat.yaml | 1352 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2910 insertions(+) create mode 100644 .env create mode 100644 docker-compose.yml create mode 100644 librechat.yaml diff --git a/.env b/.env new file mode 100644 index 0000000..8be8d0a --- /dev/null +++ b/.env @@ -0,0 +1,1438 @@ +#=====================================================================# +# LibreChat Configuration # +#=====================================================================# +# Please refer to the reference documentation for assistance # +# with configuring your LibreChat environment. # +# # +# https://www.librechat.ai/docs/configuration/dotenv # +#=====================================================================# + +#==================================================# +# Server Configuration # +#==================================================# + +HOST=localhost +PORT=3080 + +# Optional Node.js HTTP server timeouts in milliseconds. When unset, Node.js defaults apply. +# For an ALB, set the application keep-alive timeout above the ALB idle timeout. +# Requires Node.js: Bun accepts these values but does not enforce them. +# Header and request timeout expiry is only detected on a 30s connection sweep, so values +# below 30000 take effect late and are not enforced at the precision configured. +# The header timeout is clamped to the request timeout when the latter is lower, since Node +# does not enforce a request timeout that a longer header timeout sits above. +# Keep-alive is socket-driven and remains exact at any value. +# HTTP_KEEP_ALIVE_TIMEOUT_MS=70000 +# HTTP_KEEP_ALIVE_TIMEOUT_BUFFER_MS=5000 +# HTTP_HEADERS_TIMEOUT_MS=80000 +# HTTP_REQUEST_TIMEOUT_MS=300000 + +MONGO_URI=mongodb://127.0.0.1:27017/LibreChat +#The maximum number of connections in the connection pool. */ +MONGO_MAX_POOL_SIZE= +#The minimum number of connections in the connection pool. */ +MONGO_MIN_POOL_SIZE= +#The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ +MONGO_MAX_CONNECTING= +#The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. */ +MONGO_MAX_IDLE_TIME_MS= +#The maximum time in milliseconds that a thread can wait for a connection to become available. */ +MONGO_WAIT_QUEUE_TIMEOUT_MS= +# Set to false to disable automatic index creation for all models associated with this connection. +# Leave empty (unset) to use Mongoose's default — an empty value is not treated as false. */ +MONGO_AUTO_INDEX= +# Set to `false` to disable Mongoose automatically calling `createCollection()` on every model created on this connection. +# Leave empty (unset) to use Mongoose's default — an empty value is not treated as false. */ +MONGO_AUTO_CREATE= + +DOMAIN_CLIENT=http://localhost:3080 +DOMAIN_SERVER=http://localhost:3080 + +# External admin panel base URL used for admin OAuth/SSO redirects. +# When set, admins also get an Admin Panel link in Settings > General. +# Required when the admin panel is hosted separately from LibreChat. +# May include a path. Do not include a trailing slash. +# Example: https://admin.example.com/admin +ADMIN_PANEL_URL= + +# Session encryption key for the bundled admin panel (min 32 characters). +# Required when using the bundled admin panel in docker-compose/deploy-compose. +# Generate a unique value before starting the stack: +# openssl rand -hex 32 +ADMIN_PANEL_SESSION_SECRET= + +# Host port for the bundled admin panel (default docker-compose only). +# In deploy-compose the panel is served at http://admin.localhost via nginx. +# ADMIN_PANEL_PORT=3000 + +# Enable the admin-only MongoDB Insights dashboard. +ENABLE_INSIGHTS=false + +NO_INDEX=true +# Use the address that is at most n number of hops away from the Express application. +# req.socket.remoteAddress is the first hop, and the rest are looked for in the X-Forwarded-For header from right to left. +# A value of 0 means that the first untrusted address would be req.socket.remoteAddress, i.e. there is no reverse proxy. +# Defaulted to 1. +TRUST_PROXY=1 + +#===============================# +# Security Headers # +#===============================# + +# Baseline HTTP security headers (HSTS, X-Frame-Options, X-Content-Type-Options, +# COOP, CORP, Referrer-Policy) are sent on every response. Content-Security-Policy +# is never set here. Set to false to send no security headers at all. +# SECURITY_HEADERS=true + +# Strict-Transport-Security. Only meaningful over HTTPS; browsers ignore it on +# plain HTTP. HSTS_INCLUDE_SUBDOMAINS applies the policy to every subdomain of +# this host for the full max-age, so enable it only if all of them serve HTTPS. +# HSTS_ENABLED=true +# HSTS_MAX_AGE=31536000 +# HSTS_INCLUDE_SUBDOMAINS=false +# HSTS_PRELOAD=false + +# X-Frame-Options. Set to DENY to block all framing, or to `off` if you embed +# LibreChat in an iframe on another origin. +# X_FRAME_OPTIONS=SAMEORIGIN + +# Referrer-Policy. Any standard token, or `off` to omit the header. +# REFERRER_POLICY=no-referrer + +# Cross-Origin-Opener-Policy. Use same-origin-allow-popups if a popup-based +# sign-in flow needs to reach back to the window that opened it. +# CROSS_ORIGIN_OPENER_POLICY=same-origin + +# Cross-Origin-Resource-Policy. Use cross-origin if other sites need to load +# resources served by LibreChat, such as uploaded images. +# CROSS_ORIGIN_RESOURCE_POLICY=same-origin + +#===============================# +# Content Security Policy # +#===============================# + +# Nonce-based CSP for the SPA HTML response. Off by default so existing +# deployments are unaffected. Turn it on in report-only mode first, review the +# violations your deployment actually produces, then set CSP_REPORT_ONLY=false. +# Only an explicit false/off/0/no enforces; anything unrecognized warns and stays +# report-only, so a typo cannot silently start blocking scripts. +# CSP_ENABLED=false +# CSP_REPORT_ONLY=true +# CSP_REPORT_URI= + +# The default policy accommodates what LibreChat actually loads at runtime: +# script-src 'wasm-unsafe-eval' HEIC image conversion compiles WebAssembly +# worker-src data: Monaco's loader bootstraps workers from data: +# Both are narrower than 'unsafe-eval'. Set these to false to drop them if your +# deployment uses neither HEIC uploads nor the artifact code editor. (The CSP_*_EXTRA +# and CSP_ADDITIONAL_DIRECTIVES variables only add sources; they cannot remove one.) +# CSP_ALLOW_WASM=true +# CSP_ALLOW_DATA_WORKERS=true + +# While CSP is enabled the SPA shell is always sent as `no-store` and the +# INDEX_CACHE_CONTROL / INDEX_PRAGMA / INDEX_EXPIRES overrides are ignored for it. +# A cached shell would pin a single nonce across page loads and users, which is +# precisely what a nonce policy exists to prevent. +# +# SECURITY_HEADERS=false disables CSP too; it is the global kill switch. + +# Add deployment-specific sources on top of LibreChat's defaults; they are +# appended, never replacing them. Comma- or space-separated. Quote values +# containing spaces. +# CSP_CONNECT_SRC_EXTRA="https://telemetry.example.com wss://stream.example.com" +# CSP_FRAME_SRC_EXTRA="https://tenant.sharepoint.com" +# CSP_IMG_SRC_EXTRA="https://cdn.example.com" +# CSP_STYLE_SRC_EXTRA= +# CSP_FONT_SRC_EXTRA= +# CSP_MEDIA_SRC_EXTRA= +# CSP_WORKER_SRC_EXTRA= +# CSP_FORM_ACTION_EXTRA= +# CSP_DEFAULT_SRC_EXTRA= + +# Script hosts get their own note: the default policy uses 'strict-dynamic', +# which makes browsers ignore every host source in script-src. Setting this +# drops 'strict-dynamic' so the hosts you list actually take effect. +# CSP_SCRIPT_SRC_EXTRA="https://trusted-scripts.example.com" + +# Who may frame LibreChat. Defaults to 'self'. Replace it if you embed LibreChat +# in a portal on another origin, and set X_FRAME_OPTIONS=off alongside it since +# older browsers honor that header instead. +# CSP_FRAME_ANCESTORS="'self' https://portal.example.com" + +# Raw directives appended to the policy, separated by semicolons. +# CSP_ADDITIONAL_DIRECTIVES="upgrade-insecure-requests" + +# Trust X-Tenant-Id on unauthenticated routes. Disabled by default. +# Enable only when a trusted reverse proxy strips any client-supplied value and sets its own. +# TRUST_TENANT_HEADER=false + +# Minimum password length for user authentication +# Default: 8 +# Note: When using LDAP authentication, you may want to set this to 1 +# to bypass local password validation, as LDAP servers handle their own +# password policies. +# MIN_PASSWORD_LENGTH=8 + +# When enabled, the app will continue running after encountering uncaught exceptions +# instead of exiting the process. Not recommended for production unless necessary. +# CONTINUE_ON_UNCAUGHT_EXCEPTION=false + +#===============# +# JSON Logging # +#===============# + +# Use when process console logs in cloud deployment like GCP/AWS +CONSOLE_JSON=false + +# The maximum length of a string in a JSON log object. +# Default: 255 +# CONSOLE_JSON_STRING_LENGTH=255 + +#===============# +# Debug Logging # +#===============# + +DEBUG_LOGGING=true +DEBUG_CONSOLE=false +# Console verbosity: error, warn, info, http, verbose, debug, activity, silly, or +# `silent` to turn console output off entirely. Defaults to `info`. +# CONSOLE_LOG_LEVEL=info +# Set to false to disable file-backed Winston transports. +LOG_TO_FILE=true +# Set to true to enable agent debug logging +AGENT_DEBUG_LOGGING=false + +# Enable memory diagnostics (logs heap/RSS snapshots every 60s, auto-enabled with --inspect) +# MEM_DIAG=true + +#=============# +# Permissions # +#=============# + +# UID=1000 +# GID=1000 + +#==============# +# Node Options # +#==============# + +# NOTE: NODE_MAX_OLD_SPACE_SIZE is NOT recognized by Node.js directly. +# This variable is used as a build argument for Docker or CI/CD workflows, +# and is NOT used by Node.js to set the heap size at runtime. +# To configure Node.js memory, use NODE_OPTIONS, e.g.: +# NODE_OPTIONS="--max-old-space-size=6144" +# See: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-mib +NODE_MAX_OLD_SPACE_SIZE=6144 + +#===============# +# Configuration # +#===============# +# Use an absolute path, a relative path, or a URL + +# CONFIG_PATH="/alternative/path/to/librechat.yaml" + +# Deployment skills are loaded read-only at startup and exposed to all users +# with the Skills capability enabled. Defaults to project root ./skill. +# DEPLOYMENT_SKILLS_DIR=./skill + +# Agent Plugins packages (skills + MCP servers + hooks) are loaded at startup +# from this directory; each child directory is one plugin. Defaults to ./plugin. +# DEPLOYMENT_PLUGINS_DIR=./plugin +# DEPLOYMENT_PLUGIN_DATA_DIR=./data/plugins + +# Opt-in: execute `command` hook handlers declared by installed plugins +# (ai.librechat/hooks/hooks.json). Commands run as child processes on the API +# host with a minimal environment — only enable for plugins you trust, the +# same trust level as toolApproval hook modules. Off by default: hook +# documents are parsed but never executed. +# DEPLOYMENT_PLUGIN_HOOKS=true + +#==================# +# Langfuse Tracing # +#==================# + +# Get Langfuse API keys for your project from the project settings page: https://cloud.langfuse.com + +# LANGFUSE_PUBLIC_KEY= +# LANGFUSE_SECRET_KEY= +# LANGFUSE_BASE_URL= +# Optional stable project ID. When omitted, LibreChat discovers it from Langfuse in the background. +# LANGFUSE_PROJECT_ID= +# Set false to disable Langfuse traces and feedback scores. +# LANGFUSE_TRACING_ENABLED=true +# Trace-level sample rate from 0 to 1. Sampled-out traces do not receive scores. +# LANGFUSE_SAMPLE_RATE=1 + +# In single-tenant deployments without environment credentials, an admin can +# configure one encrypted Langfuse connection in the application settings. +# Complete environment credentials take precedence and hide those settings. + +# Optional Langfuse fanout for tenant-scoped Langfuse projects. +# The fanout gateway is opt-in: add docker-compose.langfuse-fanout.yml, +# deploy-compose.langfuse-fanout.yml, or enable helm langfuseFanout. +# Tenant public/secret keys and a destination key are managed through +# Settings > Langfuse. Destination keys resolve against known startup URLs; +# credentials can be added or changed at runtime without restarting the gateway. +# See otel/langfuse-fanout/README.md. +# LANGFUSE_FANOUT_ENABLED=false +# LANGFUSE_FANOUT_COLLECTOR_URL=http://langfuse-fanout-collector:4318 +# App-side switch: set true to tell the Langfuse SDK not to create media uploads +# for central/fallback collector traces. Tenant-routed media uploads are unchanged. +# LANGFUSE_FANOUT_CENTRAL_MEDIA_UPLOAD_DISABLED=false +# Gateway HTTP listen address (default: :4318). +# LANGFUSE_FANOUT_LISTEN_ADDR=:4318 +# Emergency switch: unset/false defaults enabled; set true to keep central fanout export but skip tenant trace/score export. +# LANGFUSE_FANOUT_TENANT_EXPORT_DISABLED=false +# Langfuse Cloud base URL options: https://cloud.langfuse.com (EU), +# https://us.cloud.langfuse.com (US), https://jp.cloud.langfuse.com (JP). +# Gateway-only central trace/media export URL. LibreChat feedback scores use +# LANGFUSE_BASE_URL, so set both URLs to the same non-EU region when applicable. +# LANGFUSE_FANOUT_CENTRAL_BASE_URL=https://cloud.langfuse.com +# Gateway-only Basic auth header for central trace/media export. LibreChat feedback +# scores use LANGFUSE_PUBLIC_KEY/LANGFUSE_SECRET_KEY instead. +# LANGFUSE_FANOUT_CENTRAL_AUTH_HEADER=Basic +# Set true on the gateway to disable central media export while leaving central +# trace export unchanged. +# LANGFUSE_FANOUT_CENTRAL_MEDIA_EXPORT_DISABLED=false +# Compose's included gateway config supports the three listed destination keys. +# Add custom keys only when the gateway is started with matching destination URLs. +# LANGFUSE_FANOUT_TENANT_DESTINATIONS=eu=https://cloud.langfuse.com,us=https://us.cloud.langfuse.com,jp=https://jp.cloud.langfuse.com +# Compose's collector config routes only these destination keys. The gateway +# fails startup when LANGFUSE_FANOUT_TENANT_DESTINATIONS contains another key. +# LANGFUSE_FANOUT_TRACE_DESTINATION_KEYS=eu,us,jp +# Gateway base URL used to build one-time media upload URLs. Compose sets this +# to its private service URL; Helm derives an internal service URL unless set. +# LANGFUSE_FANOUT_PUBLIC_URL=http://langfuse-fanout-collector:4318 +# Internal gateway-to-collector trace endpoint. Compose sets this automatically. +# LANGFUSE_FANOUT_TRACE_COLLECTOR_URL=http://langfuse-fanout-otel:4319 +# Redis-backed one-time upload plans let multiple gateway pods handle Langfuse +# media create/upload requests. Compose sets this to its private Redis service. +# LANGFUSE_FANOUT_REDIS_URI=redis://langfuse-fanout-redis:6379 +# LANGFUSE_FANOUT_REDIS_USERNAME= +# LANGFUSE_FANOUT_REDIS_PASSWORD= +# LANGFUSE_FANOUT_REDIS_KEY_PREFIX=langfuse-fanout +# Internal collector receiver bind address. Helm uses 127.0.0.1 because the +# collector is a sidecar; Compose uses 0.0.0.0 on the private fanout network. +# LANGFUSE_FANOUT_OTEL_RECEIVER_ENDPOINT=0.0.0.0:4319 +# Static Compose collector destination URLs. Helm derives these from values. +# LANGFUSE_FANOUT_TENANT_EU_BASE_URL=https://cloud.langfuse.com +# LANGFUSE_FANOUT_TENANT_US_BASE_URL=https://us.cloud.langfuse.com +# LANGFUSE_FANOUT_TENANT_JP_BASE_URL=https://jp.cloud.langfuse.com +# LANGFUSE_FANOUT_UPSTREAM_TIMEOUT=30s +# Optional bearer token for scraping the fanout gateway /metrics endpoint. +# If unset, /metrics returns 401. The gateway also accepts METRICS_SECRET when present. +# LANGFUSE_FANOUT_METRICS_SECRET= +# LANGFUSE_FANOUT_MEMORY_LIMIT_MIB=256 +# LANGFUSE_FANOUT_MEMORY_SPIKE_LIMIT_MIB=64 +# LANGFUSE_FANOUT_BATCH_TIMEOUT=1s +# LANGFUSE_FANOUT_BATCH_SEND_SIZE=128 +# LANGFUSE_FANOUT_METADATA_CARDINALITY_LIMIT=1000 + +#===============# +# OpenTelemetry # +#===============# + +# Enables backend OpenTelemetry tracing. General backend visibility only; +# use Langfuse for GenAI-specific prompt/model observability. +# OTEL_TRACING_ENABLED=false +# Exports application logs as OpenTelemetry log records, correlated with the +# active trace. Logs below OTEL_LOGS_LEVEL are not exported. +# OTEL_LOGS_ENABLED=false +# OTEL_LOGS_LEVEL=info +# OTEL_SERVICE_NAME=librechat +# OTEL_SERVICE_VERSION= +# Exporter protocol for every signal: http/protobuf (default, port 4318) or grpc (port 4317). +# Per-signal overrides: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, OTEL_EXPORTER_OTLP_LOGS_PROTOCOL. +# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf +# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 +# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT= +# OTEL_EXPORTER_OTLP_LOGS_ENDPOINT= +# OTEL_EXPORTER_OTLP_HEADERS= +# OTEL_TRACES_EXPORTER=otlp +# OTEL_LOGS_EXPORTER=otlp +# OTEL_TRACES_SAMPLER=parentbased_always_on +# OTEL_LOG_LEVEL=INFO +# OTEL_SDK_DISABLED=false +# Enable Redis command-level spans. Disabled by default to keep backend traces high-level. +# OTEL_IOREDIS_TRACING_ENABLED=false + +#===============================# +# Real User Monitoring (Browser) # +#===============================# + +# Enables browser Real User Monitoring. Disabled by default. +# Currently supports HyperDX via the browser SDK. +# RUM_ENABLED=false +# RUM_PROVIDER=hyperdx +# RUM_URL=http://localhost:4318 +# RUM_SERVICE_NAME=librechat-web +# RUM_ENVIRONMENT=development + +# Public browser-token mode is suitable for OSS/self-hosted deployments. +# Treat the token as public and restrict/rate-limit ingestion in your RUM backend. +# RUM_AUTH_MODE=publicToken +# RUM_PUBLIC_TOKEN= + +# Authenticated proxy mode sends browser telemetry to this LibreChat backend first. +# The backend validates the LibreChat session, strips app auth, and forwards to the collector. +# RUM_AUTH_MODE=proxy +# RUM_PROXY_TARGET_URL=http://otel-collector:4318 +# RUM_PROXY_TIMEOUT_MS=10000 + +# Optional comma-separated first-party HTTPS origins/URLs that should receive traceparent headers. +# Wildcards and non-HTTPS targets are ignored. +# RUM_TRACE_PROPAGATION_TARGETS=https://api.example.com + +# Privacy defaults: replay, console capture, and full network body capture stay off. +# Console/network capture may collect sensitive browser logs, prompts, responses, or payloads. +# RUM_DISABLE_REPLAY=true +# RUM_CONSOLE_CAPTURE=false +# RUM_ADVANCED_NETWORK_CAPTURE=false +# RUM_SAMPLE_RATE=1 + +#===================================================# +# Endpoints # +#===================================================# + +# ENDPOINTS=openAI,assistants,azureOpenAI,google,anthropic + +# Optional outbound proxy for server-side requests. +# PROXY applies to both HTTP and HTTPS targets. When PROXY is unset, LibreChat honors +# HTTP_PROXY, HTTPS_PROXY, and NO_PROXY/no_proxy for supported server-side clients. +PROXY= +# HTTP_PROXY= +# HTTPS_PROXY= +# NO_PROXY= + +#===================================# +# Known Endpoints - librechat.yaml # +#===================================# +# https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints + +# ANYSCALE_API_KEY= +# APIPIE_API_KEY= +# COHERE_API_KEY= +# DEEPSEEK_API_KEY= +# DATABRICKS_API_KEY= +# FIREWORKS_API_KEY= +# GROQ_API_KEY= +# HUGGINGFACE_TOKEN= +# MISTRAL_API_KEY= +# OPENROUTER_KEY= +# PERPLEXITY_API_KEY= +# SHUTTLEAI_API_KEY= +# TOGETHERAI_API_KEY= +# UNIFY_API_KEY= +# XAI_API_KEY= + +#============# +# Anthropic # +#============# + +ANTHROPIC_API_KEY=user_provided +# ANTHROPIC_MODELS=claude-fable-5-1,claude-fable-5,claude-opus-5,claude-opus-4-8,claude-opus-4-7,claude-sonnet-5,claude-sonnet-4-6,claude-opus-4-6,claude-opus-4-20250514,claude-3-7-sonnet-20250219,claude-3-5-sonnet-20241022,claude-3-5-haiku-20241022,claude-3-opus-20240229,claude-3-sonnet-20240229,claude-3-haiku-20240307 +# ANTHROPIC_REVERSE_PROXY= + +# Set to true to use Anthropic models through Google Vertex AI instead of direct API +# ANTHROPIC_USE_VERTEX= +# Supports regional locations like us-east5 and multi-region locations: us, eu, global +# IMPORTANT: specific regional endpoints (us-east5, europe-west1, ...) only serve Claude Sonnet 4.6 +# and earlier. Newer models (Opus 4.7+, Opus 5, Sonnet 5, Fable 5/5.1) require `global` or a multi-region +# location (`us`/`eu`) and will 404 on a specific region. `global` also avoids the 10% regional premium. +# ANTHROPIC_VERTEX_REGION=us-east5 + +#============# +# Azure # +#============# + +# Note: these variables are DEPRECATED +# Use the `librechat.yaml` configuration for `azureOpenAI` instead +# You may also continue to use them if you opt out of using the `librechat.yaml` configuration + +# AZURE_OPENAI_DEFAULT_MODEL=gpt-3.5-turbo # Deprecated +# AZURE_OPENAI_MODELS=gpt-3.5-turbo,gpt-4 # Deprecated +# AZURE_USE_MODEL_AS_DEPLOYMENT_NAME=TRUE # Deprecated +# AZURE_API_KEY= # Deprecated +# AZURE_OPENAI_API_INSTANCE_NAME= # Deprecated +# AZURE_OPENAI_API_DEPLOYMENT_NAME= # Deprecated +# AZURE_OPENAI_API_VERSION= # Deprecated +# AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME= # Deprecated +# AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME= # Deprecated + +#=================# +# AWS Bedrock # +#=================# +# AWS Bedrock credentials +# +# Preferred for local development: configure an AWS profile in ~/.aws/config or +# ~/.aws/credentials, then set BEDROCK_AWS_PROFILE. LibreChat passes this profile +# to the AWS SDK for JavaScript credential provider chain. +# +# In deployed environments, prefer IAM roles or other short-term credentials +# discoverable by the AWS SDK default credential provider chain. If neither +# BEDROCK_AWS_PROFILE nor Bedrock-specific static credentials are set, the SDK +# uses its default provider chain. AWS-standard environment variables still +# follow AWS SDK precedence. +# +# Profiles can use IAM Identity Center, assume-role settings, or credential_process. +# If you use credential_process, secure the config file and helper command, and do +# not write secret material to stderr. +# +# AWS SDK credential chain: +# https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html +# Shared config/profile settings: +# https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html +# credential_process security notes: +# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html + +# BEDROCK_AWS_DEFAULT_REGION=us-east-1 # A default region must be provided + +# AWS Profile +# BEDROCK_AWS_PROFILE=your-profile-name + +# Static credentials (use only if profiles or IAM roles are not suitable) +# BEDROCK_AWS_ACCESS_KEY_ID=someAccessKey +# BEDROCK_AWS_SECRET_ACCESS_KEY=someSecretAccessKey +# BEDROCK_AWS_SESSION_TOKEN=someSessionToken + +# Bedrock API key +# BEDROCK_AWS_BEARER_TOKEN=yourBedrockApiKey + +# Note: This example list is not meant to be exhaustive. If omitted, all known, supported model IDs will be included for you. +# Claude 4+ models cannot be invoked on-demand by their bare `anthropic.` foundation-model ID; Bedrock requires a +# cross-region inference profile (`global.` or `us.`) for those. The `global.` profile has no regional pricing premium. +# BEDROCK_AWS_MODELS=global.anthropic.claude-fable-5-1,global.anthropic.claude-fable-5,global.anthropic.claude-opus-5,global.anthropic.claude-opus-4-8,global.anthropic.claude-opus-4-7,global.anthropic.claude-sonnet-5,global.anthropic.claude-sonnet-4-6,global.anthropic.claude-opus-4-6-v1,global.anthropic.claude-haiku-4-5-20251001-v1:0,meta.llama3-1-8b-instruct-v1:0 +# US-only routing alternative: us.anthropic.claude-fable-5-1,us.anthropic.claude-fable-5,us.anthropic.claude-opus-5,us.anthropic.claude-opus-4-8,us.anthropic.claude-opus-4-7,us.anthropic.claude-sonnet-5,us.anthropic.claude-sonnet-4-6,us.anthropic.claude-opus-4-6-v1 +# List the profiles available to your account with: aws bedrock list-inference-profiles --region + +# See all Bedrock model IDs here: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns + +# Notes on specific models: +# The following models are not support due to not supporting streaming: +# ai21.j2-mid-v1 + +# The following models are not support due to not supporting conversation history: +# ai21.j2-ultra-v1, cohere.command-text-v14, cohere.command-light-text-v14 + +# Claude Mythos-class models (anthropic.claude-fable-5-1, anthropic.claude-mythos-5-1, and their 5.0 +# predecessors) are inference-profile only on Bedrock — use a profile ID (e.g. us.anthropic.claude-fable-5-1) +# — and require opting into Anthropic data sharing via the Bedrock Data Retention API/console before they +# can be invoked. + +#============# +# Google # +#============# + +GOOGLE_KEY=user_provided + +# GOOGLE_REVERSE_PROXY= +# Some reverse proxies do not support the X-goog-api-key header, uncomment to pass the API key in Authorization header instead. +# GOOGLE_AUTH_HEADER=true + +# Gemini API (AI Studio) +# GOOGLE_MODELS=gemini-3.8-flash,gemini-3.7-flash,gemini-3.6-flash,gemini-3.5-flash,gemini-3.5-flash-lite,gemini-3.1-pro-preview,gemini-3.1-pro-preview-customtools,gemini-3.1-flash-lite-preview,gemini-2.5-pro,gemini-2.5-flash,gemini-2.5-flash-lite,gemini-2.0-flash,gemini-2.0-flash-lite + +# Vertex AI +# GOOGLE_MODELS=gemini-3.8-flash,gemini-3.7-flash,gemini-3.6-flash,gemini-3.5-flash,gemini-3.5-flash-lite,gemini-3.1-pro-preview,gemini-3.1-pro-preview-customtools,gemini-3.1-flash-lite-preview,gemini-2.5-pro,gemini-2.5-flash,gemini-2.5-flash-lite,gemini-2.0-flash-001,gemini-2.0-flash-lite-001 + +# GOOGLE_TITLE_MODEL=gemini-2.0-flash-lite-001 + +# Google Cloud location for Vertex AI (used by both chat and image generation). +# Supports regional locations like us-central1 and multi-region locations: us, eu, global. +# GOOGLE_LOC=us-central1 + +# Alternative region env var for Gemini Image Generation +# GOOGLE_CLOUD_LOCATION=global + +# Vertex AI Service Account Configuration +# Path to your Google Cloud service account JSON file +# GOOGLE_SERVICE_KEY_FILE=/path/to/service-account.json + +# Google Safety Settings +# NOTE: These settings apply to both Vertex AI and Gemini API (AI Studio) +# +# For Vertex AI: +# To use the BLOCK_NONE setting, you need either: +# (a) Access through an allowlist via your Google account team, or +# (b) Switch to monthly invoiced billing: https://cloud.google.com/billing/docs/how-to/invoiced-billing +# +# For Gemini API (AI Studio): +# BLOCK_NONE is available by default, no special account requirements. +# +# Available options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE +# +# GOOGLE_SAFETY_SEXUALLY_EXPLICIT=BLOCK_ONLY_HIGH +# GOOGLE_SAFETY_HATE_SPEECH=BLOCK_ONLY_HIGH +# GOOGLE_SAFETY_HARASSMENT=BLOCK_ONLY_HIGH +# GOOGLE_SAFETY_DANGEROUS_CONTENT=BLOCK_ONLY_HIGH +# GOOGLE_SAFETY_CIVIC_INTEGRITY=BLOCK_ONLY_HIGH + +#========================# +# Gemini Image Generation # +#========================# + +# Gemini Image Generation Tool (for Agents) +# Supports multiple authentication methods in priority order: +# 1. User-provided API key (via GUI) +# 2. GEMINI_API_KEY env var (admin-configured) +# 3. GOOGLE_KEY env var (shared with Google chat endpoint) +# 4. Vertex AI service account (via GOOGLE_SERVICE_KEY_FILE) + +# Option A: Use dedicated Gemini API key for image generation +# GEMINI_API_KEY=your-gemini-api-key + +# Vertex AI model for image generation (defaults to gemini-2.5-flash-image) +# GEMINI_IMAGE_MODEL=gemini-2.5-flash-image + +#============# +# OpenAI # +#============# + +OPENAI_API_KEY=user_provided +# OPENAI_MODELS=gpt-6-astra,gpt-5.6,gpt-5.6-terra,gpt-5.6-luna,gpt-5.5,gpt-5.5-pro,chat-latest,gpt-5.4,gpt-5.4-pro,gpt-5.4-mini,gpt-5.4-nano,gpt-5.3-codex,gpt-5.2,gpt-5,gpt-5-codex,gpt-5-mini,gpt-5-nano,o3-pro,o3,o4-mini,gpt-4.1,gpt-4.1-mini,gpt-4.1-nano,o3-mini,o1-pro,o1,gpt-4o,gpt-4o-mini + +DEBUG_OPENAI=false + +# TITLE_CONVO=false +# OPENAI_TITLE_MODEL=gpt-4o-mini + +# OPENAI_SUMMARIZE=true +# OPENAI_SUMMARY_MODEL=gpt-4o-mini + +# OPENAI_FORCE_PROMPT=true + +# OPENAI_REVERSE_PROXY= + +# OPENAI_ORGANIZATION= + +#====================# +# Assistants API # +#====================# + +ASSISTANTS_API_KEY=user_provided +# ASSISTANTS_BASE_URL= +# ASSISTANTS_MODELS=gpt-4o,gpt-4o-mini,gpt-3.5-turbo-0125,gpt-3.5-turbo-16k-0613,gpt-3.5-turbo-16k,gpt-3.5-turbo,gpt-4,gpt-4-0314,gpt-4-32k-0314,gpt-4-0613,gpt-3.5-turbo-0613,gpt-3.5-turbo-1106,gpt-4-0125-preview,gpt-4-turbo-preview,gpt-4-1106-preview + +#==========================# +# Azure Assistants API # +#==========================# + +# Note: You should map your credentials with custom variables according to your Azure OpenAI Configuration +# The models for Azure Assistants are also determined by your Azure OpenAI configuration. + +# More info, including how to enable use of Assistants with Azure here: +# https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints/azure#using-assistants-with-azure + +# Leave these blank to let LibreChat generate and persist temporary credentials in .env.temp. +# Configure unique, persistent values before using a production instance. +CREDS_KEY= +CREDS_IV= + +# Azure AI Search +#----------------- +AZURE_AI_SEARCH_SERVICE_ENDPOINT= +AZURE_AI_SEARCH_INDEX_NAME= +AZURE_AI_SEARCH_API_KEY= + +AZURE_AI_SEARCH_API_VERSION= +AZURE_AI_SEARCH_SEARCH_OPTION_QUERY_TYPE= +AZURE_AI_SEARCH_SEARCH_OPTION_TOP= +AZURE_AI_SEARCH_SEARCH_OPTION_SELECT= + +# OpenAI Image Tools Customization +#---------------- +# IMAGE_GEN_OAI_API_KEY= # Create or reuse OpenAI API key for image generation tool +# IMAGE_GEN_OAI_BASEURL= # Custom OpenAI base URL for image generation tool +# IMAGE_GEN_OAI_AZURE_API_VERSION= # Custom Azure OpenAI deployments +# IMAGE_GEN_OAI_MODEL=gpt-image-1 # OpenAI image model (e.g., gpt-image-1, gpt-image-1.5) +# IMAGE_GEN_OAI_DESCRIPTION= +# IMAGE_GEN_OAI_DESCRIPTION_WITH_FILES=Custom description for image generation tool when files are present +# IMAGE_GEN_OAI_DESCRIPTION_NO_FILES=Custom description for image generation tool when no files are present +# IMAGE_EDIT_OAI_DESCRIPTION=Custom description for image editing tool +# IMAGE_GEN_OAI_PROMPT_DESCRIPTION=Custom prompt description for image generation tool +# IMAGE_EDIT_OAI_PROMPT_DESCRIPTION=Custom prompt description for image editing tool + +# DALL·E +#---------------- +# DALLE_API_KEY= +# DALLE3_API_KEY= +# DALLE2_API_KEY= +# DALLE3_SYSTEM_PROMPT= +# DALLE2_SYSTEM_PROMPT= +# DALLE_REVERSE_PROXY= +# DALLE3_BASEURL= +# DALLE2_BASEURL= + +# DALL·E (via Azure OpenAI) +# Note: requires some of the variables above to be set +#---------------- +# DALLE3_AZURE_API_VERSION= +# DALLE2_AZURE_API_VERSION= + +# Flux +#----------------- +FLUX_API_BASE_URL=https://api.us1.bfl.ai +# FLUX_API_BASE_URL = 'https://api.bfl.ml'; + +# Get your API key at https://api.us1.bfl.ai/auth/profile +# FLUX_API_KEY= + +# Google +#----------------- +GOOGLE_SEARCH_API_KEY= +GOOGLE_CSE_ID= + +# Stable Diffusion +#----------------- +SD_WEBUI_URL=http://host.docker.internal:7860 + +# Tavily +#----------------- +TAVILY_API_KEY= + +# Traversaal +#----------------- +TRAVERSAAL_API_KEY= + +# WolframAlpha +#----------------- +WOLFRAM_APP_ID= + +# Zapier +#----------------- +ZAPIER_NLA_API_KEY= + +#==================================================# +# Search # +#==================================================# + +# Set both SEARCH=true and a unique MEILI_MASTER_KEY to enable search. +SEARCH=false +MEILI_NO_ANALYTICS=true +MEILI_HOST=http://0.0.0.0:7700 +# Set a unique value when Meilisearch is enabled; do not reuse a published default. +MEILI_MASTER_KEY= + +# Optional: Disable indexing, useful in a multi-node setup +# where only one instance should perform an index sync. +# MEILI_NO_SYNC=true + +#==================================================# +# Speech to Text & Text to Speech # +#==================================================# + +STT_API_KEY= +TTS_API_KEY= + +#==================================================# +# Code Interpreter # +#==================================================# + +# LIBRECHAT_CODE_API_KEY= +# LIBRECHAT_CODE_BASEURL= +# Current self-hosted Code Interpreter deployments use per-user LibreChat JWTs outside local mode. +# Configure the matching public verifier on Code Interpreter; see: +# https://www.librechat.ai/docs/features/code_interpreter#self-hosted-jwt-authentication +# CODEAPI_AUTH_PROVIDER=librechat-jwt +# CODEAPI_JWT_ENABLED=false +# Set at least one private-key source. Precedence: PEM, base64-encoded PEM, then private JWK JSON. +# CODEAPI_JWT_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----" +# CODEAPI_JWT_PRIVATE_KEY_BASE64= +# CODEAPI_JWT_PRIVATE_JWK_JSON= +# CODEAPI_JWT_ALGORITHM=EdDSA +# CODEAPI_JWT_KID=lc-codeapi-2026-05 +# CODEAPI_JWT_ISSUER=librechat +# CODEAPI_JWT_AUDIENCE=codeapi +# CODEAPI_JWT_TTL_SECONDS=300 +# CODEAPI_JWT_MINT_CACHE_SECONDS=30 +# CODEAPI_JWT_SINGLE_TENANT_ID=legacy +# Multi-tenant deployments can reject requests without authenticated tenant context. +# The Code Interpreter service must also set CODEAPI_TENANT_ISOLATION_STRICT=true. +# TENANT_ISOLATION_STRICT=false +# Optional dedicated Code API deployment for agents with Stateful code sessions enabled. +# When configured, stateless agents continue using LIBRECHAT_CODE_BASEURL while stateful +# agents fail closed onto this endpoint. The endpoint must advertise the `stateful` profile. +# LIBRECHAT_CODE_BASEURL_STATEFUL= +# Prewarm selected stateful sandboxes in parallel with model generation (default: true). +# CODE_SANDBOX_PREWARM=true +# Time in milliseconds before LibreChat treats a tracked sandbox as cold (default: 2100000 / 35 minutes). +# CODE_SANDBOX_COLD_AFTER_MS=2100000 +# Sandbox stdout a single /exec response may carry (default: 65536). Sandbox image reads are +# windowed to fill this budget, so matching it to the runner's SANDBOX_OUTPUT_MAX_SIZE keeps the +# round-trip count — and the load on the Code API's execution rate limit — as low as possible. +# A runner with a smaller cap is also detected at runtime, at the cost of one discarded read. +# LIBRECHAT_CODE_SANDBOX_OUTPUT_MAX_SIZE=65536 +# Bytes read per sandbox image window, overriding the size derived from the stdout budget above. +# Prefer setting the budget; use this only to pin a window size exactly. +# LIBRECHAT_CODE_IMAGE_CHUNK_BYTES= + +#==================================================# +# RAG # +#==================================================# +# More info: https://www.librechat.ai/docs/configuration/rag_api + +# RAG_API_URL=http://rag_api:8000 +# RAG_OPENAI_BASEURL= +# RAG_OPENAI_API_KEY= +# RAG_USE_FULL_CONTEXT= +# EMBEDDINGS_PROVIDER=openai +# EMBEDDINGS_MODEL=text-embedding-3-small + +# Stream upload responses with heartbeats during long-running file processing. +# FILE_UPLOAD_SSE_ENABLED=false +# Timeout in milliseconds for server-side remote file downloads (default: 15000). +# REMOTE_FILE_FETCH_TIMEOUT_MS=15000 +# Maximum size in bytes for server-side remote file downloads (default: 536870912 / 512 MiB). +# REMOTE_FILE_FETCH_MAX_BYTES=536870912 + +#===================================================# +# User System # +#===================================================# + +# Maximum characters in one mid-run Agent steering message (default: 16000). +# STEER_MAX_LENGTH=16000 + +#========================# +# Moderation # +#========================# + +OPENAI_MODERATION=false +OPENAI_MODERATION_API_KEY= +# OPENAI_MODERATION_REVERSE_PROXY= + +BAN_VIOLATIONS=true +BAN_DURATION=1000 * 60 * 60 * 2 +BAN_INTERVAL=20 + +# Violation scores expire after this long (in ms) without new violations; 0 = never expire +VIOLATION_SCORE_TTL=1000 * 60 * 60 + +LOGIN_VIOLATION_SCORE=1 +REGISTRATION_VIOLATION_SCORE=1 +CONCURRENT_VIOLATION_SCORE=1 +MESSAGE_VIOLATION_SCORE=1 +NON_BROWSER_VIOLATION_SCORE=20 +TTS_VIOLATION_SCORE=0 +STT_VIOLATION_SCORE=0 +FORK_VIOLATION_SCORE=0 +IMPORT_VIOLATION_SCORE=0 +SHARE_VIOLATION_SCORE=0 +FILE_UPLOAD_VIOLATION_SCORE=0 +# Shared link retrieval re-inspects the whole shared snapshot on every request +# and is reachable without authentication (defaults: 100 per IP and 60 per user, +# both per minute). +# SHARE_IP_MAX=100 +# SHARE_IP_WINDOW=1 +# SHARE_USER_MAX=60 +# SHARE_USER_WINDOW=1 +# Per-user limiter for metadata-only /files/usage requests that renew the TTL +# of attachments waiting in queued Agent messages (default: 120 per 15 minutes). +# FILE_USAGE_USER_MAX=120 +# FILE_USAGE_USER_WINDOW=15 +# Password-reset and verification request/submission scores default to 1 when unset. +# RESET_PASSWORD_VIOLATION_SCORE=1 +# VERIFY_EMAIL_VIOLATION_SCORE=1 +# RESET_PASSWORD_SUBMISSION_VIOLATION_SCORE=1 +# VERIFY_EMAIL_SUBMISSION_VIOLATION_SCORE=1 + +LOGIN_MAX=7 +LOGIN_WINDOW=5 +REGISTER_MAX=5 +REGISTER_WINDOW=60 + +# Password-reset email requests and token submissions are limited separately. +# Submission values inherit the matching request value when omitted; all default to 2. +# RESET_PASSWORD_MAX=2 +# RESET_PASSWORD_WINDOW=2 +# RESET_PASSWORD_SUBMISSION_MAX=2 +# RESET_PASSWORD_SUBMISSION_WINDOW=2 +# VERIFY_EMAIL_MAX=2 +# VERIFY_EMAIL_WINDOW=2 +# VERIFY_EMAIL_SUBMISSION_MAX=2 +# VERIFY_EMAIL_SUBMISSION_WINDOW=2 + +LIMIT_CONCURRENT_MESSAGES=true +CONCURRENT_MESSAGE_MAX=2 + +LIMIT_MESSAGE_IP=true +MESSAGE_IP_MAX=40 +MESSAGE_IP_WINDOW=1 + +LIMIT_MESSAGE_USER=false +MESSAGE_USER_MAX=40 +MESSAGE_USER_WINDOW=1 + +ILLEGAL_MODEL_REQ_SCORE=5 + +#========================# +# Balance # +#========================# + +# CHECK_BALANCE=false +# START_BALANCE=20000 # note: the number of tokens that will be credited after registration. + +#========================# +# Registration and Login # +#========================# + +ALLOW_EMAIL_LOGIN=true +# ALLOW_EMAIL_LOGIN_OVERRIDE=false # note: permits direct API email login while ALLOW_EMAIL_LOGIN=false; each use is logged +ALLOW_REGISTRATION=true +ALLOW_SOCIAL_LOGIN=false +ALLOW_SOCIAL_REGISTRATION=false +ALLOW_PASSWORD_RESET=false +# ALLOW_ACCOUNT_DELETION=true # note: enabled by default if omitted/commented out +ALLOW_UNVERIFIED_EMAIL_LOGIN=true + +SESSION_EXPIRY=1000 * 60 * 15 +REFRESH_TOKEN_EXPIRY=(1000 * 60 * 60 * 24) * 7 +# Overrides the Secure attribute for session/auth cookies when set to true or false; +# leave unset to use the default NODE_ENV/DOMAIN_SERVER heuristic. +# Set to false only for HTTP-only deployments where browsers drop Secure cookies. +# SESSION_COOKIE_SECURE=false + +# Leave these blank to use generated temporary secrets from .env.temp. +# Configure unique, persistent values before using a production instance. +JWT_SECRET= +JWT_REFRESH_SECRET= + +# Discord +DISCORD_CLIENT_ID= +DISCORD_CLIENT_SECRET= +DISCORD_CALLBACK_URL=/oauth/discord/callback + +# Facebook +FACEBOOK_CLIENT_ID= +FACEBOOK_CLIENT_SECRET= +FACEBOOK_CALLBACK_URL=/oauth/facebook/callback + +# GitHub +GITHUB_CLIENT_ID= +GITHUB_CLIENT_SECRET= +GITHUB_CALLBACK_URL=/oauth/github/callback +# GitHub Enterprise +# GITHUB_ENTERPRISE_BASE_URL= +# GITHUB_ENTERPRISE_USER_AGENT= + +# Google +GOOGLE_CLIENT_ID= +GOOGLE_CLIENT_SECRET= +GOOGLE_CALLBACK_URL=/oauth/google/callback + +# Apple +APPLE_CLIENT_ID= +APPLE_TEAM_ID= +APPLE_KEY_ID= +APPLE_PRIVATE_KEY_PATH= +APPLE_CALLBACK_URL=/oauth/apple/callback + +# OpenID +OPENID_CLIENT_ID= +OPENID_CLIENT_SECRET= +OPENID_ISSUER= +OPENID_SESSION_SECRET= +OPENID_SCOPE="openid profile email" +OPENID_CALLBACK_URL=/oauth/openid/callback +# Admin panel SSO uses ${DOMAIN_SERVER}/api/admin/oauth/openid/callback as the +# OpenID provider redirect URI. +OPENID_REQUIRED_ROLE= +OPENID_REQUIRED_ROLE_TOKEN_KIND= +OPENID_REQUIRED_ROLE_PARAMETER_PATH= +OPENID_ADMIN_ROLE= +OPENID_ADMIN_ROLE_PARAMETER_PATH= +OPENID_ADMIN_ROLE_TOKEN_KIND= +# Generic OpenID role sync maps non-admin IdP roles/groups to one LibreChat role. +# ADMIN cannot be assigned by generic role sync; use OPENID_ADMIN_ROLE for admin elevation. +# Role priority is ordered from most important to least important. +OPENID_ROLE_SYNC_ENABLED=false +OPENID_ROLE_SYNC_API_ENABLED=false +OPENID_ROLE_SYNC_SOURCE=id +OPENID_ROLE_SYNC_CLAIM= +OPENID_ROLE_SYNC_ROLE_PRIORITY= +# Fallback is authoritative when configured: if no priority role matches, this role is assigned. +OPENID_ROLE_SYNC_FALLBACK_ROLE= +# Set to determine which user info property returned from OpenID Provider to store as the User's username +OPENID_USERNAME_CLAIM= +# Set to determine which user info property returned from OpenID Provider to store as the User's name +OPENID_NAME_CLAIM= +# Set to determine which user info claim to use as the email/identifier for user matching (e.g., "upn" for Entra ID) +# When not set, defaults to: email -> preferred_username -> upn +OPENID_EMAIL_CLAIM= +# Optional audience parameter for OpenID authorization requests and JWT validation. +# If comma-separated values are provided, JWT validation accepts all values and +# authorization requests use the first non-empty value. +OPENID_AUDIENCE= +# Optional audience parameter for OpenID refresh token requests. +# Some providers, such as Auth0 custom APIs, require this to preserve +# the intended access-token audience during refresh. Usually matches OPENID_AUDIENCE. +OPENID_REFRESH_AUDIENCE= + +OPENID_BUTTON_LABEL= +OPENID_IMAGE_URL= +# Set to true to automatically redirect to the OpenID provider when a user visits the login page +# This will bypass the login form completely for users, only use this if OpenID is your only authentication method +OPENID_AUTO_REDIRECT=false +# Set to true to use PKCE (Proof Key for Code Exchange) for OpenID authentication. +# For public clients (no client secret), leave OPENID_CLIENT_SECRET empty and set this to true. +OPENID_USE_PKCE=false +#Set to true to reuse openid tokens for authentication management instead of using the mongodb session and the custom refresh token. +OPENID_REUSE_TOKENS= +#Max age a reused OpenID session token is served before LibreChat forces an IdP refresh. Default 900000 ms (15 min). +#Accepts an arithmetic expression like SESSION_EXPIRY (e.g. 60 * 60 * 24 * 1000 for 24h). +#Raise toward the IdP access-token lifetime when the IdP revokes the previous access token on refresh, so a still-valid token +#is not rotated/revoked out from under downstream consumers (e.g. MCP servers that introspect the bearer). +#When OPENID_REUSE_TOKENS=true, the OpenID session cookie maxAge is extended to at least this value. +OPENID_REUSE_MAX_SESSION_AGE_MS= +#Short recovery window for a rotated OpenID refresh token while LibreChat publishes the refreshed session. Default 60000 ms (1 min). +#Accepts arithmetic expressions. Increase only when slow session persistence or cross-replica publication needs more time. +OPENID_REFRESH_BRIDGE_GRACE_MS= +#By default, signing key verification results are cached in order to prevent excessive HTTP requests to the JWKS endpoint. +#If a signing key matching the kid is found, this will be cached and the next time this kid is requested the signing key will be served from the cache. +#Default is true. +OPENID_JWKS_URL_CACHE_ENABLED= +OPENID_JWKS_URL_CACHE_TIME= # 600000 ms eq to 10 minutes leave empty to disable caching +#Set to true to trigger token exchange flow to acquire access token for the userinfo endpoint. +OPENID_ON_BEHALF_FLOW_FOR_USERINFO_REQUIRED= +OPENID_ON_BEHALF_FLOW_USERINFO_SCOPE="user.read" # example for Scope Needed for Microsoft Graph API +# Set to true to use the OpenID Connect end session endpoint for logout +OPENID_USE_END_SESSION_ENDPOINT= +# URL to redirect to after OpenID logout (defaults to ${DOMAIN_CLIENT}/login) +OPENID_POST_LOGOUT_REDIRECT_URI= +# Maximum logout URL length before using logout_hint instead of id_token_hint (default: 2000) +OPENID_MAX_LOGOUT_URL_LENGTH= + +#========================# +# SharePoint Integration # +#========================# +# Requires Entra ID (OpenID) authentication to be configured + +# Enable SharePoint file picker in chat and agent panels +# ENABLE_SHAREPOINT_FILEPICKER=true + +# SharePoint tenant base URL (e.g., https://yourtenant.sharepoint.com) +# SHAREPOINT_BASE_URL=https://yourtenant.sharepoint.com + +# Microsoft Graph API And SharePoint scopes for file picker +# SHAREPOINT_PICKER_SHAREPOINT_SCOPE==https://yourtenant.sharepoint.com/AllSites.Read +# SHAREPOINT_PICKER_GRAPH_SCOPE=Files.Read.All +#========================# + +# SAML +# Note: If OpenID is enabled, SAML authentication will be automatically disabled. +SAML_ENTRY_POINT= +SAML_ISSUER= +SAML_CERT= +SAML_CALLBACK_URL=/oauth/saml/callback +SAML_SESSION_SECRET= + +# Stable NameID format requested from the IdP. Transient identifiers are rejected. +# Persistent identifiers are recommended for account binding. +# SAML_NAME_ID_FORMAT=urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + +# Expected IdP entity ID. When set, assertions from a different or missing issuer are rejected. +SAML_IDP_ISSUER= + +# Attribute mappings (optional) +SAML_EMAIL_CLAIM= +SAML_USERNAME_CLAIM= +SAML_GIVEN_NAME_CLAIM= +SAML_FAMILY_NAME_CLAIM= +SAML_PICTURE_CLAIM= +SAML_NAME_CLAIM= + +# Logint buttion settings (optional) +SAML_BUTTON_LABEL= +SAML_IMAGE_URL= + +# Whether the SAML Response should be signed. +# - If "true", the entire `SAML Response` will be signed. +# - If "false" or unset, only the `SAML Assertion` will be signed (default behavior). +# SAML_USE_AUTHN_RESPONSE_SIGNED= + + +#===============================================# +# Microsoft Graph API / Entra ID Integration # +#===============================================# + +# Enable Entra ID people search integration in permissions/sharing system +# When enabled, the people picker will search both local database and Entra ID +USE_ENTRA_ID_FOR_PEOPLE_SEARCH=false + +# When enabled, entra id groups owners will be considered as members of the group +ENTRA_ID_INCLUDE_OWNERS_AS_MEMBERS=false + +# Microsoft Graph API scopes needed for people/group search +# Default scopes provide access to user profiles and group memberships +OPENID_GRAPH_SCOPES=User.Read,People.Read,GroupMember.Read.All + +# Space-separated Microsoft Graph scopes requested by the OBO exchange for +# {{LIBRECHAT_GRAPH_ACCESS_TOKEN}} placeholders in YAML-defined MCP servers. +# This is separate from OPENID_GRAPH_SCOPES above. +# GRAPH_API_SCOPES=https://graph.microsoft.com/.default + +# LDAP +LDAP_URL= +LDAP_BIND_DN= +LDAP_BIND_CREDENTIALS= +LDAP_USER_SEARCH_BASE= +#LDAP_SEARCH_FILTER="mail=" +LDAP_CA_CERT_PATH= +# LDAP_TLS_REJECT_UNAUTHORIZED= +# LDAP_STARTTLS= +# LDAP_LOGIN_USES_USERNAME=true +# LDAP_ID= +# LDAP_USERNAME= +# LDAP_EMAIL= +# LDAP_FULL_NAME= + +#========================# +# Email Password Reset # +#========================# + +EMAIL_SERVICE= +EMAIL_HOST= +EMAIL_PORT=25 +EMAIL_ENCRYPTION= +EMAIL_ENCRYPTION_HOSTNAME= +EMAIL_ALLOW_SELFSIGNED= +# Leave both empty for SMTP servers that do not require authentication +EMAIL_USERNAME= +EMAIL_PASSWORD= +EMAIL_FROM_NAME= +EMAIL_FROM=noreply@librechat.ai + +#========================# +# Mailgun API # +#========================# + +# MAILGUN_API_KEY=your-mailgun-api-key +# MAILGUN_DOMAIN=mg.yourdomain.com +# EMAIL_FROM=noreply@yourdomain.com +# EMAIL_FROM_NAME="LibreChat" + +# # Optional: For EU region +# MAILGUN_HOST=https://api.eu.mailgun.net + +#========================# +# Firebase CDN # +#========================# + +FIREBASE_API_KEY= +FIREBASE_AUTH_DOMAIN= +FIREBASE_PROJECT_ID= +FIREBASE_STORAGE_BUCKET= +FIREBASE_MESSAGING_SENDER_ID= +FIREBASE_APP_ID= + +#========================# +# S3 AWS Bucket # +#========================# + +AWS_ENDPOINT_URL= +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_REGION= +AWS_BUCKET_NAME= +# Required for path-style S3-compatible providers (MinIO, Hetzner, Backblaze B2, etc.) +# that don't support virtual-hosted-style URLs (bucket.endpoint). Not needed for AWS S3. +# AWS_FORCE_PATH_STYLE=false +# Required for CloudFront signed cookies and signed download URLs +# CLOUDFRONT_KEY_PAIR_ID= +# CLOUDFRONT_PRIVATE_KEY= + +#========================# +# Azure Blob Storage # +#========================# + +AZURE_STORAGE_CONNECTION_STRING= +AZURE_STORAGE_PUBLIC_ACCESS=false +AZURE_CONTAINER_NAME=files + +#========================# +# Shared Links # +#========================# + +ALLOW_SHARED_LINKS=true +# Allows unauthenticated access to shared links. Defaults to false (auth required) if not set. +ALLOW_SHARED_LINKS_PUBLIC=false +# Snapshot files referenced by a shared chat so viewers can preview/download them through +# the shared link (instead of the owner's file ACL). Enabled by default; overrides the +# `interface.sharedLinks.snapshotFiles` yaml setting when set. +# SHARED_LINKS_SNAPSHOT_FILES=true + +#==============================# +# Static File Cache Control # +#==============================# + +# Leave commented out to use defaults: 1 day (86400 seconds) for s-maxage and 2 days (172800 seconds) for max-age +# NODE_ENV must be set to production for these to take effect +# STATIC_CACHE_MAX_AGE=172800 +# STATIC_CACHE_S_MAX_AGE=86400 + +# If you have another service in front of your LibreChat doing compression, disable express based compression here +# DISABLE_COMPRESSION=true + +# Serve precompressed Brotli versions of static app assets when available. +# ENABLE_STATIC_ASSET_BROTLI=true + +# If you have gzipped version of uploaded image images in the same folder, this will enable gzip scan and serving of these images +# Note: The images folder will be scanned on startup and a ma kept in memory. Be careful for large number of images. +# ENABLE_IMAGE_OUTPUT_GZIP_SCAN=true + +#===================================================# +# UI # +#===================================================# + +APP_TITLE=LibreChat +# CUSTOM_FOOTER="My custom footer" +HELP_AND_FAQ_URL=https://librechat.ai + +# SHOW_BIRTHDAY_ICON=true + +# Google tag manager id +#ANALYTICS_GTM_ID=user provided google tag manager id + +# limit conversation file imports to a certain number of bytes in size to avoid the container +# maxing out memory limitations by unremarking this line and supplying a file size in bytes +# such as the below example of 250 mib +# CONVERSATION_IMPORT_MAX_FILE_SIZE_BYTES=262144000 + +# Max size (bytes) of a code-execution artifact (docx/xlsx/csv/pptx/potx/text/pdf) rendered as an +# inline preview. Larger files fall back to download-only. Default: 2 MB (2097152). Note the +# rendered HTML is independently capped at 512 KB, so very rich files may still skip preview. +# FILE_PREVIEW_MAX_EXTRACT_BYTES=2097152 + + +#===============# +# REDIS Options # +#===============# + +# Enable Redis for caching and session storage +# USE_REDIS=true +# Enable Redis for resumable LLM streams (defaults to USE_REDIS value if not set) +# Set to false to use in-memory storage for streams while keeping Redis for other caches +# USE_REDIS_STREAMS=true +# Scheduled chats require shared Redis streams in multi-replica deployments. +# Set this only when the deployment truly runs one LibreChat process without Redis. +# Scheduled agents that can pause for approval or ask_user_question require both +# Redis streams for shared action state and a durable shared checkpointer. +# MongoDB is currently the built-in durable checkpointer (and the default). +# SCHEDULES_SINGLE_PROCESS=true +# Emergency global stop for both automatic and manual scheduled runs. +# SCHEDULES_DISABLED=true + +# Coalesce streamed model/tool-argument deltas into windowed Redis publications (ms). +# Unset or 0 (default) publishes per delta. 25 is recommended: it batches the publish +# EVAL and the durable append across the window (fewer Redis round trips and lower +# Redis CPU at high token rates) at the cost of up to one window of added delivery +# latency. Enable only after EVERY replica runs a build with batch-frame support; +# older subscribers drop coalesced frames. Values are capped at 1000. +# Keep the window <= the stream-smoothing cadence (`streamRate`, default 25ms): +# each smoothing tick emits its pieces in one burst, so a tick-sized window +# captures exactly one batch per tick; a larger window re-batches the paced +# deltas and quantizes the smoothed cadence at delivery. With smoothing +# disabled (`streamRate: 0`) there is no cadence to preserve — the window is +# then purely the Redis-cost vs delivery-latency tradeoff described above. +# STREAM_DELTA_COALESCE_MS=25 + +# Single Redis instance +# REDIS_URI=redis://127.0.0.1:6379 + +# Redis cluster (multiple nodes) +# REDIS_URI=redis://127.0.0.1:7001,redis://127.0.0.1:7002,redis://127.0.0.1:7003 +# Enable Redis cluster mode when connecting to a cluster through a single URI +# USE_REDIS_CLUSTER=true + +# Managed Redis services with a single endpoint may shard keys internally and reject multi-key DEL +# Set to true to delete keys individually and avoid CROSSSLOT errors while keeping single-node mode +# REDIS_CLUSTER_SAFE_DELETE=true + +# Redis with TLS/SSL encryption and CA certificate +# REDIS_URI=rediss://127.0.0.1:6380 +# REDIS_CA=/path/to/ca-cert.pem + +# Elasticache may need to use an alternate dnsLookup for TLS connections. see "Special Note: Aws Elasticache Clusters with TLS" on this webpage: https://www.npmjs.com/package/ioredis +# Enable alternative dnsLookup for redis +# REDIS_USE_ALTERNATIVE_DNS_LOOKUP=true + +# Redis authentication (if required) +# REDIS_USERNAME=your_redis_username +# REDIS_PASSWORD=your_redis_password + +# Redis key prefix configuration +# Use environment variable name for dynamic prefix (recommended for cloud deployments) +# REDIS_KEY_PREFIX_VAR=K_REVISION +# Or use static prefix directly +# REDIS_KEY_PREFIX=librechat + +# Redis connection limits +# REDIS_MAX_LISTENERS=40 + +# Minimum interval in milliseconds between Keyv reconnect attempts after a +# READONLY reply during standalone or Sentinel failover (default: 5000) +# REDIS_READONLY_RECOVERY_INTERVAL=5000 + +# Redis ping interval in seconds (0 = disabled, >0 = enabled) +# When set to a positive integer, Redis clients will ping the server at this interval to keep connections alive +# When unset or 0, no pinging is performed (recommended for most use cases) +# REDIS_PING_INTERVAL=300 + +# Milliseconds a heartbeat PING may go unanswered before the socket is presumed dead and +# reconnected (default: 5000). Applies to REDIS_PING_INTERVAL and the subscriber heartbeat. +# REDIS_PING_TIMEOUT=5000 + +# Heartbeat interval in seconds for dedicated pub/sub subscriber connections (default: 15, 0 = disabled) +# Subscribers carry no traffic between generations, so a peer that vanished without closing the +# socket would otherwise go unnoticed until the kernel gives up (about 15 minutes at Linux defaults) +# REDIS_SUBSCRIBER_PING_INTERVAL=15 + +# TCP keepalive idle delay in milliseconds for ioredis sockets (default: 10000, 0 = kernel default) +# REDIS_KEEP_ALIVE=10000 + +# Force specific cache namespaces to use in-memory storage even when Redis is enabled +# Comma-separated list of CacheKeys +# Defaults to CONFIG_STORE,APP_CONFIG so YAML-derived config stays per-container (safe for blue/green deployments) +# Set to empty string to force all namespaces through Redis: FORCED_IN_MEMORY_CACHE_NAMESPACES= +# FORCED_IN_MEMORY_CACHE_NAMESPACES=CONFIG_STORE,APP_CONFIG + +# Opt-in cache for authenticated user documents during request bursts. Requires Redis and +# the AUTH_USER_DOC namespace to remain Redis-backed (default: off; set exactly to "on"). +# AUTH_USER_CACHE_MODE=off + +# TTL in milliseconds for cached group memberships used in ACL permission checks (default: 300000 / 5 minutes; 0 disables) +# Membership changes invalidate affected entries immediately; the TTL bounds staleness from cross-process races. +# USER_PRINCIPALS_CACHE_TTL_MS=300000 +# Redis lock TTL in milliseconds for cross-container cache builds (default: 5000) +# 0 disables build locking only; the delayed stale-rewrite eviction pass still runs on Redis-backed stores. +# Only used when the USER_PRINCIPALS namespace is Redis-backed; non-Redis deployments use in-process deduplication. +# USER_PRINCIPALS_LOCK_TTL_MS=5000 +# Maximum time in milliseconds to wait for another container holding the lock to fill the cache +# before falling back to a direct database read (default: USER_PRINCIPALS_LOCK_TTL_MS) +# USER_PRINCIPALS_LOCK_WAIT_MS=5000 + +# Leader Election Configuration (for multi-instance deployments with Redis) +# Duration in seconds that the leader lease is valid before it expires (default: 25) +# LEADER_LEASE_DURATION=25 +# Interval in seconds at which the leader renews its lease (default: 10) +# LEADER_RENEW_INTERVAL=10 +# Maximum number of retry attempts when renewing the lease fails (default: 3) +# LEADER_RENEW_ATTEMPTS=3 +# Delay in seconds between retry attempts when renewing the lease (default: 0.5) +# LEADER_RENEW_RETRY_DELAY=0.5 + +#==================================================# +# Others # +#==================================================# +# You should leave the following commented out # + +# NODE_ENV= + +# E2E_USER_EMAIL= +# E2E_USER_PASSWORD= + +#=====================================================# +# Cache Headers # +#=====================================================# +# Headers that control caching of the index.html # +# Default configuration prevents caching to ensure # +# users always get the latest version. Customize # +# only if you understand caching implications. # + +# INDEX_CACHE_CONTROL=no-cache, no-store, must-revalidate +# INDEX_PRAGMA=no-cache +# INDEX_EXPIRES=0 + +# no-cache: Forces validation with server before using cached version +# no-store: Prevents storing the response entirely +# must-revalidate: Prevents using stale content when offline + +#=====================================================# +# OpenWeather # +#=====================================================# +OPENWEATHER_API_KEY= + +#======================# +# Web Search # +#======================# + +# Note: All of the following variable names can be customized. +# Omit values to allow user to provide them. + +# For more information on configuration values, see: +# https://librechat.ai/docs/features/web_search + +# Search Provider (Required) +# SERPER_API_KEY=your_serper_api_key + +# Tavily (Search Provider and/or Scraper) +# TAVILY_API_KEY=your_tavily_api_key + +# Keenable (Search Provider and/or Scraper; keyless by default, a key only lifts +# rate limits and covers both search and page fetch) +# KEENABLE_API_KEY=your_keenable_api_key +# Optional: Custom Keenable search API URL +# KEENABLE_API_URL=your_keenable_api_url +# Optional: Custom Keenable fetch API URL (used when scraperProvider is keenable) +# KEENABLE_FETCH_URL=your_keenable_fetch_api_url + +# Scraper (Required) +# FIRECRAWL_API_KEY=your_firecrawl_api_key +# Optional: Custom Firecrawl API URL +# FIRECRAWL_API_URL=your_firecrawl_api_url + +# Reranker (Required) +# JINA_API_KEY=your_jina_api_key +# or +# COHERE_API_KEY=your_cohere_api_key + +#======================# +# MCP Configuration # +#======================# + +# Treat 401/403 responses as OAuth requirement when no oauth metadata found +# MCP_OAUTH_ON_AUTH_ERROR=true + +# Timeout for OAuth detection requests in milliseconds +# MCP_OAUTH_DETECTION_TIMEOUT=5000 + +# How long to wait (ms) for a user to complete the OAuth flow before timing out (default: 10 minutes) +# MCP_OAUTH_HANDLING_TIMEOUT=600000 + +# TTL (ms) for OAuth flow state; must outlive MCP_OAUTH_HANDLING_TIMEOUT (default: 15 minutes) +# MCP_OAUTH_FLOW_TTL=900000 + +# Cache connection status checks for this many milliseconds to avoid expensive verification +# MCP_CONNECTION_CHECK_TTL=60000 + +# Max bytes allowed in a non-GET streamable HTTP MCP response before rejecting it. +# Set to 0 to disable. Default: 16777216 (16 MiB) +# MCP_STREAMABLE_HTTP_MAX_RESPONSE_BYTES=16777216 + +# Max bytes allowed in a single SSE line for non-GET streamable HTTP MCP responses. +# Set to 0 to disable. Default: 5242880 (5 MiB) +# MCP_STREAMABLE_HTTP_MAX_LINE_BYTES=5242880 + +# Skip code challenge method validation (e.g., for AWS Cognito that supports S256 but doesn't advertise it) +# When set to true, forces S256 code challenge even if not advertised in .well-known/openid-configuration +# MCP_SKIP_CODE_CHALLENGE_CHECK=false + +# Circuit breaker: max connect/disconnect cycles before tripping (per server) +# MCP_CB_MAX_CYCLES=7 + +# Circuit breaker: sliding window (ms) for counting cycles +# MCP_CB_CYCLE_WINDOW_MS=45000 + +# Circuit breaker: cooldown (ms) after the cycle breaker trips +# MCP_CB_CYCLE_COOLDOWN_MS=15000 + +# Circuit breaker: max consecutive failed connection rounds before backoff +# MCP_CB_MAX_FAILED_ROUNDS=3 + +# Circuit breaker: sliding window (ms) for counting failed rounds +# MCP_CB_FAILED_WINDOW_MS=120000 + +# Circuit breaker: base backoff (ms) after failed round threshold is reached +# MCP_CB_BASE_BACKOFF_MS=30000 + +# Circuit breaker: max backoff cap (ms) for exponential backoff +# MCP_CB_MAX_BACKOFF_MS=300000 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..91d5c04 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,120 @@ +services: + api: + # build: + # context: . + # dockerfile: Dockerfile.multi + # target: api-build + image: registry.librechat.ai/danny-avila/librechat-dev-api:latest + container_name: LibreChat-API + ports: + - 3080:3080 + depends_on: + - mongodb + - rag_api + restart: always + extra_hosts: + - "host.docker.internal:host-gateway" + env_file: + - .env + environment: + - HOST=0.0.0.0 + - NODE_ENV=production + - MONGO_URI=mongodb://mongodb:27017/LibreChat + - MEILI_HOST=http://meilisearch:7700 + - LIBRECHAT_TEMP_CREDENTIALS_PATH=/app/data/.env.temp + - RAG_PORT=${RAG_PORT:-8000} + - RAG_API_URL=http://rag_api:${RAG_PORT:-8000} + - PROXY=${PROXY:-} + - HTTP_PROXY=${HTTP_PROXY:-} + - HTTPS_PROXY=${HTTPS_PROXY:-} + - NO_PROXY=${NO_PROXY:-localhost,127.0.0.1,::1},${no_proxy:-},mongodb,chat-mongodb,meilisearch,chat-meilisearch,rag_api,vectordb,host.docker.internal + - http_proxy=${http_proxy:-} + - https_proxy=${https_proxy:-} + - no_proxy=${no_proxy:-localhost,127.0.0.1,::1},${NO_PROXY:-},mongodb,chat-mongodb,meilisearch,chat-meilisearch,rag_api,vectordb,host.docker.internal + - ADMIN_PANEL_URL=${ADMIN_PANEL_URL:-http://admin.localhost} + volumes: + - type: bind + source: ./librechat.yaml + target: /app/librechat.yaml + - ./images:/app/client/public/images + - ./uploads:/app/uploads + - ./logs:/app/api/logs + - ./skill:/app/skill + - librechat-data:/app/data + + admin-panel: + image: registry.librechat.ai/clickhouse/librechat-admin-panel:latest + container_name: admin-panel + depends_on: + - api + restart: always + environment: + - PORT=3000 + # Plain expansion (not :?) so `docker compose down`/`pull` still run when this is unset. + # The panel itself refuses to start without it; set ADMIN_PANEL_SESSION_SECRET in .env. + - SESSION_SECRET=${ADMIN_PANEL_SESSION_SECRET} + - API_SERVER_URL=http://api:3080 + - VITE_API_BASE_URL=${DOMAIN_CLIENT:-http://localhost} + - SESSION_COOKIE_SECURE=${ADMIN_PANEL_SESSION_COOKIE_SECURE:-false} + + client: + image: nginx:1.27.0-alpine + container_name: LibreChat-NGINX + ports: + - 80:80 + - 443:443 + depends_on: + - api + - admin-panel + restart: always + volumes: + - ./client/nginx.conf:/etc/nginx/conf.d/default.conf + + mongodb: + container_name: chat-mongodb + # ports: # Uncomment this to access mongodb from outside docker, not safe in deployment + # - 27018:27017 + image: mongo:8.0.20 + restart: always + volumes: + - ./data-node:/data/db + command: mongod --noauth + + meilisearch: + container_name: chat-meilisearch + image: getmeili/meilisearch:v1.35.1 + restart: always + # ports: # Uncomment this to access meilisearch from outside docker + # - 7700:7700 # if exposing these ports, make sure your master key is not the default value + env_file: + - .env + environment: + - MEILI_HOST=http://meilisearch:7700 + - MEILI_NO_ANALYTICS=true + volumes: + - ./meili_data_v1.35.1:/meili_data + + vectordb: + image: pgvector/pgvector:0.8.0-pg15-trixie + environment: + POSTGRES_DB: mydatabase + POSTGRES_USER: myuser + POSTGRES_PASSWORD: mypassword + restart: always + volumes: + - pgdata2:/var/lib/postgresql/data + + rag_api: + image: registry.librechat.ai/danny-avila/librechat-rag-api-dev-lite:latest + environment: + - DB_HOST=vectordb + - RAG_PORT=${RAG_PORT:-8000} + restart: always + depends_on: + - vectordb + env_file: + - .env + +volumes: + pgdata2: + librechat-data: \ No newline at end of file diff --git a/librechat.yaml b/librechat.yaml new file mode 100644 index 0000000..24ab205 --- /dev/null +++ b/librechat.yaml @@ -0,0 +1,1352 @@ +# For more information, see the Configuration Guide: +# https://www.librechat.ai/docs/configuration/librechat_yaml + +# Configuration version (required) +version: 1.3.15 + +# Cache settings: Set to true to enable caching +cache: true + +# Langfuse connections are managed through Settings > Langfuse when available. +# That flow verifies the credentials and stores the secret key encrypted; do not +# place a plaintext langfuse.secretKey in this file. Environment-managed central +# credentials and optional fanout routing are documented in .env.example. +# +# Self-hosted Langfuse behind an authenticating proxy or gateway can be given +# custom request headers. They are sent on every outbound Langfuse request — +# trace and media export, feedback scores, and credential verification. +# Values support ${ENV_VAR} interpolation; a header whose variable is unset is +# dropped with a warning rather than sent as a literal placeholder. +# +# These are deployment-level: trace export batches spans from every user through +# a single exporter, so unlike endpoints.custom headers they cannot carry +# per-user placeholders such as {{LIBRECHAT_USER_ID}}. +# +# Values are masked in admin config reads and in the startup config log, but +# prefer ${ENV_VAR} references over literal credentials here regardless. +# +# Scope: these are sent only when the deployment configures exactly ONE Langfuse +# origin (a self-hosted base URL, or a single tenant destination URL), and only +# to that origin. The map has no way to say which endpoint it authenticates to, +# so a deployment configuring several origins — e.g. a fanout collector plus a +# separate central host — gets a warning and no headers, rather than having a +# gateway credential sent somewhere it was not meant for. +# +# Fanout deployments additionally need collector support: the gateway forwards +# only Authorization upstream, so a tenant Langfuse behind its own proxy is not +# covered even when the collector receives these. +# +# Traces carry the internal user id as the Langfuse userId and no user or +# request metadata unless langfuse.trace opts in. userIdField picks the user +# field that becomes the trace userId (id, email, username, name, openidId, +# samlId, ldapId, googleId, githubId, discordId, appleId, facebookId); a user +# without a value for that field keeps the internal id. The two allowlists copy +# fields into trace metadata as librechat.user. (the userId fields plus +# role and provider) and librechat.conversation.id, librechat.endpoint, +# librechat.endpoint.type, librechat.provider, librechat.model, +# librechat.model.label, librechat.spec. +# +# langfuse: +# headers: +# CF-Access-Client-Id: "${CF_ACCESS_CLIENT_ID}" +# CF-Access-Client-Secret: "${CF_ACCESS_CLIENT_SECRET}" +# trace: +# userIdField: email +# userMetadataFields: [email, username, role, provider] +# conversationMetadataFields: [conversationId, endpoint, model, modelLabel, spec] + +# File storage configuration +# Single strategy for all file types (legacy format, still supported) +# fileStrategy: "s3" + +# Granular file storage strategies (new format - recommended) +# Allows different storage strategies for different file types +# fileStrategy: +# avatar: "s3" # Storage for user/agent avatar images +# image: "firebase" # Storage for uploaded images in chats +# document: "local" # Storage for document uploads (PDFs, text files, etc.) + +# Available strategies: "local", "s3", "firebase", "azure_blob", "cloudfront" +# If not specified, defaults to "local" for all file types +# You can mix and match strategies based on your needs: +# - Use S3 for avatars for fast global access +# - Use Firebase for images with automatic optimization +# - Use local storage for documents for privacy/compliance +# - Use CloudFront for CDN-accelerated delivery (requires S3 + cloudfront config below) + +# CloudFront CDN Configuration (optional) +# Use when fileStrategy: "cloudfront" or fileStrategies includes cloudfront +# Requires: AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME +# For signed cookies and direct download URLs: CLOUDFRONT_KEY_PAIR_ID, CLOUDFRONT_PRIVATE_KEY +# cloudfront: +# domain: "https://cdn.example.com" # CloudFront domain (CNAME recommended for cookies) +# distributionId: "E1234ABCD" # Required if invalidateOnDelete is true +# invalidateOnDelete: false # Create cache invalidation on file delete +# imageSigning: "none" # "none" (public) | "cookies" (signed cookies) +# # When imageSigning: "cookies", API + CloudFront must share a parent domain. +# # Cookies are path-scoped to inline assets only: +# # /i/... private uploaded/generated images, user-scoped +# # /a/... tenant-visible avatars, tenant-scoped when tenantId is present +# # Downloads, documents, uploads, and code outputs stay outside /i and /a and +# # use backend-authorized signed URLs instead of signed cookies. +# # API: api.example.com, CloudFront CNAME: cdn.example.com, cookieDomain: ".example.com" +# cookieDomain: ".example.com" # Required for "cookies" - shared parent domain +# cookieExpiry: 1800 # Cookie lifetime in seconds (max: 604800 / 7 days, default: 1800 / 30 min) +# urlExpiry: 3600 # Signed CloudFront download URL lifetime in seconds +# # Optional multi-region S3/CloudFront layout. Default: false. +# # When enabled, new object keys include: +# # /i/r/{storageRegion}/t/{tenantId}/images/{userId}/{file} (private inline images) +# # /a/r/{storageRegion}/t/{tenantId}/avatars/{userId}/{file} (tenant-visible avatars) +# # /r/{storageRegion}/t/{tenantId}/{basePath}/{userId}/{file} (non-inline files) +# # storageRegion defaults to AWS_REGION when omitted, but only affects new keys +# # when includeRegionInPath is true. Existing files are not moved automatically. +# # LibreChat does not configure CloudFront origins, Route53, or regional routing. +# storageRegion: "us-east-2" +# includeRegionInPath: false +# # Direct-download filename/content-type overrides require the CloudFront cache/origin +# # request policy to forward and cache on response-content-disposition and +# # response-content-type query strings to S3. +# # Recommended for download paths: attach a CloudFront response headers policy +# # with X-Content-Type-Options: nosniff and CSP default-src 'none'. + +# Skill sync configuration (optional) +# GitHub tokens are referenced from environment variables. Put the token in +# `.env`, then reference it here with `token: '${GITHUB_SKILLS_TOKEN}'`. Use a +# GitHub fine-grained personal access token scoped to the selected repository +# with read-only Contents and Metadata permissions. +# skillSync: +# github: +# enabled: false +# intervalMinutes: 60 +# runOnStartup: true +# sources: +# - id: librechat-skills +# owner: your-org +# repo: your-skills-repo +# ref: main +# paths: +# - skills +# # Number of directory levels below each configured path to scan for +# # `SKILL.md`. Use 2 for repos shaped like `skills//`. +# skillDiscoveryDepth: 2 +# token: '${GITHUB_SKILLS_TOKEN}' +# # Optional. Owns the mirrored skills under the given tenant so they are +# # created and shared within that tenant. Required for visibility when +# # tenant isolation is enabled. Omit for single-tenant deployments. +# # Treat as immutable per source id: changing (or adding/removing) the +# # tenantId later leaves previously mirrored skills in the old tenant, +# # where this source's sync can no longer see or clean them up. To move a +# # source between tenants, delete its mirrored skills in the old tenant +# # first, or use a new source id for the new tenant. +# # tenantId: your-tenant-id + +# Custom interface configuration +interface: + customWelcome: 'Welcome to LibreChat! Enjoy your experience.' + # Enable/disable file search as a chatarea selection (default: true) + # Note: This setting does not disable the Agents File Search Capability. + # To disable the Agents Capability, see the Agents Endpoint configuration instead. + fileSearch: true + # Privacy policy settings + privacyPolicy: + externalUrl: 'https://librechat.ai/privacy-policy' + openNewTab: true + + # Terms of service + termsOfService: + externalUrl: 'https://librechat.ai/tos' + openNewTab: true + modalAcceptance: true + modalTitle: 'Terms of Service for LibreChat' + modalContent: | + # Terms and Conditions for LibreChat + + *Effective Date: February 18, 2024* + + Welcome to LibreChat, the informational website for the open-source AI chat platform, available at https://librechat.ai. These Terms of Service ("Terms") govern your use of our website and the services we offer. By accessing or using the Website, you agree to be bound by these Terms and our Privacy Policy, accessible at https://librechat.ai//privacy. + + ## 1. Ownership + + Upon purchasing a package from LibreChat, you are granted the right to download and use the code for accessing an admin panel for LibreChat. While you own the downloaded code, you are expressly prohibited from reselling, redistributing, or otherwise transferring the code to third parties without explicit permission from LibreChat. + + ## 2. User Data + + We collect personal data, such as your name, email address, and payment information, as described in our Privacy Policy. This information is collected to provide and improve our services, process transactions, and communicate with you. + + ## 3. Non-Personal Data Collection + + The Website uses cookies to enhance user experience, analyze site usage, and facilitate certain functionalities. By using the Website, you consent to the use of cookies in accordance with our Privacy Policy. + + ## 4. Use of the Website + + You agree to use the Website only for lawful purposes and in a manner that does not infringe the rights of, restrict, or inhibit anyone else's use and enjoyment of the Website. Prohibited behavior includes harassing or causing distress or inconvenience to any person, transmitting obscene or offensive content, or disrupting the normal flow of dialogue within the Website. + + ## 5. Governing Law + + These Terms shall be governed by and construed in accordance with the laws of the United States, without giving effect to any principles of conflicts of law. + + ## 6. Changes to the Terms + + We reserve the right to modify these Terms at any time. We will notify users of any changes by email. Your continued use of the Website after such changes have been notified will constitute your consent to such changes. + + ## 7. Contact Information + + If you have any questions about these Terms, please contact us at contact@librechat.ai. + + By using the Website, you acknowledge that you have read these Terms of Service and agree to be bound by them. + + modelSelect: true + parameters: true + presets: true + prompts: + use: true + create: true + share: false + public: false + bookmarks: true + multiConvo: true + agents: + use: true + create: true + share: false + public: false + # Scheduled chats are experimental and disabled unless explicitly enabled. + # A deployment with Redis-backed resumable streams can run this on every replica. + # A single-process deployment without Redis must also set + # `SCHEDULES_SINGLE_PROCESS=true`; unsafe multi-replica writes fail closed. + # Scheduled agents that can pause require both `USE_REDIS_STREAMS=true` for + # shared action state and a durable shared checkpointer for graph continuation. + # MongoDB is currently the built-in durable checkpointer (and the default). + # schedules: + # use: true + # create: true + # maxPerUser: 10 + # minIntervalMinutes: 60 + # autoDisableAfterFailures: 5 + # # Maximum occurrences concurrently passing readiness admission per replica (1-100). + # admissionConcurrency: 20 + # fireConcurrency: 5 + # # Maximum MCP readiness connections opened at once by one schedule admission (1-10). + # mcpPreflightConcurrency: 3 + # # Maximum wall-clock time for one MCP readiness admission (1000-600000 ms). + # mcpPreflightTimeoutMs: 300000 + # # Require every schedule to be filed under a chat project. Enforced on + # # create/update AND at each fire, so turning it on stops (auto-disables) + # # schedules that predate it rather than letting their runs land loose. + # requireProject: false + # # Pin every scheduled run to ONE chat project, ignoring the user's choice. + # # Implies `requireProject`. Chat projects are user-owned, so a value set here + # # only makes sense as a per-user or per-role config override. + # # projectId: '000000000000000000000000' + peoplePicker: + users: true + groups: true + roles: true + marketplace: + use: false + fileCitations: true + # Show the thumbs up/thumbs down feedback buttons on responses (default: true) + feedback: true + # Tools pinned to the prompt bar by default for all users. + # Only seeds the initial state — once a user pins/unpins a tool, their choice is kept. + # Valid tool keys: artifacts, execute_code, web_search, file_search, skills. + # Use 'mcp' (or a specific MCP server name) to pin the MCP servers dropdown. + # When omitted, tools start unpinned and the MCP dropdown keeps its default (pinned). + # defaultPinnedTools: + # - 'artifacts' + # - 'execute_code' + # - 'mcp' + # Remote Agents configuration + # Controls user permissions for remote agents with external API support + # remoteAgents: + # use: false + # create: false + # share: false + # public: false + # MCP Servers configuration example + # Shared Links configuration + # Controls user permissions for shared links (e.g. sharing conversations via link) + # sharedLinks: + # create: false + # share: true + # public: true # Allows users to toggle "share with everyone" for their links. Whether anonymous access is permitted is controlled by ALLOW_SHARED_LINKS_PUBLIC. + # snapshotFiles: true # Snapshot files referenced by a shared chat so viewers can preview/download them via the link. Enabled by default; the SHARED_LINKS_SNAPSHOT_FILES env var overrides this. + # mcpServers: + # # Poll only while MCP controls are visible, in milliseconds (0 disables polling). + # toolsRefreshInterval: 300000 + # statusRefreshInterval: 30000 + # Controls user permissions for MCP (Model Context Protocol) server management + # - use: Allow users to use configured MCP servers + # - create: Allow users to create and manage new MCP servers + # - share: Allow users to share MCP servers with other users + # - public: Allow users to share MCP servers publicly (with everyone) + + # Creation / edit MCP server config Dialog config example + # trustCheckbox: + # label: + # en: 'I understand and I want to continue' + # de: 'Ich verstehe und möchte fortfahren' + # de-DE: 'Ich verstehe und möchte fortfahren' # You can narrow translation to regions like (de-DE or de-CH) + # subLabel: + # en: | + # Librechat hasn't reviewed this MCP server. Attackers may attempt to steal your data or trick the model into taking unintended actions, including destroying data. Learn more. + # de: | + # LibreChat hat diesen MCP-Server nicht überprüft. Angreifer könnten versuchen, Ihre Daten zu stehlen oder das Modell zu unbeabsichtigten Aktionen zu verleiten, einschließlich der Zerstörung von Daten. Mehr erfahren. + + # Temporary chat retention period in hours (default: 720, min: 1, max: 8760) + # temporaryChatRetention: 1 + # Regular chat retention in hours under retentionMode: "all" (min: 1, max: 8760). + # Defaults to the temporary chat retention policy when omitted. + # generalChatRetention: 2160 # 90 days, independently of temporary chats + # Existing stored deadlines are not migrated when these settings change. + # Retention mode: "all" applies expiry to all data types, "temporary" (default) only to temporary chats + # Before switching from "all" back to "temporary", remove retention deadlines from non-temporary data + # that should stop expiring: + # db.conversations.updateMany({ isTemporary: false, expiredAt: { $ne: null } }, { $unset: { expiredAt: 1 } }) + # db.messages.updateMany({ isTemporary: false, expiredAt: { $ne: null } }, { $unset: { expiredAt: 1 } }) + # MongoDB does not drop superseded indexes automatically. After upgrading, old Meili indexes + # such as "_meiliIndex_1_expiredAt_1" can be dropped from conversations/messages once the new + # "_meiliIndex_1_isTemporary_1_expiredAt_1" indexes exist. + # retentionMode: "temporary" + # Set retainAgentFiles to true to keep persistent agent resource files from expiring under + # retentionMode: "all"; non-agent files still expire. + # retainAgentFiles: false + +# Example Cloudflare turnstile (optional) +#turnstile: +# siteKey: "your-site-key-here" +# options: +# language: "auto" # "auto" or an ISO 639-1 language code (e.g. en) +# size: "normal" # Options: "normal", "compact", "flexible", or "invisible" + +# Example Registration Object Structure (optional) +registration: + socialLogins: ['github', 'google', 'discord', 'openid', 'facebook', 'apple', 'saml'] + # allowedDomains: + # - "gmail.com" + +# Example Balance settings +# balance: +# enabled: false +# startBalance: 20000 +# autoRefillEnabled: false +# refillIntervalValue: 30 +# refillIntervalUnit: 'days' +# refillAmount: 10000 + +# Example Transactions settings +# Controls whether to save transaction records to the database +# Default is true (enabled) +#transactions: +# enabled: false +# Note: If balance.enabled is true, transactions will always be enabled +# regardless of this setting to ensure balance tracking works correctly + +# Speech (STT/TTS) outbound requests to operator-provided target URLs are SSRF-guarded +# at connect time: private, loopback, link-local, and cloud-metadata targets are blocked +# by default. To point STT/TTS at a private or self-hosted service (LocalAI, a self-hosted +# Whisper server), add its host:port to `allowedAddresses` on the `stt` / `tts` section. +# SECURITY: `allowedAddresses` entries are trusted before the private-IP check. A listed +# host:port is permitted even when it resolves to a private IP, so list only hosts you fully +# control and that cannot be repointed by an attacker. Do not list attacker-controllable or +# DNS-rebindable hostnames, because doing so re-opens the private-address path this guard +# closes. Prefer a private IP literal over a hostname when exempting a private target. Entries +# must include a port (`host:port`, `private.ip:port`, or `[ipv6]:port`); do not use URLs, paths, +# CIDR ranges, bare hosts/IPs, or public IP literals. +# When a forward proxy is configured (PROXY / HTTP(S)_PROXY), it performs DNS and egress in its +# own network context, so these requests are delegated to it and it must be SSRF-enforcing; the +# connect-time guard only covers direct, non-proxied connections. +# speech: +# tts: +# openai: +# url: '' +# apiKey: '${TTS_API_KEY}' +# model: '' +# voices: [''] +# allowedAddresses: +# - 'localhost:8020' +# - '127.0.0.1:8020' +# +# stt: +# openai: +# url: '' +# apiKey: '${STT_API_KEY}' +# model: '' +# allowedAddresses: +# - 'localhost:8000' +# - '127.0.0.1:8000' + +# OCR (Mistral / Mistral-compatible) outbound requests to `ocr.baseURL` are SSRF-guarded at +# connect time with the same default-deny for private targets. To point OCR at a private or +# self-hosted Mistral-compatible service, add its host:port to `allowedAddresses`. The same +# trust caveat as speech applies: a listed host:port is trusted before the private-IP check, +# so list only hosts you fully control and that cannot be repointed by an attacker. Entries +# must include a port and must not be URLs, paths, CIDR ranges, bare hosts/IPs, or public IP +# literals. +# ocr: +# baseURL: '${OCR_BASEURL}' +# apiKey: '${OCR_API_KEY}' +# allowedAddresses: +# - 'localhost:8080' +# - '127.0.0.1:8080' + +# rateLimits: +# # Authenticated agent-event admission has its own API-key-principal bucket. +# agentEvents: +# userMax: 40 +# userWindowInMinutes: 1 +# fileUploads: +# ipMax: 100 +# ipWindowInMinutes: 60 # Rate limit window for file uploads per IP +# userMax: 50 +# userWindowInMinutes: 60 # Rate limit window for file uploads per user +# conversationsImport: +# ipMax: 100 +# ipWindowInMinutes: 60 # Rate limit window for conversation imports per IP +# userMax: 50 +# userWindowInMinutes: 60 # Rate limit window for conversation imports per user + +# Agent Actions domain restrictions (OpenAPI spec validation) +# SECURITY: If not configured, SSRF targets are blocked (localhost, private IPs, .internal/.local TLDs). +# Prefer `allowedAddresses` for permitting internal targets — adding a private IP to +# `allowedDomains` switches the field into strict-whitelist mode and blocks every +# public destination not also listed. +# Supports wildcards: '*.example.com' and protocol/port restrictions: 'https://api.example.com:8443' +actions: + allowedDomains: + - 'swapi.dev' + - 'librechat.ai' + - 'google.com' + # - 'http://10.225.26.25:7894' # Internal IP with protocol/port (uncomment if needed) + # `allowedAddresses` is an SSRF exemption list, NOT a strict whitelist. + # Hostname/IP + port pairs listed here bypass the default-deny block for that + # one private/loopback/link-local service. Public domains continue to work + # normally — listing private targets here does not restrict access to anything else. + # + # Entries must include a port: `host:port`, `private.ip:port`, or `[ipv6]:port`. + # Do not use URLs, paths, CIDR ranges, bare hosts/IPs, or public IP literals. + # Public IP literals are rejected at config load (the field is scoped to + # private IP space; public IPs aren't SSRF targets). + # + # NOTE on hostnames: a hostname entry trusts whatever IP that name resolves to + # on the listed port. If DNS for that name is hijacked or rotated to a different + # private IP, the exemption follows. Only list hostnames whose DNS you control. + # Prefer literal IPs when you can. + # allowedAddresses: + # - 'host.docker.internal:11434' + # - '127.0.0.1:11434' + # - '10.0.0.5:8080' + +# Custom endpoint baseURL exemption list +# SECURITY: User-provided baseURLs (`baseURL: 'user_provided'`) are validated against +# the same SSRF block as Actions and MCP. If your users legitimately point at private +# services (self-hosted Ollama, internal LLM gateway, etc.), list those hostname/IP +# + port pairs here so the validator allows them through. Public destinations are +# unaffected. +# +# Entries must include a port: `host:port`, `private.ip:port`, or `[ipv6]:port`. +# Do not use URLs, paths, CIDR ranges, bare hosts/IPs, or public IP literals. +# Hostname entries trust whatever IP they resolve to on the listed port — only +# list names whose DNS you control. +# endpoints: +# allowedAddresses: +# - 'localhost:11434' +# - '127.0.0.1:11434' +# - 'ollama:11434' +# - '10.0.0.5:8080' + +# MCP Server domain restrictions for remote transports (SSE, WebSocket, HTTP) +# SECURITY: If not configured, SSRF targets are blocked (localhost, private IPs, .internal/.local TLDs). +# Prefer `allowedAddresses` for permitting internal targets — adding a private host to +# `allowedDomains` switches the field into strict-whitelist mode and blocks every +# public destination not also listed. +# Supports wildcards: '*.example.com' matches 'api.example.com', 'staging.example.com', etc. +# Supports protocol/port restrictions: 'https://api.example.com:8443' restricts to specific protocol/port. +# mcpSettings: +# allowedDomains: +# - 'host.docker.internal' # Docker host access (required for Docker setups) +# - 'localhost' # Local development +# - '*.example.com' # Wildcard subdomain +# - 'https://secure.api.com' # Protocol-restricted +# - 'http://internal:8080' # Protocol and port restricted +# # allowedAddresses is an SSRF exemption list (private-IP-space only). +# # Hostname/IP + port pairs listed here bypass the default-deny block for that +# # one private service; public destinations remain reachable. Useful when you +# # want default SSRF protection AND specific internal MCP servers. Entries must +# # include a port (`host:port`, `private.ip:port`, or `[ipv6]:port`) and must +# # not be URLs, paths, CIDR ranges, bare hosts/IPs, or public IP literals. +# # Hostname entries trust whatever IP they resolve to on the listed port. +# allowedAddresses: +# - 'host.docker.internal:8080' +# - '127.0.0.1:8080' + +# Example MCP Servers Object Structure +# mcpServers: +# everything: +# # type: sse # type can optionally be omitted +# url: http://localhost:3001/sse +# # proxy: "${MCP_PROXY_URL}" # optional outbound proxy (http/https/socks/socks5) +# timeout: 60000 # 1 minute timeout for this server, this is the default timeout for MCP servers. +# private-openid: +# type: streamable-http +# url: https://mcp.example.com/mcp +# headers: +# # Trusted operator configs automatically use the live session token and replace the +# # connection once after a 401/403. A rejected tools/call is never replayed automatically. +# # Enabled oauth or obo configuration takes precedence over this passthrough mode. +# Authorization: "Bearer {{LIBRECHAT_OPENID_ACCESS_TOKEN}}" +# puppeteer: +# type: stdio +# command: npx +# args: +# - -y +# - "@modelcontextprotocol/server-puppeteer" +# timeout: 300000 # 5 minutes timeout for this server +# filesystem: +# # type: stdio +# command: npx +# args: +# - -y +# - "@modelcontextprotocol/server-filesystem" +# - /home/user/LibreChat/ +# iconPath: /home/user/LibreChat/client/public/assets/logo.svg +# mcp-obsidian: +# command: npx +# args: +# - -y +# - "mcp-obsidian" +# - /path/to/obsidian/vault + +# Definition of custom endpoints +endpoints: + # assistants: + # disableBuilder: false # Disable Assistants Builder Interface by setting to `true` + # pollIntervalMs: 3000 # Polling interval for checking assistant updates + # timeoutMs: 180000 # Timeout for assistant operations + # # Should only be one or the other, either `supportedIds` or `excludedIds` + # supportedIds: ["asst_supportedAssistantId1", "asst_supportedAssistantId2"] + # # excludedIds: ["asst_excludedAssistantId"] + # # Only show assistants that the user created or that were created externally (e.g. in Assistants playground). + # # privateAssistants: false # Does not work with `supportedIds` or `excludedIds` + # # (optional) Models that support retrieval, will default to latest known OpenAI models that support the feature + # retrievalModels: ["gpt-4-turbo-preview"] + # # (optional) Assistant Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below. + # capabilities: ["code_interpreter", "retrieval", "actions", "tools", "image_vision"] + # agents: + # # (optional) Default recursion depth for agents, defaults to 25 + # recursionLimit: 50 + # # (optional) Max recursion depth for agents, defaults to 25 + # maxRecursionLimit: 100 + # # (optional) Abort a run once a single streamed tool call's arguments exceed this many bytes. + # # Guards against runaway malformed tool-call generation. Defaults to 65536 (64 KiB); 0 disables. + # maxToolCallArgBytes: 65536 + # # (optional) Abort a run once a single model generation emits more than this many stream events. + # # Defense in depth against looping provider streams. Disabled by default. + # maxDeltaEventsPerTurn: 100000 + # # (optional) Per-tool overrides for maxToolCallArgBytes, keyed by tool name; 0 disables that + # # tool's guard. LibreChat ships { create_file: 131072 } so document-sized file writes are not + # # cut off; entries here merge over (and can replace) that default. + # maxToolCallArgBytesByTool: + # create_file: 131072 + # # (optional) Disable the builder interface for agents + # disableBuilder: false + # # (optional) When conversation titles are generated: + # # immediate (default): generate as soon as the request is made, in parallel + # # with the response, from the user's first message (title appears within ~1-2s). + # # final: defer generation until the full response completes (legacy behavior). + # # Set under `endpoints.all` instead to apply as the global default for all endpoints. + # titleTiming: immediate + # # (optional) Generate one-line headers for blocks of Agent reasoning and tool calls. + # # Header generation is a separate model call whose usage and cost are recorded. + # activityLabel: true + # activityEndpoint: openAI + # activityModel: gpt-4.1-nano + # # activityPrompt: 'Write a short activity label...' + # # activityMaxPerRun: 20 + # # activityCharLimit: 600 + # # (optional) Replace the generic Thinking/Thoughts heading with a live + # # generated orientation as sufficiently long top-level reasoning evolves. + # # Enabling this sends a bounded snapshot (up to 4,000 characters) of the + # # visible reasoning to the resolved label endpoint, which may be a different provider. + # # With Langfuse tracing enabled, that snapshot is also recorded as generation input + # # unless the active redaction policy suppresses the label call. + # # reasoningLabel: true + # # reasoningLabelModel: gpt-4.1-nano # falls back to activity/title/run model + # # reasoningLabelEndpoint: openAI # falls back to activity/run endpoint + # # reasoningLabelPrompt: 'Describe the current reasoning direction...' + # # reasoningLabelMinChars: 500 # text required before the first label + # # reasoningLabelUpdateChars: 400 # new text between streaming revisions + # # reasoningLabelUpdateIntervalMs: 3000 # minimum time between streaming revisions + # # A final rewrite may run immediately after a meaningful 120-character tail. + # # reasoningLabelMaxPerRun: 8 # provider-call cap per response + # # (optional) Maximum total citations to include in agent responses, defaults to 30 + # maxCitations: 30 + # # (optional) Maximum citations per file to include in agent responses, defaults to 7 + # maxCitationsPerFile: 7 + # # (optional) Minimum relevance score for sources to be included in responses, defaults to 0.45 (45% relevance threshold) + # # Set to 0.0 to show all sources (no filtering), or higher like 0.7 for stricter filtering + # minRelevanceScore: 0.45 + # # (optional) Maximum explicit subagents per agent, for both the flat list and + # # graph definitions. Defaults to 10; hard cap 50. + # maxSubagents: 20 + # # (optional) Maximum concurrent Code API uploads per route and user. Defaults to 3. + # codeApiUploadConcurrency: 3 + # # (optional) Maximum total time spent waiting on Code API rate limits. Defaults to 20000 ms. + # codeApiMaxRetryWaitMs: 20000 + # # (optional) Cap the number of active accessible skills shown in the model-visible catalog. + # # Useful for large organizations where many department-specific skills may be available. + # skills: + # maxCatalogSkills: 20 + # # (optional) Agent Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below. + # capabilities: ["deferred_tools", "execute_code", "file_search", "web_search", "artifacts", "subagents", "actions", "context", "skills", "memory", "ask_user_question", "tools", "chain", "ocr"] + # # The following capabilities are opt-in and must be added explicitly: + # # "programmatic_tools", "stateful_code_sessions", "run_in_background", "tool_intents" + # # "stateful_code_sessions" is highly experimental and may change substantially. + # # (optional) Limit the workspace scopes users may select. Omit to allow all three. + # statefulCodeSessions: + # allowedEnvironments: ["user", "agent-user", "conversation"] + # # Personal BYOM enrollment. Requires allowPrincipalWorkers on a control plane. + # # Omitted values default to enabled and five registered environments per user. + # # Principal config overrides may tighten, but cannot raise, this ceiling. + # # Lowering the limit, or disabling enrollment, does not revoke existing machines. + # # This counts registered environments across control planes, not online workers. + # principalWorkers: + # enabled: true + # maxPerUser: 25 + # # Route an agent to an operator-managed Code API or to a Code API whose + # # `remote-bridge` backend leases work to an outbound @librechat/code worker. + # environments: + # - id: managed-default + # name: Managed Code API + # type: managed + # baseURL: https://code.example.com/v1 + # default: true + # - id: engineering-vm + # name: Engineering VM + # type: attached + # baseURL: https://code-bridge.example.com/v1 + # # Pins an administrator-managed environment to one worker. + # owner: deployment + # pairing: + # workerId: engineering-vm + # tokenEnv: CODE_BRIDGE_ADMIN_TOKEN + # - id: personal-workers + # name: Personal Code Workers + # type: attached + # baseURL: https://code-bridge.example.com/v1 + # # Lets authenticated users create principal-bound environments and + # # receive a one-time code for an outbound @librechat/code worker. + # # The administrator secret stays in the named environment variable. + # owner: deployment + # # Optionally expose only these bounded preferences to environment owners. + # configSchema: + # limits: + # # Maximum Bash execution budget the model may request per call. + # # Omit to preserve the historical 30-second limit. Hard cap: 300000. + # maxCommandTimeoutMs: 120000 + # permissions: + # fileWrite: + # allowed: [allow, ask, deny] + # default: ask + # commandExecution: + # # Add allow to offer Full access in the chat composer. Both + # # permission categories must permit allow; defaults can stay ask. + # # Full access skips routine code prompts within the worker sandbox. + # # Explicit endpoint ask/deny rules and hooks still apply. + # allowed: [ask, deny] + # default: ask + # pairing: + # allowPrincipalWorkers: true + # tokenEnv: CODE_BRIDGE_ADMIN_TOKEN + # # (optional) Trusted origin for internal event delivery. By default, LibreChat + # # uses its own bound listener; override only for an internal TLS/front-door route. + # eventDriven: + # # selfUrl: 'https://librechat.internal' + # # (optional) Automatic conversational delivery for supported completed background tasks. + # # Enabled by default; set false to keep background tools and subagents poll-only. + # backgroundTasks: + # completionWakeups: true + # # Allow owners to cooperatively cancel ordinary background tools, including BYOM Bash. + # ordinaryToolCancellation: false + # # "run_in_background" makes Code Interpreter tools eligible by default and enables per-tool MCP opt-in. + # # "tool_intents" enables live model-written labels for native tools and opted-in MCP tools. + # # (optional) Require user approval before matching tool calls. Disabled by default. + # toolApproval: + # enabled: true + # mode: default # default, dontAsk, or bypass + # allow: ["mcp:trusted-server:read_*"] + # deny: ["mcp:*:delete_*"] # Deny rules always take precedence + # ask: ["mcp:*:*"] + # reason: "Review {tool} before it runs." + # # (optional) Persist Agent runs paused for approval or Ask User. MongoDB is the durable default. + # checkpointer: + # type: mongo # mongo (default) or memory (single-process development only) + # ttl: 86400 # Approval window in seconds; defaults to 24 hours + # # (optional) Authenticate machine clients for the Agent Management API. + # # Each verified OAuth client is bound server-side to one existing LibreChat + # # user and tenant; that user's normal role and Agent ACLs still apply. + # managementApi: + # auth: + # oidc: + # enabled: true + # issuer: 'https://identity.example.com/' + # audience: 'https://librechat.example.com/agents' + # # jwksUri: 'https://identity.example.com/.well-known/jwks.json' + # clients: + # - clientId: 'machine-client-id' + # # subject: 'provider-specific-service-principal-subject' + # userId: '507f1f77bcf86cd799439011' + # tenantId: 'tenant-id' + + # (optional) Custom request headers for the built-in OpenAI / Google endpoints. + # Forwarded on every request to the provider (or an AI gateway / reverse proxy + # in front of it) while keeping provider-native request shaping intact. Values + # support env vars (${VAR}), user fields ({{LIBRECHAT_USER_*}}), and request-body + # fields ({{LIBRECHAT_BODY_CONVERSATIONID}}). Set the same `headers:` block under + # `endpoints.all` to apply globally across endpoints (endpoint values win on key + # collisions). NOTE: send metadata headers like these only behind a gateway that + # consumes them — native provider APIs ignore unknown headers. + # openAI: + # headers: + # cf-aig-metadata: '{"user_email":"{{LIBRECHAT_USER_EMAIL}}","app":"librechat"}' + # google: + # headers: + # cf-aig-metadata: '{"user_email":"{{LIBRECHAT_USER_EMAIL}}","app":"librechat"}' + + # Anthropic endpoint configuration with Vertex AI support + # Use this to run Anthropic Claude models through Google Cloud Vertex AI + # anthropic: + # # (optional) Override the adaptive stream-smoothing cadence in milliseconds. + # # Agents SDK-backed providers smooth at 25ms by default; set 0 to disable + # # smoothing. (Legacy Assistants/Ollama paths sleep this long per chunk instead.) + # streamRate: 20 + # # (optional) Title model for conversation titles + # titleModel: claude-3.5-haiku # Use the visible model name (key from models config) + # # (optional) Custom request headers, same placeholder resolution as above. + # # Useful for correlating reverse-proxied requests by conversation, since an + # # unknown header is simply ignored by the native Anthropic API. + # headers: + # cf-aig-metadata: '{"user_email":"{{LIBRECHAT_USER_EMAIL}}","app":"librechat"}' + # X-Conversation-Id: '{{LIBRECHAT_BODY_CONVERSATIONID}}' + # + # # Vertex AI Configuration - enables running Claude models via Google Cloud + # # This is similar to Azure OpenAI but for Anthropic models on Google Cloud + # # Vertex AI is automatically enabled when this config section is present + # vertex: + # # Vertex AI region (optional, defaults to 'us-east5') + # # Available regions: us-east5, us-central1, europe-west1, europe-west4, asia-southeast1 + # # Multi-region endpoints: us, eu, global + # # IMPORTANT: specific regional endpoints only serve Claude Sonnet 4.6 and earlier. Newer + # # models (Opus 4.7+, Opus 5, Sonnet 5, Fable 5/5.1) require "global" or a multi-region value + # # ("us"/"eu") and will 404 on a specific region. "global" also avoids the 10% regional premium. + # region: "us-east5" + # # Path to Google service account key file (optional) + # # If not specified, uses GOOGLE_SERVICE_KEY_FILE env var or default path (api/data/auth.json) + # # The project_id is automatically extracted from the service key file + # # serviceKeyFile: "/path/to/service-account.json" + # # Google Cloud Project ID (optional) - auto-detected from service key file + # # Only specify if you need to override the project_id in your service key + # # projectId: "${VERTEX_PROJECT_ID}" + # + # # ============================================================================ + # # Model Configuration - Set Visible Model Names and Deployment Mappings + # # Similar to Azure OpenAI model naming pattern + # # ============================================================================ + # + # # Option 1: Simple array (legacy format - model name = deployment name) + # # Use this if you want the technical model IDs to show in the UI + # # models: + # # - "claude-fable-5-1" + # # - "claude-fable-5" + # # - "claude-opus-5" + # # - "claude-opus-4-8" + # # - "claude-sonnet-4-6" + # # - "claude-3-7-sonnet-20250219" + # # - "claude-3-5-sonnet-v2@20241022" + # # - "claude-3-5-haiku@20241022" + # + # # Option 2: Object format with custom visible names (RECOMMENDED) + # # The key is the visible model name shown in the UI (can be any name you want) + # # The deploymentName is the actual Vertex AI model ID used for API calls + # # You can use friendly names (avoid spaces for cleaner YAML) or technical IDs as keys + # models: + # claude-fable-5.1: + # deploymentName: claude-fable-5-1 + # claude-fable-5: + # deploymentName: claude-fable-5 + # claude-opus-5: + # deploymentName: claude-opus-5 + # claude-opus-4.8: + # deploymentName: claude-opus-4-8 + # claude-opus-4.5: + # deploymentName: claude-opus-4-5@20251101 + # claude-sonnet-4: + # deploymentName: claude-sonnet-4-6 + # claude-3.7-sonnet: + # deploymentName: claude-3-7-sonnet-20250219 + # claude-3.5-sonnet: + # deploymentName: claude-3-5-sonnet-v2@20241022 + # claude-3.5-haiku: + # deploymentName: claude-3-5-haiku@20241022 + # + # # Option 3: Mixed format with default deploymentName + # # Set a default deploymentName and use boolean values for models + # # deploymentName: claude-sonnet-4-6 + # # models: + # # claude-sonnet-4: true # Will use the default deploymentName + # # claude-3.5-haiku: + # # deploymentName: claude-3-5-haiku@20241022 # Override for this model + + custom: + # Anthropic-compatible Example (native `/v1/messages` API) + # Set `provider: anthropic` to use the native Anthropic client instead of the + # default OpenAI-compatible one — for Anthropic itself or Anthropic-compatible + # gateways (e.g. AI gateways, OpenCode Zen). The `baseURL` must be the API root + # the Anthropic SDK appends `/v1/messages` to. List models explicitly: model + # auto-fetch uses the OpenAI `/models` convention and is not used for this provider. + - name: 'Claude-Compatible' + provider: 'anthropic' + apiKey: '${ANTHROPIC_API_KEY}' + baseURL: 'https://api.anthropic.com' + # (optional) headers forwarded on every request (e.g. for a reverse proxy); + # values support the same placeholders as built-in endpoints. + headers: + anthropic-version: '2023-06-01' + models: + default: + - 'claude-sonnet-4-5' + - 'claude-opus-4-5' + fetch: false + titleConvo: true + titleModel: 'claude-sonnet-4-5' + # Agent activity groups: collapse each block of reasoning + tool calls + # under a generated one-line header. Same shape as the title options. + activityLabel: true + activityModel: 'claude-3-5-haiku' + # activityEndpoint: 'anthropic' # run labels on another endpoint's credentials + # activityPrompt: 'Write a 5-9 word past-tense label...' + # activityMaxPerRun: 20 # cost cap per response + # activityCharLimit: 600 # per-entry prompt truncation + # Parent phase summaries are an independent opt-in. They collapse 2+ + # logical activities before the answer into one run-level summary. + # activityPhaseLabel: true + # activityPhaseModel: 'claude-3-5-haiku' # falls back to activity/title/run model + # activityPhaseEndpoint: 'anthropic' # falls back to activity/run endpoint + # activityPhasePrompt: 'Summarize the completed agent phase...' + # activityPhaseMaxPerRun: 5 # cost cap per response + # Live reasoning labels are also independent. They update one top-level + # THINK heading in place and never create or shift message content parts. + # Enabling this sends a bounded snapshot (up to 4,000 characters) of the + # visible reasoning to the resolved label endpoint, which may be a different provider. + # With Langfuse tracing enabled, that snapshot is also recorded as generation input + # unless the active redaction policy suppresses the label call. + # reasoningLabel: true + # reasoningLabelModel: 'claude-3-5-haiku' # falls back to activity/title/run model + # reasoningLabelEndpoint: 'anthropic' # falls back to activity/run endpoint + # reasoningLabelPrompt: 'Describe the current reasoning direction...' + # reasoningLabelMinChars: 500 + # reasoningLabelUpdateChars: 400 + # reasoningLabelUpdateIntervalMs: 3000 + # A final rewrite may run immediately after a meaningful 120-character tail. + # reasoningLabelMaxPerRun: 8 + modelDisplayLabel: 'Claude (Compatible)' + + # Groq Example + - name: 'groq' + apiKey: '${GROQ_API_KEY}' + baseURL: 'https://api.groq.com/openai/v1/' + models: + default: + - 'llama3-70b-8192' + - 'llama3-8b-8192' + - 'llama2-70b-4096' + - 'mixtral-8x7b-32768' + - 'gemma-7b-it' + fetch: false + titleConvo: true + titleModel: 'mixtral-8x7b-32768' + modelDisplayLabel: 'groq' + + # Mistral AI Example + - name: 'Mistral' # Unique name for the endpoint + # For `apiKey` and `baseURL`, you can use environment variables that you define. + # recommended environment variables: + apiKey: '${MISTRAL_API_KEY}' + baseURL: 'https://api.mistral.ai/v1' + + # Models configuration + models: + # List of default models to use. At least one value is required. + default: ['mistral-tiny', 'mistral-small', 'mistral-medium'] + # Fetch option: Set to true to fetch models from API. + fetch: true # Defaults to false. + + # Optional configurations + + # Title Conversation setting + titleConvo: true # Set to true to enable title conversation + + # Title Method: Choose between "completion" or "functions". + # titleMethod: "completion" # Defaults to "completion" if omitted. + + # Title Model: Specify the model to use for titles. + titleModel: 'mistral-tiny' # Defaults to "gpt-3.5-turbo" if omitted. + + # Summarize setting: Set to true to enable summarization. + # summarize: false + + # Summary Model: Specify the model to use if summarization is enabled. + # summaryModel: "mistral-tiny" # Defaults to "gpt-3.5-turbo" if omitted. + + # The label displayed for the AI model in messages. + modelDisplayLabel: 'Mistral' # Default is "AI" when not set. + + # Add additional parameters to the request. Default params will be overwritten. + # addParams: + # safe_prompt: true # This field is specific to Mistral AI: https://docs.mistral.ai/api/ + + # Drop Default params parameters from the request. See default params in guide linked below. + # NOTE: For Mistral, it is necessary to drop the following parameters or you will encounter a 422 Error: + dropParams: ['stop', 'user', 'frequency_penalty', 'presence_penalty'] + + # OpenRouter Example + - name: 'OpenRouter' + # For `apiKey` and `baseURL`, you can use environment variables that you define. + # recommended environment variables: + apiKey: '${OPENROUTER_KEY}' + baseURL: 'https://openrouter.ai/api/v1' + headers: + x-librechat-body-parentmessageid: '{{LIBRECHAT_BODY_PARENTMESSAGEID}}' + models: + default: ['meta-llama/llama-3-70b-instruct'] + fetch: true + titleConvo: true + titleModel: 'meta-llama/llama-3-70b-instruct' + # Recommended: Drop the stop parameter from the request as Openrouter models use a variety of stop tokens. + dropParams: ['stop'] + modelDisplayLabel: 'OpenRouter' + + # AWS Bedrock Example + # Note: Bedrock endpoint is configured via environment variables + # bedrock: + # # Models Configuration + # # Specify which models are available (equivalent to BEDROCK_AWS_MODELS env variable) + # models: + # - "anthropic.claude-3-7-sonnet-20250219-v1:0" + # - "anthropic.claude-3-5-sonnet-20241022-v2:0" + # + # # Inference Profiles Configuration + # # Maps model IDs to their inference profile ARNs + # # IMPORTANT: The model ID (key) MUST be a valid AWS Bedrock model ID that you've added to the models list above + # # The ARN (value) is the inference profile you wish to map to for that model + # # Both the model ID and ARN are sent to AWS - the model ID for validation/metadata, the ARN for routing + # inferenceProfiles: + # "us.anthropic.claude-sonnet-4-6": "${BEDROCK_INFERENCE_PROFILE_CLAUDE_SONNET}" + # "anthropic.claude-3-7-sonnet-20250219-v1:0": "arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/abc123" + # + # # Guardrail Configuration + # guardrailConfig: + # guardrailIdentifier: "your-guardrail-id" + # guardrailVersion: "1" + # + # # Trace behavior for debugging (optional) + # # - "enabled": Include basic trace information about guardrail assessments + # # - "enabled_full": Include comprehensive trace details (recommended for debugging) + # # - "disabled": No trace information (default) + # # Trace output is logged to application log files for compliance auditing + # trace: "enabled" +# Example modelSpecs configuration showing grouping options +# The 'group' field organizes model specs in the UI selector: +# - If 'group' matches an endpoint name (e.g., "openAI", "groq"), the spec appears nested under that endpoint +# - If 'group' is a custom name (doesn't match any endpoint), it creates a separate collapsible section +# - If 'group' is omitted, the spec appears as a standalone item at the top level +# +# The 'groupIcon' field sets an icon for custom groups: +# - Only needs to be set on one spec per group (first one is used) +# - Can be a URL or a built-in endpoint key (e.g., "openAI", "anthropic", "groq") +# modelSpecs: +# list: +# # Example 1: Nested under an endpoint (grouped with openAI endpoint) +# - name: "gpt-4o" +# label: "GPT-4 Optimized" +# description: "Most capable GPT-4 model with multimodal support" +# # default: true # Hard admin default; takes precedence over prior user choices +# # softDefault: true # First-time default only; skipped after a user selects a model/spec/agent +# # showInMenu: false # Hide from the model selector while keeping explicit `spec` access +# group: "openAI" # String value matching the endpoint name +# preset: +# endpoint: "openAI" +# model: "gpt-4o" +# # Skills can be enabled per model spec. Use true for the user's active +# # accessible skill catalog, false to force skills off, or a name list as +# # a strict allowlist for catalog, manual, and always-apply resolution. +# # skills: ["brand-guidelines", "code-review"] +# # Subagents can be enabled per model spec. `allowSelf: true` lets the +# # ephemeral agent spawn a fresh isolated copy of itself for focused work. +# # subagents: +# # enabled: true +# # allowSelf: true +# # agent_ids: [] +# +# # Example 2: Nested under a custom endpoint (grouped with groq endpoint) +# - name: "llama3-70b-8192" +# label: "Llama 3 70B" +# description: "Fastest inference available - great for quick responses" +# group: "groq" # String value matching your custom endpoint name from endpoints.custom +# preset: +# endpoint: "groq" +# model: "llama3-70b-8192" +# +# # Example 3: Custom group with icon (creates a separate collapsible section) +# - name: "coding-assistant" +# label: "Coding Assistant" +# description: "Specialized for coding tasks" +# group: "my-assistants" # Custom string - doesn't match any endpoint, so creates its own group +# groupIcon: "https://example.com/icons/assistants.png" # Icon URL for the group +# preset: +# endpoint: "openAI" +# model: "gpt-4o" +# instructions: "You are an expert coding assistant..." +# temperature: 0.3 +# +# - name: "writing-assistant" +# label: "Writing Assistant" +# description: "Specialized for creative writing" +# group: "my-assistants" # Same custom group name - both specs appear in same section +# # No need to set groupIcon again - the first spec's icon is used +# preset: +# endpoint: "anthropic" +# model: "claude-sonnet-4" +# instructions: "You are a creative writing expert..." +# +# # Example 4: Custom group using built-in icon key +# - name: "fast-models" +# label: "Fast Response Model" +# group: "Fast Models" +# groupIcon: "groq" # Uses the built-in Groq icon +# preset: +# endpoint: "groq" +# model: "llama3-8b-8192" +# +# # Example 5: Standalone (no group - appears at top level) +# - name: "general-assistant" +# label: "General Assistant" +# description: "General purpose assistant" +# # No 'group' field - appears as standalone item at top level (not nested) +# # hideBadgeRow: true # Optional: hides the tool badge row for this spec +# preset: +# endpoint: "openAI" +# model: "gpt-4o-mini" + +# Automatic conversation summarization (optional) +# summarization: +# enabled: true +# provider: "openAI" +# model: "gpt-4o-mini" +# retainRecent: +# turns: 2 # Keep the newest complete user/assistant turns outside the summary +# tokens: 2000 # Also preserve up to this many recent tokens + +# fileConfig: +# fileContextSizeLimit: 128 # Maximum aggregate model-bound attachment size in one agent turn (MB) +# fileContextCharLimit: 1000000 # Maximum aggregate extracted-text characters in one agent turn +# endpoints: +# agents: +# fileLimit: 10 +# assistants: +# fileLimit: 5 +# fileSizeLimit: 10 # Maximum size for an individual file in MB +# totalSizeLimit: 50 # Maximum total size for all files in a single request in MB +# supportedMimeTypes: +# - "image/.*" +# - "application/pdf" +# openAI: +# disabled: true # Disables file uploading to the OpenAI endpoint +# default: +# totalSizeLimit: 20 +# YourCustomEndpointName: +# fileLimit: 2 +# fileSizeLimit: 5 +# serverFileSizeLimit: 100 # Global server file size limit in MB +# avatarSizeLimit: 2 # Limit for user avatar image size in MB +# imageGeneration: # Image Gen settings, either percentage or px +# percentage: 100 +# px: 1024 +# # Client-side image resizing to prevent upload errors +# # Users can toggle this in Settings > Chat. Setting `enabled` here overrides +# # that choice for everyone and locks the toggle; omit it to leave users in control. +# clientImageResize: +# enabled: false # Enable/disable client-side image resizing (default: false) +# maxWidth: 1900 # Maximum width for resized images (default: 1900) +# maxHeight: 1900 # Maximum height for resized images (default: 1900) +# quality: 0.92 # JPEG quality for compression (0.0-1.0, default: 0.92) +# # See the Custom Configuration Guide for more information on Assistants Config: +# # https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/assistants_endpoint + +# Web Search Configuration (optional) +# webSearch: +# # Jina Reranking Configuration +# jinaApiKey: '${JINA_API_KEY}' # Your Jina API key +# jinaApiUrl: '${JINA_API_URL}' # Custom Jina API URL (optional, defaults to https://api.jina.ai/v1/rerank) +# # Other rerankers +# cohereApiKey: '${COHERE_API_KEY}' +# # Search providers +# serperApiKey: '${SERPER_API_KEY}' +# searxngInstanceUrl: '${SEARXNG_INSTANCE_URL}' +# searxngApiKey: '${SEARXNG_API_KEY}' +# # Tavily (search provider and/or scraper) +# tavilyApiKey: '${TAVILY_API_KEY}' +# # Keenable (search provider; keyless by default, a key only lifts rate limits) +# keenableApiKey: '${KEENABLE_API_KEY}' +# # Content scrapers +# firecrawlApiKey: '${FIRECRAWL_API_KEY}' +# firecrawlApiUrl: '${FIRECRAWL_API_URL}' +# # Outbound search and scrape requests are validated at connect time against +# # their resolved IP and blocked from reaching private, loopback, link-local, +# # or cloud-metadata space. `allowedAddresses` is an SSRF exemption list, NOT a +# # strict whitelist: hostname/IP + port pairs listed here bypass that block for +# # one deliberately-private endpoint (for example a self-hosted SearXNG +# # instance); public destinations continue to work normally. +# # +# # Entries must include a port: `host:port`, `private.ip:port`, or `[ipv6]:port`. +# # Do not use URLs, paths, CIDR ranges, bare hosts/IPs, or public IP literals. +# # A hostname entry trusts whatever IP that name resolves to on the listed port, +# # so only list hosts you fully control and whose DNS cannot be repointed by an +# # attacker. Listing an attacker-controllable or DNS-rebindable host re-opens the +# # private-address path this guard closes. Prefer literal IPs where you can. +# # +# # Self-hosted endpoints need an entry. A private destination such as +# # `http://searxng:8080`, `http://firecrawl:3002`, or `http://127.0.0.1:8080` is +# # blocked once this guard is active, so list it here or those requests will fail. +# # +# # A proxy from `HTTP_PROXY`, `HTTPS_PROXY`, or `ALL_PROXY` (either case) is +# # exempted automatically and needs no entry. That exemption is applied to the +# # whole tool rather than per destination, so a host `NO_PROXY` sends direct also +# # carries it. Note that when a proxy carries the request the proxy resolves the +# # destination, so destination egress policy is the proxy's to enforce, and for +# # https targets the proxy's own tunnel replaces this guard entirely. +# # allowedAddresses: +# # - 'searxng:8080' +# # - '127.0.0.1:8080' +# +# Tavily as both search and scraper provider example: +# webSearch: +# searchProvider: tavily +# scraperProvider: tavily +# tavilyApiKey: '${TAVILY_API_KEY}' +# # Optional: custom API URLs (defaults to https://api.tavily.com/search and https://api.tavily.com/extract) +# # tavilySearchUrl: '${TAVILY_SEARCH_URL}' +# # tavilyExtractUrl: '${TAVILY_EXTRACT_URL}' +# tavilySearchOptions: +# searchDepth: basic # 'basic', 'advanced', 'fast', or 'ultra-fast' (default: basic) +# maxResults: 5 # 1-20 results per search (default: 5) +# topic: general # 'general', 'news', or 'finance' +# # includeAnswer: basic # Include answer summary: true, 'basic', or 'advanced' +# # includeRawContent: markdown # Include raw content: true, 'markdown', or 'text' +# # includeImages: true # Include images in results +# # includeFavicon: true # Include favicon URL for each result +# # chunksPerSource: 3 # Chunks per source, only with 'advanced' depth (1-3) +# # safeSearch: false # Override Tavily safe_search filtering (true is enterprise-only) +# # includeDomains: # Restrict search to specific domains (max 300) +# # - 'example.com' +# # - 'docs.example.com' +# # excludeDomains: # Exclude specific domains from results (max 150) +# # - 'spam.com' +# # timeRange: week # 'day', 'week', 'month', or 'year' +# # timeout: 15000 # HTTP request timeout in milliseconds (max 120000) +# tavilyScraperOptions: +# extractDepth: basic # 'basic' (1 credit/5 URLs) or 'advanced' (2 credits/5 URLs, more thorough) +# # includeImages: false # Include images extracted from URLs +# # includeFavicon: false # Include favicon URL for each result +# # format: markdown # 'markdown' (default) or 'text' (plain text, may increase latency) +# # timeout: 15000 # HTTP request timeout in milliseconds (max 120000); Tavily Extract receives seconds clamped to 1-60 +# +# Keenable as both search provider and scraper example — a fully keyless web +# search stack: no API key for any of the three categories. The public search and +# fetch endpoints are rate-limited; a key only lifts the cap. +# webSearch: +# searchProvider: keenable +# scraperProvider: keenable +# rerankerType: none # Rerankers all require a key; 'none' skips reranking +# # keenableApiKey: '${KEENABLE_API_KEY}' # Optional: a key only lifts rate limits (public endpoints used when unset) +# # keenableApiUrl: '${KEENABLE_API_URL}' # Optional: search API URL override (fetch uses KEENABLE_FETCH_URL) +# keenableSearchOptions: +# maxResults: 5 # 1-20 results per search (default: 8) +# # site: example.com # Restrict search to a single domain +# # attributionTitle: LibreChat # X-Keenable-Title header sent with each request +# # timeout: 15000 # HTTP request timeout in milliseconds (max 120000) +# keenableScraperOptions: +# # attributionTitle: LibreChat # X-Keenable-Title header sent with each fetch +# timeout: 15000 # HTTP request timeout in milliseconds (max 120000) +# +# Keenable search paired with another scraper (Firecrawl here) also works; each +# category is configured independently: +# webSearch: +# searchProvider: keenable +# scraperProvider: firecrawl +# firecrawlApiKey: '${FIRECRAWL_API_KEY}' +# +# The reverse (someone else's search, Keenable as the scraper) also works. Pin +# the stack for every user as shown below, or leave the providers unpinned so +# each user can save this same keyless combination in the API-key dialog: +# webSearch: +# searchProvider: searxng +# searxngInstanceUrl: '${SEARXNG_INSTANCE_URL}' +# scraperProvider: keenable +# rerankerType: none +# +# SearXNG as the search provider example: +# webSearch: +# searchProvider: searxng +# searxngInstanceUrl: '${SEARXNG_INSTANCE_URL}' +# # searxngApiKey: '${SEARXNG_API_KEY}' +# searxngSearchOptions: +# # Engines your instance should query. Accepts a comma-separated string or a list. +# # Defaults to 'google,bing,duckduckgo'; DuckDuckGo serves CAPTCHAs to most +# # self-hosted instances, so override it when results come back empty. +# # +# # Names must match engines enabled on your own instance. SearXNG ignores an +# # engine it does not know instead of reporting an error, so a typo or a +# # disabled engine shows up as fewer results rather than a failure. Check the +# # enabled list at https://your-instance/config before setting this. +# engines: +# - google +# - bing +# - startpage +# - qwant +# # language: en # Result language code (default: 'all') +# # timeRange: month # 'day', 'month', or 'year' +# # timeout: 10000 # HTTP request timeout in milliseconds (1-120000, default: 10000) + +# Memory configuration for user memories +# memory: +# # (optional) Disable memory functionality +# disabled: false +# # (optional) Restrict memory keys to specific values to limit memory storage and improve consistency +# validKeys: ["preferences", "work_info", "personal_info", "skills", "interests", "context"] +# # (optional) Maximum token limit for stored memory values +# tokenLimit: 10000 +# # (optional) Maximum tokens from recent chat sent to the memory agent before truncation +# maxInputTokens: 12000 +# # (optional) Enable personalization features (defaults to true if memory is configured) +# # When false, users will not see the Personalization tab in settings +# personalize: true +# # (optional) Memory agent configuration for automatic memory updates from chat messages. +# # If omitted, users can still create, edit, delete, and reference memories manually. +# agent: +# # Explicitly enables automatic memory updates from chat messages. +# enabled: true +# # Option 1: Use existing agent by ID +# id: "your-memory-agent-id" +# # Option 2: Define agent inline +# # provider: "openai" +# # model: "gpt-4o-mini" +# # instructions: "You are a memory management assistant. Store and manage user information accurately." +# # model_parameters: +# # temperature: 0.1 + +# Apply opt-in content filters to source-classified submitted and reusable content. +# `filters` is base-config-only: database overrides and tombstones cannot add, +# change, or remove this policy for individual users, groups, or roles. +# In multi-replica deployments, use a coordinated deploy or restart and verify +# every replica loaded the same base config before considering policy active; +# local cache invalidation is not a rollout barrier. +# Omit `filters` or a source to leave that scope disabled. Omitting a source's +# `pii` block disables its source-aware detectors; for messages, `inspect` can +# still change how an enabled legacy `messageFilter.pii` attributes old rows. +# Omit `fields` to filter every supported field for an enabled source. +# `starterPatterns` and `customPatterns` can be configured independently +# under any source so each input surface can use a different policy. Starter +# ids are closed to the catalog below. Custom regexes use bounded, +# linear-time syntax; unsupported constructs are rejected at config load. +# `action` defaults to `block`. Set it to `audit` for a shadow rollout that +# records raw-free findings without rejecting or modifying content. Redaction +# is intentionally not an action yet because safe replacement requires a +# mutation-aware boundary and match spans; configuring an unsupported action +# is rejected rather than silently treated as enforcement. +# Omit `starterPatterns` to enable the full starter catalog; set it to `[]` +# to disable starters while retaining any configured custom patterns. +# Enabling or changing this policy does not rewrite or delete stored records. +# Current policy rechecks protected fields when they are resubmitted and when +# records are copied, shared, or become model-bound. Safe partial metadata edits +# can succeed so records remain repairable, but persisted protected fields remain +# unusable on those paths until repaired. Protected prompt or preset fields may +# be blanked with `contentFilterBlocked: true` in management views. Prompt-group +# metadata blocked by policy returns an explicit error on direct GET, while +# collection and reuse responses omit that group. +# Automatic memory maintenance may log and skip a rejected background update +# while allowing the main chat response to continue. +# Legacy assistant rows without provenance default to `model_output`, preserving +# legacy behavior. Inventory or migrate those records before relying on retroactive +# enforcement. Opting into `inspect` treats otherwise unattributed assistant content, +# including selected attachment projections, as submitted; explicit model provenance +# remains exempt. +# Roll out strict file inspection deliberately: `uninspectable: block` can make +# older opaque files unavailable for reuse until inspectable text is present. +# filters: +# messages: +# unattributedAssistantContent: model_output # `model_output` (default) or `inspect` +# pii: +# action: audit # `block` (default) or `audit` +# fields: [name, text, summary, quote, answer, decision_response, decision_reason, content_part, attachment_reference, assembled_context] +# starterPatterns: [sk_prefix, bearer_header, api_key_header] +# customPatterns: +# - id: organization_identifier +# label: Organization identifier +# regex: "ORG-[A-Z0-9]{12}" +# prompts: +# pii: +# fields: [name, description, oneliner, category, command, text, preset_text, system, context, instructions, additional_instructions, greeting, example_input, example_output] +# agentInstructions: +# pii: +# fields: [name, category, description, instructions, additional_instructions, edge_description, edge_prompt, edge_prompt_key, artifacts, support_contact_name, support_contact_email] +# conversationStarters: +# pii: +# fields: [text] +# conversationTitles: +# pii: +# fields: [title] +# feedback: +# pii: +# fields: [text] +# skills: +# pii: +# fields: [name, display_title, description, category, frontmatter, instructions, imported_text, file_name, file_text] +# memories: +# pii: +# fields: [key, value, summary] +# files: +# pii: +# fields: [name, content, extracted_text, transcript, uri] +# # `allow` is the compatibility default. `block` rejects opaque or +# # oversized selected file content before provider/storage side effects. +# uninspectable: block +# toolArguments: +# pii: +# fields: [name, arguments, output] +# modelParameters: +# pii: +# fields: [stop, request_fields, response_format, metadata] +# actionMetadata: +# pii: +# fields: [raw_spec, domain, privacy_policy_url, authorization_type, custom_auth_header, authorization_content_type, authorization_url, client_url, scope, token_exchange_method, api_key, oauth_client_id, oauth_client_secret] + +# Legacy message-only filter configuration. Existing deployments can continue +# using this shape while migrating message policy into `filters.messages`. +# When both shapes are configured, both policies apply. Prefer +# `filters.messages` for centrally managed source-aware policy. +# messageFilter: +# pii: +# # (optional) Pick a subset of the starter catalog by id; omit to +# # enable all starters (sk_prefix, bearer_header, api_key_header). +# starterPatterns: [sk_prefix, bearer_header, api_key_header] +# # (optional) Operator-defined patterns. Each entry needs id, label, +# # and a regex in RE2 syntax and semantics (RE2 is a linear-time engine +# # with no catastrophic backtracking; a few escapes such as \p, \A, and +# # \s differ from JavaScript). Backreferences and lookaround are not +# # supported; the regex is validated against the RE2 engine at config +# # load time and a pattern it cannot compile is rejected. +# customPatterns: +# - id: anthropic_api_key +# label: Anthropic API key +# regex: "sk-ant-[A-Za-z0-9_-]{20,}" \ No newline at end of file