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:
- How to change LLM providers and/or their models
- How to swap the storage of the conversations (InMemory, File, and SQLite)
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 isdash-bootstrap-components, but it’s not a required dependency, and you can easily swap it withdash-mantine-componentsfor example () Thanks to @AnnMarieW dmc looks much better with a few enhancements. You can now rundmcdoesn’t look very good, could use some helppip install chatnificent[mantine]to get the correct versions ofdmcanddash-iconify, Thanks!.auth: the default is anonymous authentication (any user can start chatting), but this is also modifiableengine: an independent module that is mainly concerned with orchestrating the functionality so it remains provider/implementation agnostic. Thehandle_messagemethod here contains many steps several of which are empty hooks like_before_retrievaland_after_retrieval, so you can add your own functionality.callbacksA module that has all interactivity features (regular Dash callback functions)tools: Bring your own tools or choose to run aPythonToolthat 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