chainlit


Namechainlit JSON
Version 1.3.2 PyPI version JSON
download
home_pagehttps://chainlit.io/
SummaryBuild Conversational AI.
upload_time2024-11-08 10:42:56
maintainerNone
docs_urlNone
authorWilly Douhard
requires_python<4.0.0,>=3.9
licenseApache-2.0
keywords llm agents gen ai chat ui chatbot ui openai copilot langchain conversational ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Welcome to Chainlit by Literal AI πŸ‘‹

[![](https://dcbadge.vercel.app/api/server/ZThrUxbAYw?style=flat)](https://discord.gg/k73SQ3FyUh)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/chainlit_io.svg?style=social&label=Follow%20%40chainlit_io)](https://twitter.com/chainlit_io)
![PyPI - Downloads](https://img.shields.io/pypi/dm/chainlit)
[![GitHub Contributors](https://img.shields.io/github/contributors/chainlit/chainlit)](https://github.com/chainlit/chainlit/graphs/contributors)
[![CI](https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml/badge.svg)](https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml)

**Build production-ready Conversational AI applications in minutes, not weeks ⚑️**

Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.

- βœ… ChatGPT-like application
- βœ… Embedded Chatbot & Software Copilot
- βœ… Slack & Discord
- βœ… Custom frontend (build your own agentic experience)
- βœ… API Endpoint

Full documentation is available [here](https://docs.chainlit.io). You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/), an app built using Chainlit!

> [!NOTE]  
> Check out [Literal AI](https://literalai.com), our product to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and [seamlessly](https://docs.chainlit.io/data-persistence/overview) with Chainlit by adding a `LITERAL_API_KEY` in your project.
> 
> Chainlit is developed and maintained by the Literal AI team, which is currently focused on expanding the capabilities of Literal AI. While we continue to support and maintain Chainlit, we are also committed to enabling the community to contribute, particularly in areas like integrations and data layers.

<p align="center">
    <img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" alt="Chainlit user interface" width="80%"></img>
</p>

## Installation

Open a terminal and run:

```sh
pip install chainlit
chainlit hello
```

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

## πŸš€ Quickstart

### 🐍 Pure Python

Create a new file `demo.py` with the following code:

```python
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  # this function will be called every time a user inputs a message in the UI
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!

```sh
chainlit run demo.py -w
```

<img src="/images/quick-start.png" alt="Quick Start"></img>

## πŸŽ‰ Key Features and Integrations

Full documentation is available [here](https://docs.chainlit.io). Key features:

- [πŸ’¬ Multi Modal chats](https://docs.chainlit.io/advanced-features/multi-modal)
- [πŸ’­ Chain of Thought visualization](https://docs.chainlit.io/concepts/step)
- [πŸ’Ύ Data persistence + human feedback](https://docs.chainlit.io/data-persistence/overview)
- [πŸ› Debug Mode](https://docs.chainlit.io/data-persistence/enterprise#debug-mode)
- [πŸ‘€ Authentication](https://docs.chainlit.io/authentication/overview)

Chainlit is compatible with all Python programs and libraries. That being said, it comes with integrations for:

- [LangChain](https://docs.chainlit.io/integrations/langchain)
- [Llama Index](https://docs.chainlit.io/integrations/llama-index)
- [Autogen](https://github.com/Chainlit/cookbook/tree/main/pyautogen)
- [OpenAI Assistant](https://github.com/Chainlit/cookbook/tree/main/openai-assistant)
- [Haystack](https://docs.chainlit.io/integrations/haystack)

## πŸ“š More Examples - Cookbook

You can find various examples of Chainlit apps [here](https://github.com/Chainlit/cookbook) that leverage tools and services such as OpenAI, Anthropiс, LangChain, LlamaIndex, ChromaDB, Pinecone and more.

Tell us what you would like to see added in Chainlit using the Github issues or on [Discord](https://discord.gg/k73SQ3FyUh).

## πŸ’ Contributing

As an open-source initiative in a rapidly evolving domain, we welcome contributions, be it through the addition of new features or the improvement of documentation.

For detailed information on how to contribute, see [here](.github/CONTRIBUTING.md).

## πŸ“ƒ License

Chainlit is open-source and licensed under the [Apache 2.0](LICENSE) license.


            

Raw data

            {
    "_id": null,
    "home_page": "https://chainlit.io/",
    "name": "chainlit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.9",
    "maintainer_email": null,
    "keywords": "LLM, Agents, gen ai, chat ui, chatbot ui, openai, copilot, langchain, conversational ai",
    "author": "Willy Douhard",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/6a/57/8c3c354b3e82fae0791b58304634b356aeea8791dd0b6f817a8d8787cad6/chainlit-1.3.2.tar.gz",
    "platform": null,
    "description": "# Welcome to Chainlit by Literal AI \ud83d\udc4b\n\n[![](https://dcbadge.vercel.app/api/server/ZThrUxbAYw?style=flat)](https://discord.gg/k73SQ3FyUh)\n[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/chainlit_io.svg?style=social&label=Follow%20%40chainlit_io)](https://twitter.com/chainlit_io)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/chainlit)\n[![GitHub Contributors](https://img.shields.io/github/contributors/chainlit/chainlit)](https://github.com/chainlit/chainlit/graphs/contributors)\n[![CI](https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml/badge.svg)](https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml)\n\n**Build production-ready Conversational AI applications in minutes, not weeks \u26a1\ufe0f**\n\nChainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.\n\n- \u2705 ChatGPT-like application\n- \u2705 Embedded Chatbot & Software Copilot\n- \u2705 Slack & Discord\n- \u2705 Custom frontend (build your own agentic experience)\n- \u2705 API Endpoint\n\nFull documentation is available [here](https://docs.chainlit.io). You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/), an app built using Chainlit!\n\n> [!NOTE]  \n> Check out [Literal AI](https://literalai.com), our product to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and [seamlessly](https://docs.chainlit.io/data-persistence/overview) with Chainlit by adding a `LITERAL_API_KEY` in your project.\n> \n> Chainlit is developed and maintained by the Literal AI team, which is currently focused on expanding the capabilities of Literal AI. While we continue to support and maintain Chainlit, we are also committed to enabling the community to contribute, particularly in areas like integrations and data layers.\n\n<p align=\"center\">\n    <img src=\"https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed\" alt=\"Chainlit user interface\" width=\"80%\"></img>\n</p>\n\n## Installation\n\nOpen a terminal and run:\n\n```sh\npip install chainlit\nchainlit hello\n```\n\nIf this opens the `hello app` in your browser, you're all set!\n\n## \ud83d\ude80 Quickstart\n\n### \ud83d\udc0d Pure Python\n\nCreate a new file `demo.py` with the following code:\n\n```python\nimport chainlit as cl\n\n\n@cl.step(type=\"tool\")\nasync def tool():\n    # Fake tool\n    await cl.sleep(2)\n    return \"Response from the tool!\"\n\n\n@cl.on_message  # this function will be called every time a user inputs a message in the UI\nasync def main(message: cl.Message):\n    \"\"\"\n    This function is called every time a user inputs a message in the UI.\n    It sends back an intermediate response from the tool, followed by the final answer.\n\n    Args:\n        message: The user's message.\n\n    Returns:\n        None.\n    \"\"\"\n\n\n    # Call the tool\n    tool_res = await tool()\n\n    await cl.Message(content=tool_res).send()\n```\n\nNow run it!\n\n```sh\nchainlit run demo.py -w\n```\n\n<img src=\"/images/quick-start.png\" alt=\"Quick Start\"></img>\n\n## \ud83c\udf89 Key Features and Integrations\n\nFull documentation is available [here](https://docs.chainlit.io). Key features:\n\n- [\ud83d\udcac Multi Modal chats](https://docs.chainlit.io/advanced-features/multi-modal)\n- [\ud83d\udcad Chain of Thought visualization](https://docs.chainlit.io/concepts/step)\n- [\ud83d\udcbe Data persistence + human feedback](https://docs.chainlit.io/data-persistence/overview)\n- [\ud83d\udc1b Debug Mode](https://docs.chainlit.io/data-persistence/enterprise#debug-mode)\n- [\ud83d\udc64 Authentication](https://docs.chainlit.io/authentication/overview)\n\nChainlit is compatible with all Python programs and libraries. That being said, it comes with integrations for:\n\n- [LangChain](https://docs.chainlit.io/integrations/langchain)\n- [Llama Index](https://docs.chainlit.io/integrations/llama-index)\n- [Autogen](https://github.com/Chainlit/cookbook/tree/main/pyautogen)\n- [OpenAI Assistant](https://github.com/Chainlit/cookbook/tree/main/openai-assistant)\n- [Haystack](https://docs.chainlit.io/integrations/haystack)\n\n## \ud83d\udcda More Examples - Cookbook\n\nYou can find various examples of Chainlit apps [here](https://github.com/Chainlit/cookbook) that leverage tools and services such as OpenAI, Anthropi\u0441, LangChain, LlamaIndex, ChromaDB, Pinecone and more.\n\nTell us what you would like to see added in Chainlit using the Github issues or on [Discord](https://discord.gg/k73SQ3FyUh).\n\n## \ud83d\udc81 Contributing\n\nAs an open-source initiative in a rapidly evolving domain, we welcome contributions, be it through the addition of new features or the improvement of documentation.\n\nFor detailed information on how to contribute, see [here](.github/CONTRIBUTING.md).\n\n## \ud83d\udcc3 License\n\nChainlit is open-source and licensed under the [Apache 2.0](LICENSE) license.\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Build Conversational AI.",
    "version": "1.3.2",
    "project_urls": {
        "Documentation": "https://docs.chainlit.io/",
        "Homepage": "https://chainlit.io/",
        "Repository": "https://github.com/Chainlit/chainlit"
    },
    "split_keywords": [
        "llm",
        " agents",
        " gen ai",
        " chat ui",
        " chatbot ui",
        " openai",
        " copilot",
        " langchain",
        " conversational ai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cad82a0c00b2236c93f31df429642de6414c56510d39392101b1b102074520d0",
                "md5": "a2d9894a534b683e08f4eedb81878192",
                "sha256": "c0926e8b157a67aede511a8220307889d04e9458ff3f94176e004fe533662d74"
            },
            "downloads": -1,
            "filename": "chainlit-1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2d9894a534b683e08f4eedb81878192",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.9",
            "size": 4332216,
            "upload_time": "2024-11-08T10:42:53",
            "upload_time_iso_8601": "2024-11-08T10:42:53.944061Z",
            "url": "https://files.pythonhosted.org/packages/ca/d8/2a0c00b2236c93f31df429642de6414c56510d39392101b1b102074520d0/chainlit-1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a578c3c354b3e82fae0791b58304634b356aeea8791dd0b6f817a8d8787cad6",
                "md5": "3ea7edfd759341880ac199b821cfa878",
                "sha256": "5562246ca42c858a42e86efdd5a46c27fd93481706f6fe47416109c47ac41b77"
            },
            "downloads": -1,
            "filename": "chainlit-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3ea7edfd759341880ac199b821cfa878",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.9",
            "size": 4271845,
            "upload_time": "2024-11-08T10:42:56",
            "upload_time_iso_8601": "2024-11-08T10:42:56.334197Z",
            "url": "https://files.pythonhosted.org/packages/6a/57/8c3c354b3e82fae0791b58304634b356aeea8791dd0b6f817a8d8787cad6/chainlit-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-08 10:42:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Chainlit",
    "github_project": "chainlit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "chainlit"
}
        
Elapsed time: 1.17806s