{"id":13643009,"url":"https://github.com/shroominic/fastui-chat","last_synced_at":"2025-04-05T18:10:10.710Z","repository":{"id":212959233,"uuid":"732702875","full_name":"shroominic/fastui-chat","owner":"shroominic","description":"💬 minimalistic ChatBot Interface in pure python","archived":false,"fork":false,"pushed_at":"2024-07-16T21:36:18.000Z","size":108,"stargazers_count":220,"open_issues_count":4,"forks_count":22,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T17:08:55.554Z","etag":null,"topics":["chatgpt","fast-api","fast-ui","langchain","minimalistic-chat-app","pydantic"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shroominic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"roadmap.todo","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-17T15:07:48.000Z","updated_at":"2025-03-14T14:55:59.000Z","dependencies_parsed_at":"2023-12-17T16:24:32.107Z","dependency_job_id":"e41ec243-94ba-4933-9e24-2cd49c019d69","html_url":"https://github.com/shroominic/fastui-chat","commit_stats":null,"previous_names":["shroominic/fastui-chat"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Ffastui-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Ffastui-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Ffastui-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shroominic%2Ffastui-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shroominic","download_url":"https://codeload.github.com/shroominic/fastui-chat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378149,"owners_count":20929297,"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","fast-api","fast-ui","langchain","minimalistic-chat-app","pydantic"],"created_at":"2024-08-02T01:01:39.483Z","updated_at":"2025-04-05T18:10:10.681Z","avatar_url":"https://github.com/shroominic.png","language":"Python","funding_links":[],"categories":["Chatbots"],"sub_categories":[],"readme":"# fastui-chat\n\n[![Version](https://badge.fury.io/py/fastui-chat.svg)](https://badge.fury.io/py/fastui-chat)\n![Downloads](https://img.shields.io/pypi/dm/fastui-chat)\n[![license](https://img.shields.io/github/license/shroominic/fastui-chat.svg)](https://github.com/shroominic/fastui-chat/blob/main/LICENSE)\n[![Twitter Follow](https://img.shields.io/twitter/follow/shroominic?style=social)](https://x.com/shroominic)\n\nA minimalistic ChatBot Interface in pure python. \u003c/br\u003e\nBuild on top of [FastUI](https://github.com/pydantic/FastUI) and [Funcchain](https://github.com/shroominic/funcchain).\n\n## Usage\n\n```bash\npip install fastui-chat\n```\n\n```python\nfrom fastui_chat import ChatUI\n\n# chatui inherits from FastAPI so you can use it as a FastAPI app\napp = ChatUI()\n\n# Run with:\n# uvicorn examples.minimal:app\n\n# for hot reloading:\n# uvicorn examples.minimal:app --reload\n\n# or use the built-in method\nif __name__ == \"__main__\":\n    app.start_with_uvicorn()\n```\n\n## Extend FastAPI\n\nYou can also only use the router and extend your existing FastAPI app.\n\n```python\nfrom fastapi import FastAPI\nfrom fastui_chat import create_chat_handler, create_history_factory\nfrom fastui_chat.chat import ChatAPIRouter\nfrom fastui_chat.history import InMemoryChatMessageHistory\nfrom fastui_chat.runtime import router as fastui_runtime\n\n# callable that returns a ChatMessageHistory given a session_id\nhistory_factory = create_history_factory(\n    # swap out with any from langchain_community.chat_message_histories\n    InMemoryChatMessageHistory,\n)\n\n# a chat handler generates an AIMessage based on a given HumanMessage and ChatHistory\nchat_handler = create_chat_handler(\n    llm=\"openai/gpt-4-turbo-preview\",\n    history_factory=history_factory,\n)\n\n# setup your fastapi app\napp = FastAPI()\n\n# add the chatui router to your app\napp.include_router(\n    ChatAPIRouter(history_factory, chat_handler),\n    prefix=\"/api\",\n)\n\n# make sure to add the runtime router as latest since it has a catch-all route\napp.include_router(fastui_runtime)\n\n# start the server with `uvicorn examples.fastapi_router:app`\n```\n\n## Features\n\n- Python Only\n- Easy to use\n- Minimalistic \u0026 Lightweight\n- LangChain Compatible\n- FastAPI Compatible\n- Parallel Chat Sessions\n- Switchable ChatHistory Backends\n- Insert your custom chat handler\n\n## Development Setup\n\n```bash\ngit clone https://github.com/shroominic/fastui-chat.git \u0026\u0026 cd fastui-chat\n\n./dev-install.sh\n```\n\n## Roadmap\n\nIf you want to contribute or see whats coming soon checkout the `roadmap.todo` file for open todos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshroominic%2Ffastui-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshroominic%2Ffastui-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshroominic%2Ffastui-chat/lists"}