MCP HubMCP Hub
Chainlit

chainlit

by: Chainlit

Build Conversational AI in minutes ⚡️

9489created 14/03/2023
Visit
AI
Chatbot

📌Overview

Purpose: Enable fast and easy development of production-ready conversational AI applications in Python.

Overview:
Chainlit is an open-source framework designed to help developers build and deploy conversational AI applications efficiently. Created and maintained by Literal AI, Chainlit streamlines the process of creating LLM-powered chat interfaces and tools, allowing users to go from prototype to production in minutes instead of weeks.

Key Features:

  • Rapid Prototyping and Deployment:
    Allows developers to quickly set up and launch conversational AI applications using simple Python code, minimizing setup time and reducing complexity.

  • Integration with Popular Tools and LLMs:
    Seamlessly connects with leading services like OpenAI, Anthropic, LangChain, LlamaIndex, ChromaDB, and Pinecone, enabling flexible and expandable AI workflows.


Welcome to Chainlit by Literal AI

Build python production-ready conversational AI applications in minutes, not weeks ⚡️

Chainlit is maintained by Literal AI, an LLMOps platform to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and seamlessly with Chainlit. For enterprise support, please fill this form.


Installation

Open a terminal and run:

pip install chainlit
chainlit hello

If this opens the hello app in your browser, you're all set!

Development version

To install the latest in-development version from GitHub:

pip install git+https://github.com/Chainlit/chainlit.git#subdirectory=backend/

(Requires Node and pnpm installed on your system.)


Quickstart

Pure Python Example

Create a new file demo.py:

import chainlit as cl

@cl.step(type="tool")
async def tool():
    # Fake tool
    await cl.sleep(2)
    return "Response from the tool!"

@cl.on_message
async def main(message: cl.Message):
    """
    This function is called every time a user inputs a message in the UI.
    It sends back an intermediate response from the tool, followed by the final answer.
    Args:
        message: The user's message.
    Returns:
        None.
    """
    # Call the tool
    tool_res = await tool()

    await cl.Message(content=tool_res).send()

Now run it:

chainlit run demo.py -w

More Examples

You can find various examples of Chainlit apps in the Chainlit Cookbook, covering integrations with OpenAI, Anthropic, LangChain, LlamaIndex, ChromaDB, Pinecone, and more.

Share your ideas or feedback via GitHub issues or Discord.


Contributing

We welcome contributions in the form of new features or documentation improvements.

For more information on how to contribute, see the CONTRIBUTING file.


License

Chainlit is open-source and licensed under the Apache 2.0 license.