Docs
⚙️ Configuration
librechat.yaml
Settings
Root Settings

Config Structure

Note: Fields not specifically mentioned as required are optional.

version

  • required
KeyTypeDescriptionExample
versionStringSpecifies the version of the configuration file.version: 1.2.8

cache

KeyTypeDescriptionExample
cacheBooleanToggles caching on or off. Set to `true` to enable caching (default).cache: true

fileStrategy

  • Options: “local” | “firebase” | “s3” | “azure_blob”
KeyTypeDescriptionExample
fileStrategyStringDetermines where to save user uploaded/generated files. Defaults to `"local"` if omitted.fileStrategy: "firebase"
  • Notes:
    • You can choose from several different CDNs to store files.
    • Please refer to the CDN documentation for more details

filteredTools

KeyTypeDescriptionExample
filteredToolsArray of StringsFilters out specific tools from both Plugins and OpenAI Assistants endpoints.filteredTools: ["scholarai", "calculator"]
  • Notes:
    • If includedTools and filteredTools are both specified, only includedTools will be recognized.
    • Affects both gptPlugins and assistants endpoints
    • You can find the names of the tools to filter in api/app/clients/tools/manifest.json
      • Use the pluginKey value
    • Also, any listed under the “.well-known” directory api/app/clients/tools/.well-known
      • Use the name_for_model value

includedTools

KeyTypeDescriptionExample
includedToolsArray of StringsIncludes specific tools from both Plugins and OpenAI Assistants endpoints.includedTools: ["calculator"]
  • Notes:
    • If includedTools and filteredTools are both specified, only includedTools will be recognized.
    • Affects both gptPlugins and assistants endpoints
    • You can find the names of the tools to filter in api/app/clients/tools/manifest.json
      • Use the pluginKey value
    • Also, any listed under the “.well-known” directory api/app/clients/tools/.well-known
      • Use the name_for_model value

secureImageLinks

KeyTypeDescriptionExample
secureImageLinksBooleanWhether or not to secure access to image links that are hosted locally by the app. Default: false.secureImageLinks: true

imageOutputType

  • Note: Case-sensitive. Google endpoint only supports “jpeg” and “png” output types.
  • Options: “png” | “webp” | “jpeg”
KeyTypeDescriptionExample
imageOutputTypeStringThe image output type for image responses. Defaults to "png" if omitted.imageOutputType: "webp"

ocr

Key:

KeyTypeDescriptionExample
ocrObjectConfigures Optical Character Recognition (OCR) settings for extracting text from images.

Subkeys:

KeyTypeDescriptionExample
apiKeyStringThe API key for the OCR service.
baseURLStringThe base URL for the OCR service API.
strategyStringThe OCR strategy to use. Options are "mistral_ocr" or "custom_ocr".
mistralModelStringThe Mistral model to use for OCR processing.

see: OCR Config Object Structure

webSearch

Key:

KeyTypeDescriptionExample
webSearchObjectConfigures web search functionality, including search providers, content scrapers, and result rerankers.

Subkeys:

KeyTypeDescriptionExample
serperApiKeyStringEnvironment variable name for the Serper API key. If not set in .env, users will be prompted to provide it via UI.
searxngInstanceUrlStringEnvironment variable name for the SearXNG instance URL. If not set in .env, users will be prompted to provide it via UI.
searxngApiKeyStringEnvironment variable name for the SearXNG API key. If not set in .env, users will be prompted to provide it via UI.
firecrawlApiKeyStringEnvironment variable name for the Firecrawl API key. If not set in .env, users will be prompted to provide it via UI.
firecrawlApiUrlStringEnvironment variable name for the Firecrawl API URL. If not set in .env, users will be prompted to provide it via UI.
jinaApiKeyStringEnvironment variable name for the Jina API key. If not set in .env, users will be prompted to provide it via UI.
cohereApiKeyStringEnvironment variable name for the Cohere API key. If not set in .env, users will be prompted to provide it via UI.
searchProviderStringSpecifies which search provider to use. Options: "serper", "searxng".
scraperTypeStringSpecifies which scraper service to use. Options: "firecrawl", "serper".
rerankerTypeStringSpecifies which reranker service to use. Options: "jina", "cohere".
scraperTimeoutNumberTimeout in milliseconds for scraper requests.
safeSearchBooleanEnables safe search mode to filter out inappropriate content.

see: Web Search Object Structure

fileConfig

Key:

KeyTypeDescriptionExample
fileConfigObjectConfigures file handling settings for the application, including size limits and MIME type restrictions.

Subkeys:

KeyTypeDescriptionExample
endpointsRecord/ObjectSpecifies file handling configurations for individual endpoints, allowing customization per endpoint basis.
serverFileSizeLimitNumberThe maximum file size (in MB) that the server will accept. Applies globally across all endpoints unless overridden by endpoint-specific settings.
avatarSizeLimitNumberMaximum size (in MB) for user avatar images.
clientImageResizeObjectConfigures client-side image resizing to optimize file uploads and prevent upload errors due to large image sizes.

clientImageResize

Key:

KeyTypeDescriptionExample
clientImageResizeObjectConfigures client-side image resizing to optimize file uploads and prevent upload errors due to large image sizes.

Subkeys:

KeyTypeDescriptionExample
enabledBooleanEnables or disables client-side image resizing functionality. Default: false.enabled: true
maxWidthNumberMaximum width in pixels for resized images. Images wider than this will be resized. Default: 1920.maxWidth: 1024
maxHeightNumberMaximum height in pixels for resized images. Images taller than this will be resized. Default: 1080.maxHeight: 768
qualityNumberJPEG compression quality (0.1 to 1.0). Higher values mean better quality but larger file sizes. Default: 0.8.quality: 0.9
compressFormatStringOutput format for compressed images. Options: "jpeg", "webp". Default: "jpeg".compressFormat: "webp"

Description:

The clientImageResize configuration enables automatic client-side image resizing before upload. This feature helps:

  • Prevent upload failures due to large image files exceeding server limits
  • Reduce bandwidth usage by compressing images before transmission
  • Improve upload performance with smaller file sizes
  • Maintain image quality while optimizing file size

When enabled, images that exceed the specified maxWidth or maxHeight dimensions are automatically resized on the client side before being uploaded to the server. The resizing maintains the original aspect ratio while ensuring the image fits within the specified bounds.

Example:

clientImageResize
fileConfig:
  clientImageResize:
    enabled: true
    maxWidth: 1920
    maxHeight: 1080
    quality: 0.8
    compressFormat: "jpeg"

Notes:

  • Only applies to image files (JPEG, PNG, WebP, etc.)
  • Resizing occurs automatically when images exceed the specified dimensions
  • Original aspect ratio is preserved during resizing
  • The feature works with all supported image upload endpoints
  • Quality setting only applies to JPEG and WebP formats
  • Setting quality too low (< 0.5) may result in noticeable image degradation

see: File Config Object Structure

rateLimits

Key:

KeyTypeDescriptionExample
rateLimitsObjectDefines rate limiting policies to prevent abuse by limiting the number of requests.

Subkeys:

KeyTypeDescriptionExample
fileUploadsObjectConfigures rate limits specifically for file upload operations.
conversationsImportObjectConfigures rate limits specifically for conversation import operations.
sttObjectConfigures rate limits specifically for speech-to-text (stt) requests
ttsObjectConfigures rate limits specifically for text-to-speech (tts) requests

fileUploads Subkeys:

KeyTypeDescriptionExample
ipMaxNumberMaximum number of uploads allowed per IP address per window.
ipWindowInMinutesNumberTime window in minutes for the IP-based upload limit.
userMaxNumberMaximum number of uploads allowed per user per window.
userWindowInMinutesNumberTime window in minutes for the user-based upload limit.

conversationsImport Subkeys:

KeyTypeDescriptionExample
ipMaxNumberMaximum number of imports allowed per IP address per window.
ipWindowInMinutesNumberTime window in minutes for the IP-based imports limit.
userMaxNumberMaximum number of imports per user per window.
userWindowInMinutesNumberTime window in minutes for the user-based imports limit.

tts Subkeys:

KeyTypeDescriptionExample
ipMaxNumberMaximum number of requests allowed per IP address per window.
ipWindowInMinutesNumberTime window in minutes for the IP-based requests limit.
userMaxNumberMaximum number of requests per user per window.
userWindowInMinutesNumberTime window in minutes for the user-based requests limit.

stt Subkeys:

KeyTypeDescriptionExample
ipMaxNumberMaximum number of requests allowed per IP address per window.
ipWindowInMinutesNumberTime window in minutes for the IP-based requests limit.
userMaxNumberMaximum number of requests per user per window.
userWindowInMinutesNumberTime window in minutes for the user-based requests limit.
  • Example:
rateLimits
rateLimits:
  fileUploads:
    ipMax: 100
    ipWindowInMinutes: 60
    userMax: 50
    userWindowInMinutes: 60
  conversationsImport:
    ipMax: 100
    ipWindowInMinutes: 60
    userMax: 50
    userWindowInMinutes: 60
  stt:
    ipMax: 100
    ipWindowInMinutes: 1
    userMax: 50
    userWindowInMinutes: 1
  tts:
    ipMax: 100
    ipWindowInMinutes: 1
    userMax: 50
    userWindowInMinutes: 1

registration

Key:

KeyTypeDescriptionExample
registrationObjectConfigures registration-related settings for the application.

Subkeys:

KeyTypeDescriptionExample
socialLoginsSocial login configurations.
allowedDomainsSpecifies allowed domains for registration.

see also:

memory

Key:

KeyTypeDescriptionExample
memoryObjectConfigures conversation memory and personalization features for the application.

Subkeys:

KeyTypeDescriptionExample
disabledBooleanDisables memory functionality when set to true.
validKeysArray of StringsSpecifies which keys are valid for memory storage.
tokenLimitNumberSets the maximum number of tokens for memory storage and processing.
personalizeBooleanEnables or disables personalization features.
messageWindowSizeNumberSpecifies the number of recent messages to include in memory context.
agentObject | UnionConfigures the agent responsible for memory processing.

see: Memory Object Structure

actions

Key:

KeyTypeDescriptionExample
actionsObjectConfigures actions-related settings, used by Agents and Assistants

Subkeys:

KeyTypeDescriptionExample
allowedDomainsSpecifies allowed domains for actions.

see also:

interface

Key:

KeyTypeDescriptionExample
interfaceObjectConfigures user interface elements within the application, allowing for customization of visibility and behavior of various components.

Subkeys:

KeyTypeDescriptionExample
privacyPolicyObjectContains settings related to the privacy policy link provided.
termsOfServiceObjectContains settings related to the terms of service link provided.
modelSelectBooleanDetermines whether the model selection feature is available.
parametersBooleanToggles the visibility of parameter configuration options AKA conversation settings.
sidePanelBooleanControls the visibility of the right-most side panel.
presetsBooleanEnables or disables the presets menu
promptsBooleanEnables or disables all prompt-related features for all users
bookmarksBooleanEnables or disables all bookmarks-related features for all users
multiConvoBooleanEnables or disables all "multi convo", AKA multiple response streaming, related features for all users
agentsBooleanEnables or disables all agents features for all users
webSearchBooleanEnables or disables the web search button in the chat interface
fileSearchBooleanEnables or disables the file search button in the chat interface
temporaryChatRetentionNumberConfigures the retention period for temporary chats in hours. Min: 1, Max: 8760. Default: 720 (30 days).temporaryChatRetention: 168

see: Interface Object Structure

temporaryChatRetention

The temporaryChatRetention configuration allows you to customize how long temporary chats are retained before being automatically deleted. This setting applies to all temporary conversations created by users and provides flexible control over data retention policies.

Configuration Options:

KeyTypeDescriptionExample
temporaryChatRetentionNumberSets the retention period for temporary chats in hours.temporaryChatRetention: 168

Validation Rules:

  • Minimum: 1 hour (prevents immediate deletion)
  • Maximum: 8760 hours (1 year maximum retention)
  • Default: 720 hours (30 days)

Configuration Methods:

  1. Environment Variable: TEMP_CHAT_RETENTION_HOURS=168
  2. LibreChat.yaml: interface.temporaryChatRetention: 168
  3. Priority: Config file takes precedence over environment variable

Example Configuration:

temporaryChatRetention
interface:
  # Retain temporary chats for 7 days (168 hours)
  temporaryChatRetention: 168

Common Retention Periods:

  • 1 hour: temporaryChatRetention: 1 (minimal retention)
  • 24 hours: temporaryChatRetention: 24 (1 day)
  • 168 hours: temporaryChatRetention: 168 (1 week)
  • 720 hours: temporaryChatRetention: 720 (30 days - default)
  • 8760 hours: temporaryChatRetention: 8760 (1 year - maximum)

Important Notes:

  • Automatic cleanup occurs via MongoDB TTL (Time To Live) indexes
  • Changes apply only to newly created temporary chats
  • Existing temporary chats retain their original expiration dates
  • Invalid values automatically fallback to the default (720 hours)
  • Setting too low values may impact user experience with temporary chats
  • This setting only affects temporary chats, not regular conversations

modelSpecs

Key:

KeyTypeDescriptionExample
modelSpecsObjectConfigures model specifications, allowing for detailed setup and customization of AI models and their behaviors within the application.

Subkeys:

KeyTypeDescriptionExample
enforceBooleanDetermines whether the model specifications should strictly override other configuration settings.
prioritizeBooleanSpecifies if model specifications should take priority over the default configuration when both are applicable.
listArray of ObjectsContains a list of individual model specifications detailing various configurations and behaviors.

see: Model Specs Object Structure

endpoints

Key:

KeyTypeDescriptionExample
endpointsObjectDefines custom API endpoints for the application.

Subkeys:

KeyTypeDescriptionExample
customArray of ObjectsEach object in the array represents a unique endpoint configuration.
azureOpenAIObjectAzure OpenAI endpoint-specific configuration
assistantsObjectAssistants endpoint-specific configuration.
azureAssistantsObjectAzure Assistants endpoint-specific configuration.
agentsObjectAgents endpoint-specific configuration.
allObjectGlobal endpoint settings that apply to all endpoints. See Shared Endpoint Settings.

Note: All endpoints support Shared Endpoint Settings which include streamRate, titleModel, titleMethod, titlePrompt, titlePromptTemplate, and titleEndpoint. These can be configured individually per endpoint or globally using the all key.

mcpServers

Key:

KeyTypeDescriptionExample
mcpServersObjectDefines the configuration for Model Context Protocol (MCP) servers, allowing dynamic integration of MCP servers within the application.

Subkeys:

KeyTypeDescriptionExample
<serverName>ObjectEach key under `mcpServers` represents an individual MCP server configuration, identified by a unique name.
  • Notes:
    • Initialization happens at startup, and the app must be restarted for changes to take effect.
    • The <serverName> is a unique identifier for each MCP server configuration.
    • Each MCP server can be configured using one of four connection types:
      • stdio
      • websocket
      • sse
      • streamable-http
    • The type field specifies the connection type to the MCP server.
    • If type is omitted, it defaults based on the presence and format of url or command:
      • If url is specified and starts with http or https, type defaults to sse.
      • If url is specified and starts with ws or wss, type defaults to websocket.
      • If command is specified, type defaults to stdio.
    • Additional configuration options include:
      • timeout: Timeout in milliseconds for MCP server requests. Determines how long to wait for a response for tool requests.
      • initTimeout: Timeout in milliseconds for MCP server initialization. Determines how long to wait for the server to initialize.
      • serverInstructions: Controls whether server instructions are included in agent context. Can be true (use server-provided), false (disabled), or a custom string (overrides server-provided).
      • customUserVars: (Optional) Defines custom variables (e.g., API keys, URLs) that individual users can set for an MCP server. These per-user values, provided through the UI, can then be referenced in the server’s headers or env configurations using {{VARIABLE_NAME}} syntax. This allows for per-user authentication or customization for MCP tools.
    • see: MCP Servers Object Structure

Example:

mcpServers
mcpServers:
  everything:
    # type: sse # type can optionally be omitted
    url: http://localhost:3001/sse
    timeout: 30000
    initTimeout: 10000
    serverInstructions: true  # Use server-provided instructions
  puppeteer:
    type: stdio
    command: npx
    args:
      - -y
      - "@modelcontextprotocol/server-puppeteer"
    timeout: 30000
    initTimeout: 10000
    serverInstructions: "Do not access any local files or local/internal IP addresses"
  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
  streamable-http-example:
    type: streamable-http
    url: https://example.com/mcp
    headers:
      Authorization: "Bearer ${API_TOKEN}"
    timeout: 30000
  per-user-crendentials-example:
    type: sse
    url: "https//some.mcp/sse"
    headers:
      X-Custom-Auth-Token: "{{USER_API_KEY}}" # Placeholder for the user-provided API key, defined in `customUserVars` below.
    customUserVars:
      USER_API_KEY:
        title: "Service API Key"
        description: "Your personal API key for this service. You can get it <a href='https://example.com/api-keys' target='_blank'>here</a>."
    serverInstructions: true

see: MCP Servers Object Structure

Additional links