Skip to main content

Multi-Chat

Ask one question, let up to five LLMs answer it side by side. A small, working showcase of GraphLang: the chat logic is a graph file (chat_turn.graph.yaml), and this Streamlit app only draws the conversation and runs that graph, once per chatbot per question.

Multi-Chat: three chatbots (Claude Opus, Claude Sonnet replying in Chinese, and a local Ollama model) answering the same question side by side

Features

  • Compare models: 1 to 5 chatbots, each with its own provider, model, "turns it sees", language, temperature and instructions (a system prompt, so you can compare prompts as well as models). Every question goes to all of them in parallel, each keeps its own conversation, and each answer appears in its column as soon as it arrives.
  • Providers: anthropic (through the Claude CLI), anthropic-api, openrouter, openai, deepseek, qwen, ollama.
  • Settings page: fetch each provider's model list, tick the models you want; only those appear in the Model dropdown (saved in the SQLite database ~/.graflang/multi_chat.db).
  • Easy to line up: numbered questions ([4] what is ...) in every column, response time, tokens and cost per answer, totals per chat, a scrollbar per chatbot, adjustable pane height and font size.
  • Feedback and blind mode: 📋 copy, 🔊 read aloud, 👍 / 👎, 🏆 best answer per question. Blind mode hides the model names until you pick the best answer.
  • Compare answers: a model of your choice compares the answers to one question (agree, differ, doubtful, most complete); it is a second graph, compare_answers.graph.yaml.
  • Retry and redo: a failed chatbot can be retried alone; ↻ asks a chatbot its latest question again.
  • Batch: upload a list of questions (.txt, .csv, .yaml) and every chatbot answers them all.
  • Presets: save a line-up of chatbots under a name and load it later.
  • Attachments: text files and PDFs go to every chatbot; images to the providers that can read them.
  • Dead links flagged: the links in each answer are checked, and dead ones get ❌ (addresses on your own machine or network are never requested).
  • Export: YAML (GraphLang-YYMMDD-HHMMSS.chat.yaml, complete, can be imported again) or Markdown, organised by question.
  • Review page: every chat is saved; search them, read them, open one on the Chats page to go on, disable or delete it, import an export file. A leaderboard shows, per model, the 🏆 wins, thumbs, time and cost.
  • About page: how a question travels through the graph, and the stack behind it.

Quick Setup

Python 3.11 or newer.

git clone https://github.com/digital-duck/multi-chat.git
cd multi-chat

python -m venv .venv && source .venv/bin/activate
# conda create -n chat python=3.11
# conda activate chat

pip install -r requirements.txt
streamlit run src/app.py        # from the repo root, so .streamlit/config.toml applies

What each provider needs:

Provider Needs Cost
anthropic the Claude CLI installed and signed in (no images, no temperature) billed
anthropic-api export ANTHROPIC_API_KEY=... billed
openrouter export OPENROUTER_API_KEY=... (the model list loads without it) billed
openai export OPENAI_API_KEY=... billed
deepseek export DEEPSEEK_API_KEY=... billed
qwen export DASHSCOPE_API_KEY=... billed
ollama Ollama running at localhost:11434 (or $OLLAMA_HOST) with a model pulled free

Costs shown are what the provider reports, or OpenRouter's prices times the tokens; the Claude CLI's cost is not known (its token counts are estimates).

requirements.txt installs GraphLang from GitHub, because this app needs graphlang.grafr.metering, which the PyPI release (0.1.1) does not have yet.

The graph

add_question (SOLVE) -> trim (SOLVE) -> answer (GENERATE) -> add_reply (SOLVE)

The history and the question go in (with the chatbot's language, instructions and the formatting rules); the question is appended, the history is trimmed to the last N turns, the model replies (one call, capped at one per run), and the reply and the new history come out. The same graph runs without the app:

graf validate src/chat_turn.graph.yaml
graf run src/chat_turn.graph.yaml --llm claude_cli:claude-sonnet-5-5 \
    --param question="What is a graph?" --param history='[]'

Layout

The code is in src/; the root keeps the docs, requirements, tests and .streamlit/config.toml. Scratch files (the GraphLang kernels' sockets) go in tmp/, which git ignores.

Path What
src/app.py entry point: the four pages
src/views/multi_chat.py the Chats page
src/views/review.py the Review page: saved chats, import, leaderboard
src/views/config_llm.py the Settings page
src/views/about.py the About page
src/chat_turn.graph.yaml one chat turn as a GraphLang graph
src/compare_answers.graph.yaml a comparison of the answers to one question
src/chat_engine.py runs the graphs (and the image turns, which bypass them); tokens, cost, kernel reuse
src/chat_db.py SQLite: sessions, messages, comparisons, settings
src/chat_models.py providers, their model lists and the saved selection
src/chat_export.py YAML and Markdown export, YAML import
src/chat_render.py how an answer is shown (both pages)
src/link_check.py the dead-link check
tests/ pytest tests (no model is called)

Tests

pip install -r requirements-dev.txt
pytest tests

Status

An early prototype, built on an early prototype (GraphLang). Anthropic and OpenRouter calls cost money: every question is one call per chatbot.

License

Apache License 2.0, see LICENSE.

Metadata

Release files for dd-chat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dd-chat 0.1.0
File Size Uploaded Provenance Actions
dd_chat-0.1.0.tar.gz 54.1 kB Without provenance Details for dd_chat-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dd-chat 0.1.0
File Interpreter ABI Platform Actions
dd_chat-0.1.0-py3-none-any.whl Python 3 none any Details for dd_chat-0.1.0-py3-none-any.whl

Total release size: 109.3 kB

Release files / dd_chat-0.1.0.tar.gz

Download URL dd_chat-0.1.0.tar.gz
Size 54.1 kB
Tags Source
SHA-256 checksum
How to use checksums
478a8fbfaa5d72d73ec9ac3df02d6cc84f370637adf25b3602e980da7f3b1ec5
BLAKE2b-256 checksum
How to use checksums
c7c757767b011635b394f2d5a2cf87524f0fe16133d009ed2e3073a6f82a33f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / dd_chat-0.1.0-py3-none-any.whl

Download URL dd_chat-0.1.0-py3-none-any.whl
Size 55.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9c996d93c2f838eb12d69cd6212460bd622ed2565c47212f37a3afe08407c63
BLAKE2b-256 checksum
How to use checksums
666976d975ac2e8fd21578c8efd0e15d096d93aae3672a6f67040e2b322df35c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Security for dd-chat 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page