{"id":13454423,"url":"https://github.com/Chainlit/chainlit","last_synced_at":"2025-03-24T05:33:49.820Z","repository":{"id":165483429,"uuid":"613984283","full_name":"Chainlit/chainlit","owner":"Chainlit","description":"Build Conversational AI in minutes ⚡️","archived":false,"fork":false,"pushed_at":"2024-10-25T12:38:06.000Z","size":6243,"stargazers_count":7081,"open_issues_count":282,"forks_count":928,"subscribers_count":53,"default_branch":"main","last_synced_at":"2024-10-29T15:03:56.261Z","etag":null,"topics":["chatgpt","langchain","llm","openai","openai-chatgpt","python","ui"],"latest_commit_sha":null,"homepage":"https://docs.chainlit.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chainlit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-14T16:54:04.000Z","updated_at":"2024-10-29T14:22:58.000Z","dependencies_parsed_at":"2023-09-28T01:57:14.704Z","dependency_job_id":"ce793f20-597e-444c-98d9-a73c4ee68a96","html_url":"https://github.com/Chainlit/chainlit","commit_stats":{"total_commits":838,"total_committers":85,"mean_commits":9.858823529411765,"dds":0.5,"last_synced_commit":"6f9d0331df78e8069b0d21d2c27bc2e698556be5"},"previous_names":[],"tags_count":122,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chainlit%2Fchainlit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chainlit%2Fchainlit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chainlit%2Fchainlit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chainlit%2Fchainlit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chainlit","download_url":"https://codeload.github.com/Chainlit/chainlit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245119571,"owners_count":20563763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","langchain","llm","openai","openai-chatgpt","python","ui"],"created_at":"2024-07-31T08:00:53.964Z","updated_at":"2025-03-24T05:33:49.807Z","avatar_url":"https://github.com/Chainlit.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003eWelcome to Chainlit by Literal AI 👋\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cb\u003eBuild python production-ready conversational AI applications in minutes, not weeks ⚡️\u003c/b\u003e\n\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/k73SQ3FyUh\" rel=\"nofollow\"\u003e\u003cimg alt=\"Discord\" src=\"https://dcbadge.vercel.app/api/server/ZThrUxbAYw?style=flat\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/chainlit_io\" rel=\"nofollow\"\u003e\u003cimg alt=\"Twitter\" src=\"https://img.shields.io/twitter/url/https/twitter.com/chainlit_io.svg?style=social\u0026label=Follow%20%40chainlit_io\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypistats.org/packages/chainlit\" rel=\"nofollow\"\u003e\u003cimg alt=\"Downloads\" src=\"https://img.shields.io/pypi/dm/chainlit\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/chainlit/chainlit/graphs/contributors\" rel=\"nofollow\"\u003e\u003cimg alt=\"Contributors\" src=\"https://img.shields.io/github/contributors/chainlit/chainlit\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml\" rel=\"nofollow\"\u003e\u003cimg alt=\"CI\" src=\"https://github.com/Chainlit/chainlit/actions/workflows/ci.yaml/badge.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://chainlit.io\"\u003e\u003cb\u003eWebsite\u003c/b\u003e\u003c/a\u003e  •  \n    \u003ca href=\"https://docs.chainlit.io\"\u003e\u003cb\u003eDocumentation\u003c/b\u003e\u003c/a\u003e  •  \n    \u003ca href=\"https://help.chainlit.io\"\u003e\u003cb\u003eChainlit Help\u003c/b\u003e\u003c/a\u003e  •  \n    \u003ca href=\"https://github.com/Chainlit/cookbook\"\u003e\u003cb\u003eCookbook\u003c/b\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://trendshift.io/repositories/6708\" target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/6708\" alt=\"Chainlit%2Fchainlit | Trendshift\" style=\"width: 250px; height: 45px;\" width=\"250\" height=\"45\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\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## 🚀 Quickstart\n\n### 🐍 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\u003cimg src=\"/images/quick-start.png\" alt=\"Quick Start\"\u003e\u003c/img\u003e\n\n## 📚 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с, 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## 💁 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## 📃 License\n\nChainlit is open-source and licensed under the [Apache 2.0](LICENSE) license.\n","funding_links":[],"categories":["Python","TypeScript","A01_文本生成_文本对话","Applications","SDK, Libraries, Frameworks","Repos","python","工具","Tools","chatgpt","UI/Interface","\u003ca name=\"Python\"\u003e\u003c/a\u003ePython","1. Local Agents"],"sub_categories":["大语言对话模型及数据","提示语（魔法）","Python library, sdk or frameworks","服务","Services","Vector Store Tutorials","Low-code \u0026 Visual Flow"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainlit%2Fchainlit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChainlit%2Fchainlit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainlit%2Fchainlit/lists"}