Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt

Use this file to discover all available pages before exploring further.

Options

File Upload

spontaneous_file_upload.enabled
bool
Authorize users to upload files with messages. The files are then accessible in cl.on_message.
spontaneous_file_upload.accept
Union[List[str], Dict[str, List[str]]]
Restrict user to only upload accepted mime file types. Example: [“text/plain”, “application/pdf”, “image/x-png”]
spontaneous_file_upload.max_files
int
Restrict user to upload maximum number of files at a time.
spontaneous_file_upload.max_size_mb
int
Restrict uploading file size (MB).

Audio

audio.enabled
bool
default:false
Enable audio features.
Since Chainlit 2.7.0, audio.enabled must be explicitly set to true in config.toml. It is no longer auto-inferred from the existence of an on_audio_chunk callback.
audio.sample_rate
int
default:24000
Audio sample rate in hertz. Defaults to 24kHz

MCP

See MCP server-side configuration

Slack

See Slack integration documentation

Favorites

favorites
bool
default:false
Enable favorite messages (prompt templates). When enabled, users can star their own messages and reuse them as prompt templates from the composer. Requires data persistence to store favorites.
Since version 2.9.5.

Other

latex
bool
default:false
Process and display mathematical expressions. This can clash with ”$” characters in messages.
user_message_autoscroll
bool
default:true
Autoscroll new user messages at the top of the window.
assistant_message_autoscroll
bool
default:true
Autoscroll assistant messages as they stream. Set to false to keep the viewport stable while new assistant tokens arrive.
Since version 2.9.4.
unsafe_allow_html
bool
default:false
Process and display HTML in messages. This can be a security risk (see https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript).
auto_tag_thread
bool
default:true
Automatically tag threads with the current chat profile (if a chat profile is used)
edit_message
bool
default:true
Allow the user to edit their messages.
allow_thread_sharing
bool
default:false
Allow users to share threads with other users. Requires authentication, data persistence, and an on_shared_thread_view callback.

Default configuration

[features]
# Process and display HTML in messages. This can be a security risk (see https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript)
unsafe_allow_html = false

# Process and display mathematical expressions. This can clash with "$" characters in messages.
latex = false

# Autoscroll new user messages at the top of the window
user_message_autoscroll = true

# Autoscroll assistant messages as they stream
assistant_message_autoscroll = true

# Automatically tag threads with the current chat profile (if a chat profile is used)
auto_tag_thread = true

# Allow users to edit their own messages
edit_message = true

# Allow users to share threads (requires on_shared_thread_view callback)
allow_thread_sharing = false

# Enable favorite messages (prompt templates)
favorites = false

# Authorize users to spontaneously upload files with messages
[features.spontaneous_file_upload]
    enabled = true
    # Define accepted file types using MIME types
    # Examples:
    # 1. For specific file types:
    #    accept = ["image/jpeg", "image/png", "application/pdf"]
    # 2. For all files of certain type:
    #    accept = ["image/*", "audio/*", "video/*"]
    # 3. For specific file extensions:
    #    accept = {{ "application/octet-stream" = [".xyz", ".pdb"] }}
    # Note: Using "*/*" is not recommended as it may cause browser warnings
    accept = ["*/*"]
    max_files = 20
    max_size_mb = 500

[features.audio]
    # Enable audio features
    enabled = false
    # Sample rate of the audio
    sample_rate = 24000

[features.mcp]
    # Enable Model Context Protocol (MCP) features
    enabled = false