chainlit


Namechainlit JSON
Version 2.2.1 PyPI version JSON
download
home_pagehttps://chainlit.io/
SummaryBuild Conversational AI.
upload_time2025-02-15 05:53:15
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.
            <h1 align="center">Welcome to Chainlit by Literal AI πŸ‘‹</h1>

<p align="center">
<b>Build python production-ready conversational AI applications in minutes, not weeks ⚑️</b>

</p>
<p align="center">
    <a href="https://discord.gg/k73SQ3FyUh" rel="nofollow"><img alt="Discord" src="https://dcbadge.vercel.app/api/server/ZThrUxbAYw?style=flat" style="max-width:100%;"></a>
    <a href="https://twitter.com/chainlit_io" rel="nofollow"><img alt="Twitter" src="https://img.shields.io/twitter/url/https/twitter.com/chainlit_io.svg?style=social&label=Follow%20%40chainlit_io" style="max-width:100%;"></a>
    <a href="https://pypistats.org/packages/chainlit" rel="nofollow"><img alt="Downloads" src="https://img.shields.io/pypi/dm/chainlit" style="max-width:100%;"></a>
        <a href="https://github.com/chainlit/chainlit/graphs/contributors" rel="nofollow"><img alt="Contributors" src="https://img.shields.io/github/contributors/chainlit/chainlit" style="max-width:100%;"></a>
    <a href="https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml" rel="nofollow"><img alt="CI" src="https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml/badge.svg" style="max-width:100%;"></a>
</p>

<p align="center">
    <a href="https://docs.chainlit.io"><b>Documentation</b></a>  β€’  
    <a href="https://help.chainlit.io"><b>Chainlit Help</b></a>  β€’  
    <a href="https://github.com/Chainlit/cookbook"><b>Cookbook</b></a>
</p>

<p align="center">
    <a href="https://trendshift.io/repositories/6708" target="_blank"><img src="https://trendshift.io/api/badge/repositories/6708" alt="Chainlit%2Fchainlit | Trendshift" style="width: 250px; height: 45px;" width="250" height="45"/></a>
</p>

https://github.com/user-attachments/assets/b3738aba-55c0-42fa-ac00-6efd1ee0d148

## 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!

### Development version

The latest in-development version can be installed straight from GitHub with:

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

(Requires Node and pnpm installed on the system.)

## πŸš€ 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>

## πŸ“š 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](/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/5a/0d/19f66ced254c35cd0595ba064402a15c2ca3d3fba2a75f7ea75b52619871/chainlit-2.2.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">Welcome to Chainlit by Literal AI \ud83d\udc4b</h1>\n\n<p align=\"center\">\n<b>Build python production-ready conversational AI applications in minutes, not weeks \u26a1\ufe0f</b>\n\n</p>\n<p align=\"center\">\n    <a href=\"https://discord.gg/k73SQ3FyUh\" rel=\"nofollow\"><img alt=\"Discord\" src=\"https://dcbadge.vercel.app/api/server/ZThrUxbAYw?style=flat\" style=\"max-width:100%;\"></a>\n    <a href=\"https://twitter.com/chainlit_io\" rel=\"nofollow\"><img alt=\"Twitter\" src=\"https://img.shields.io/twitter/url/https/twitter.com/chainlit_io.svg?style=social&label=Follow%20%40chainlit_io\" style=\"max-width:100%;\"></a>\n    <a href=\"https://pypistats.org/packages/chainlit\" rel=\"nofollow\"><img alt=\"Downloads\" src=\"https://img.shields.io/pypi/dm/chainlit\" style=\"max-width:100%;\"></a>\n        <a href=\"https://github.com/chainlit/chainlit/graphs/contributors\" rel=\"nofollow\"><img alt=\"Contributors\" src=\"https://img.shields.io/github/contributors/chainlit/chainlit\" style=\"max-width:100%;\"></a>\n    <a href=\"https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml\" rel=\"nofollow\"><img alt=\"CI\" src=\"https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml/badge.svg\" style=\"max-width:100%;\"></a>\n</p>\n\n<p align=\"center\">\n    <a href=\"https://docs.chainlit.io\"><b>Documentation</b></a>  \u2022  \n    <a href=\"https://help.chainlit.io\"><b>Chainlit Help</b></a>  \u2022  \n    <a href=\"https://github.com/Chainlit/cookbook\"><b>Cookbook</b></a>\n</p>\n\n<p align=\"center\">\n    <a href=\"https://trendshift.io/repositories/6708\" target=\"_blank\"><img src=\"https://trendshift.io/api/badge/repositories/6708\" alt=\"Chainlit%2Fchainlit | Trendshift\" style=\"width: 250px; height: 45px;\" width=\"250\" height=\"45\"/></a>\n</p>\n\nhttps://github.com/user-attachments/assets/b3738aba-55c0-42fa-ac00-6efd1ee0d148\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### Development version\n\nThe latest in-development version can be installed straight from GitHub with:\n\n```sh\npip install git+https://github.com/Chainlit/chainlit.git#subdirectory=backend/\n```\n\n(Requires Node and pnpm installed on the system.)\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## \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](/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": "2.2.1",
    "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": null,
            "digests": {
                "blake2b_256": "b8ef4408863d8110462bea8ee971a9f747ceeaafe3aa0404f0d7e85d6b06bb1c",
                "md5": "9999c057cf871c8f6289104580dde4d8",
                "sha256": "c2cc7d84386073899164b960371a9c046f175a9659763189cb9f1130b544b694"
            },
            "downloads": -1,
            "filename": "chainlit-2.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9999c057cf871c8f6289104580dde4d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.9",
            "size": 9623188,
            "upload_time": "2025-02-15T05:53:12",
            "upload_time_iso_8601": "2025-02-15T05:53:12.749282Z",
            "url": "https://files.pythonhosted.org/packages/b8/ef/4408863d8110462bea8ee971a9f747ceeaafe3aa0404f0d7e85d6b06bb1c/chainlit-2.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5a0d19f66ced254c35cd0595ba064402a15c2ca3d3fba2a75f7ea75b52619871",
                "md5": "f83393907596e1d4779397ea427203f1",
                "sha256": "45bfc5721f7b0766a3b9ef748478ec1043cfdcb9edc78e23a89db489335f10e9"
            },
            "downloads": -1,
            "filename": "chainlit-2.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f83393907596e1d4779397ea427203f1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.9",
            "size": 9473105,
            "upload_time": "2025-02-15T05:53:15",
            "upload_time_iso_8601": "2025-02-15T05:53:15.650705Z",
            "url": "https://files.pythonhosted.org/packages/5a/0d/19f66ced254c35cd0595ba064402a15c2ca3d3fba2a75f7ea75b52619871/chainlit-2.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-15 05:53:15",
    "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: 0.47477s