shinychat
An AI Chat interface for Shiny apps.
What it is and what it does
shinychat is a chat UI component library for Shiny for Python that abstracts the interface layer for building conversational applications. It provides a Chat class that manages message display, user input collection, and event handling, letting developers focus on the backend logic rather than HTML/CSS markup. The component integrates directly into Shiny's reactive framework and supports both imperative and declarative usage patterns.
Typically used to add a chat interface to a Shiny app by instantiating a Chat object, rendering it with `.ui()`, and attaching an async callback to handle user submissions. Messages are managed as a reactive list, and the component handles rendering, scrolling, and input field management. It is automatically included with Shiny for Python but can be installed separately if needed.
Use it for:
- Build a chatbot UI in a Shiny app that delegates message generation to an external LLM API.
- Create an interactive Q&A interface where user queries trigger backend computations and responses are appended to the chat.
- Prototype conversational data exploration tools that accept natural-language queries and display results.
- Add a support or help chat widget to an existing Shiny dashboard without writing custom HTML/JavaScript.
- Develop multi-turn dialogue systems where message history is maintained and used for context in subsequent calls.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
shinychat provides a chat UI component for building conversational interfaces in Shiny for Python applications, handling message display, user input, and callback handling.
Yes, if you are building a Shiny for Python application that needs a chat interface. The component is actively maintained, has no known vulnerabilities, low install friction, and integrates seamlessly with Shiny's reactive model. It is permissively licensed and already included with Shiny, so installing it separately is optional unless you need a specific version or want to use it outside a Shiny context.
Install
shinychat on PyPI
pip
pip install shinychatuv
uv add shinychatpoetry
poetry add shinychatInstalling shinychat
Before you install
Low friction installation with a pure-Python wheel. Actively maintained with a recent release and no known vulnerabilities. Depends on htmltools, pydantic, and shiny—all stable, widely-used libraries.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install shinychat
from shiny.express import render, ui
from shinychat.express import Chat
chat = Chat(id="chat", messages=[{"content": "Hello!", "role": "assistant"}])
chat.ui()
@chat.on_user_submit
async def handle_input(user_input: str):
await chat.append_message(f"You said: {user_input}")
Requires Python 3.10 or later and a working Shiny for Python environment.
Verify before relying
- Whether the package includes built-in LLM integration or only provides UI scaffolding for user-supplied models.
- Performance characteristics and message history size limits for typical chat applications.
- Styling and customization options beyond what the example demonstrates.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — htmltools, pydantic, shiny |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 320,603/month — #7,635 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: shinychat-0.6.1-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
chainlitChainlit provides a web UI framework for…
permissive · top 15,000 on PyPI
shinyShiny for Python is a web development framework…
permissive · top 15,000 on PyPI
shinywidgetsEmbeds ipywidgets (Jupyter interactive widgets)…
permissive · top 15,000 on PyPI
shinyswatchProvides 25 Bootswatch + Bootstrap 5 themes for…
permissive · top 15,000 on PyPI
chatlasChatlas provides a unified Python interface for…
permissive · top 15,000 on PyPI
openai-chatkitA backend SDK for building chat applications…
unclear · top 15,000 on PyPI
faiconsProvides Font Awesome 6.2.0 icons as SVG…
permissive · top 15,000 on PyPI
rsconnect-pythonrsconnect-python is a command-line tool for…
unclear · top 15,000 on PyPI
rasa-sdkRasa SDK provides a Python framework for…
permissive · top 15,000 on PyPI
assistant-streamProvides server-side streaming support for AI…
permissive · top 15,000 on PyPI