Docs
Configuration
librechat.yaml
Settings
File Config

File Config Object Structure

Overview

The fileConfig object allows you to configure file handling settings for the application, including size limits and MIME type restrictions. This section provides a detailed breakdown of the fileConfig object structure.

There are 3 main fields under fileConfig:

  • endpoints
  • serverFileSizeLimit
  • avatarSizeLimit

Notes:

  • At the time of writing, the Assistants endpoint supports filetypes from this list.
  • OpenAI, Azure OpenAI, Google, and Custom endpoints support files through the RAG API.
  • Any other endpoints not mentioned, like Plugins, do not support file uploads (yet).
  • The Assistants endpoint has a defined endpoint value of assistants. All other endpoints use the defined value default
    • For non-assistants endpoints, you can adjust file settings for all of them under default
    • If you’d like to adjust settings for a specific endpoint, you can list their corresponding endpoint names:
      • assistants
        • does not use “default” as it has defined defaults separate from the others.
      • openAI
      • azureOpenAI
      • google
      • YourCustomEndpointName
  • You can omit values, in which case, the app will use the default values as defined per endpoint type listed below.
  • LibreChat counts 1 megabyte as follows: 1 x 1024 x 1024

Example

fileConfig
fileConfig:
  endpoints:
    assistants:
      fileLimit: 5
      fileSizeLimit: 10
      totalSizeLimit: 50
      supportedMimeTypes:
        - "image/.*"
        - "application/pdf"
    openAI:
      disabled: true
    default:
      totalSizeLimit: 20
    YourCustomEndpointName:
      fileLimit: 5
      fileSizeLimit: 1000
      supportedMimeTypes:
        - "image/.*"
  serverFileSizeLimit: 1000
  avatarSizeLimit: 2
 

serverFileSizeLimit

KeyTypeDescriptionExample
serverFileSizeLimitIntegerThe global maximum size for any file uploaded to the server, specified in megabytes (MB).Acts as an overarching limit for file uploads across all endpoints, ensuring that no file exceeds this size server-wide.
fileConfig / serverFileSizeLimit
fileConfig:
  serverFileSizeLimit: 1000

avatarSizeLimit

KeyTypeDescriptionExample
avatarSizeLimitIntegerThe maximum size allowed for avatar images, specified in megabytes (MB).Specifically tailored for user avatar uploads, allowing for control over image sizes to maintain consistent quality and loading times.
fileConfig / avatarSizeLimit
fileConfig:
  avatarSizeLimit: 2

endpoints

KeyTypeDescriptionExample
endpointsRecord/ObjectConfigures file handling settings for individual endpoints, allowing customization per endpoint basis.Specifies file handling configurations for individual endpoints, allowing customization per endpoint basis.

Description: Each object under endpoints is a record that can have the following settings:

Overview

  • disabled
    • Whether file handling is disabled for the endpoint.
  • fileLimit
    • The maximum number of files allowed per upload request.
  • fileSizeLimit
    • The maximum size for a single file. In units of MB (e.g. use 20 for 20 megabytes)
  • totalSizeLimit
    • The total maximum size for all files in a single request. In units of MB (e.g. use 20 for 20 megabytes)
  • supportedMimeTypes
    • A list of Regular Expressions specifying what MIME types are allowed for upload. This can be customized to restrict file types.

disabled

KeyTypeDescriptionExample
disabledBooleanIndicates whether file uploading is disabled for a specific endpoint.Setting this to `true` prevents any file uploads to the specified endpoint, overriding any other file-related settings.

Default: false

fileConfig / endpoints / {endpoint_record} / disabled
openAI:
  disabled: true

fileLimit

Key:

KeyTypeDescriptionExample
fileLimitIntegerThe maximum number of files allowed in a single upload request.Helps control the volume of uploads and manage server load.

Default: Varies by endpoint

fileConfig / endpoints / {endpoint_record} / fileLimit
assistants:
  fileLimit: 5

fileSizeLimit

Key:

KeyTypeDescriptionExample
fileSizeLimitIntegerThe maximum size allowed for each individual file, specified in megabytes (MB).This limit ensures that no single file exceeds the specified size, allowing for better resource allocation and management.

Default: Varies by endpoint

fileConfig / endpoints / {endpoint_record} / fileSizeLimit
YourCustomEndpointName:
  fileSizeLimit: 1000

totalSizeLimit

Key:

KeyTypeDescriptionExample
totalSizeLimitIntegerThe total maximum size allowed for all files in a single request, specified in megabytes (MB).This setting is crucial for preventing excessive bandwidth and storage usage by any single upload request.

Default: Varies by endpoint

fileConfig / endpoints / {endpoint_record} / totalSizeLimit
assistants:
  totalSizeLimit: 50

supportedMimeTypes

Key:

KeyTypeDescriptionExample
supportedMimeTypesArray of StringsA list of regular expressions defining the MIME types permitted for upload.This allows for precise control over the types of files that can be uploaded. Invalid regex is ignored.

Default: Varies by endpoint

fileConfig / endpoints / {endpoint_record} / supportedMimeTypes
assistants:
  supportedMimeTypes:
      - "image/.*"
      - "application/pdf"