The Modes system allows you to define multiple picker categories (e.g., Model, Reasoning Effort, Persona) that users can configure for their chat session. This is more flexible than a single LLM picker and persists across messages.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.
Data Structure
ModeOption
A single selectable option within a Mode.Unique identifier for this option (e.g., “gpt-4”, “planning”).
Display name shown in the UI (e.g., “GPT-4”, “Planning”).
Brief description shown in the dropdown.
The lucide icon name or URL for the option. See https://lucide.dev/icons/.
Whether this option should be selected by default.
Mode
A category of options (e.g., “Model”, “Reasoning”).Unique identifier for the mode (e.g., “model”).
Display name for the picker trigger.
List of available options for this mode.
Set available Modes
You can define available modes usingcl.context.emitter.set_modes inside the on_chat_start handler.
