Chainlit is an asynchronous Python framework for building chat interfaces over large language model (LLM) applications and agents. You write the application logic in Python, and Chainlit renders the conversation, the intermediate steps behind each answer, and the user interactions around it.
Application code is assembled from decorators. @cl.on_message handles each message a user sends, and @cl.step marks a unit of work such as a tool call so it appears as an inspectable step in the interface. Running chainlit run app.py -w serves the app and reloads it as the file changes.
The same assistant logic targets several surfaces: a ChatGPT-style web application, an embedded chatbot or software copilot, Slack and Discord, a plain API endpoint, or a custom frontend.
Chainlit works with any Python program or library, and it ships integrations for LangChain, LlamaIndex, AutoGen, Haystack, Semantic Kernel, and OpenAI Assistants. A separate cookbook repository collects example applications built on those integrations.
Features
- Chat lifecycle hooks: decorators such as @cl.on_message and @cl.step attach Python functions to incoming messages and to intermediate work
- Chain-of-thought visualization: the steps that produced an answer render beside it, so a tool call or retrieval can be expanded and inspected
- Multi-modal chats: messages carry files and other media alongside text
- Data persistence: conversations and human feedback can be collected, monitored, and analyzed after the fact
- Authentication: sign-in support for connecting an app to existing identity providers
- Debug mode: inspect the recorded steps behind a stored conversation
- Deployment surfaces: ChatGPT-like app, embedded copilot, Slack and Discord, API endpoint, or a custom frontend
- Library integrations: LangChain, LlamaIndex, AutoGen, Haystack, Semantic Kernel, and OpenAI Assistants

