LLM Chat APP Framework Built with Dash – Chatnificent

I’m happy to share a new framework that I’m building with Dash, to help create custom LLM chat apps.

The ideal is that this framework is minimally complete, maximally hackable.

You can get started with a pip install and three lines of code, yet you can plug any component you want and modify any existing defaults as much as possible.

Quick demo:

Beyond this basic app you can modify any of the pillars of the framework:

  • llm: Use any LLM provider you want by sub-classing the base LLM class. The package ships with OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter and Ollama out of the box. They can all be modified, and/or you can easily get any other provider.
  • store: The default is to store conversations in-memory, there are file and SQLite implementations in the package, which you can customize or completely change.
  • layout : The default layout provider is dash-bootstrap-components, but it’s not a required dependency, and you can easily swap it with dash-mantine-components for example (dmc doesn’t look very good, could use some help) Thanks to @AnnMarieW dmc looks much better with a few enhancements. You can now run pip install chatnificent[mantine] to get the correct versions of dmc and dash-iconify, Thanks!.
  • auth: the default is anonymous authentication (any user can start chatting), but this is also modifiable
  • engine: an independent module that is mainly concerned with orchestrating the functionality so it remains provider/implementation agnostic. The handle_message method here contains many steps several of which are empty hooks like _before_retrieval and _after_retrieval, so you can add your own functionality.
  • callbacks A module that has all interactivity features (regular Dash callback functions)
  • tools: Bring your own tools or choose to run a PythonTool that you create.
  • retrieval: Basic functionality for retrieving data and adding it to your chats to enhance the functionality

I’ll be adding examples to showcase the functionality and hopefully make it easier to customize your own apps.

Lot’s of improvements/customizations can be added, but I wanted to share the current version which is good enough for getting started.

Hope you like it and I look forward to feedback, bugs, suggestions.

You can play with this app with this deployed version on Plotly Cloud

Github Repo GitHub - eliasdabbas/chatnificent: Chatnificent: LLM chat app framework – Minimally complete. Maximally hackable.

3 Likes

This part in the repo’s Readme says it all:

Chatnificent is a Python framework built on Plotly’s Dash designed to get your LLM chat applications up and running instantly, while providing a robust, decoupled architecture for unlimited customization.

One of the biggest advantages is the Building Your Own Pillars feature.

What a great idea, @eliasdabbas.

1 Like

Thanks @adamschroeder !

Yes, exactly. It’s about being to customize just the parts of the app that you want, without having to rebuild the whole thing every time. Hopefully making it easy to create new (types) of apps as well.

Love it! Sweet project, awesome video.

1 Like

Thank you @nathandrezner !

Hi @eliasdabbas

Awesome project!
I can help with the DMC layout if you like :slightly_smiling_face:

1 Like

Thanks @AnnMarieW
Great to hear that!

I would really appreciate your help, yes of course.

Some thoughts:

  • Swapping layout providers is easy:
import chatnificent as chat
app = chat.Chatnificent(
    layout=chat.layout.Mantine()
)
app.run()
  • Callbacks work seamlessly across any layout provider. But in order to keep that promise all components need to have universal properties. That’s why I don’t have dbc.Offcanvas, because regular html components don’t have an is_open property. Same with dmc.Drawer I think. That’s why I have a basic html.Div(hidden=True/False)

Looking forward to your thoughts.

Thanks!

Great! I’ll move the discussion to your GitHub so I don’t spam your topic here :slight_smile:

1 Like