Skip to main content

🍋😛 SUMMONy aka S6

Collection of tools and UIs for chatting and experimenting with multiple LLMs (via their APIs) at the same time.

screenshot 0

Features

  • support for most top-tier and/or common LLM APIs:
    • OpenAI, Anthropic, Google Gemini, Ollama API, more to come
    • all under a common interface
    • (coming soon) supporting multimodal capabilities
  • parallel streaming and display of outputs - to be able to read the results as fast as possible
  • simple but powerful jupyter notebook code-first UI capable of:
    • re-asking the same question with different parameters
    • asking questions only to specific agents in a multi-agent conversation, aka tree-style/non-linear conversations
    • (to be improved) rendeing of LaTeX, html, code and diagrams in common formats in answers
  • simple but powerful conversations (de)serialization format, capturing both the messages and the parameters useed at their generation, and able to avoid storing duplicated copies of the same message in the histories of multiple agents part of the conversation
  • full api-calls logging (file based, structured - JSON): every request-response pair, every chunk in a stream response

Install

pip install summony summony[openai] summony[anthropic] summony[google] summony[ollama]

Usage / examples

Prerequisites

  • copy .env.example to .env (git ignored) and add in your API keys
  • either install summony package or clone this repo and follow instructions under "Develop / run-from cloned repo" heading

Jupyter Notebook UI

(See full example in ./example-1.v2.ipynb - rerun locally to see full ouputs as some parts are not rendered notebook previews)

c = NBUI(
    models=[
        "claude-3-5-sonnet",  # model name "shortcuts" for anthropic too (eg. instead of "claude-3-5-sonnet-20240620" etc.)
        "o1-preview",  # reasoning models supported under same interface
        "gemini-1.5-pro-002",
    ],
    system_prompt="You are the sum of most of humanity's knowledge crystallized into a single entity: a helpful and thoughtful AI.",
    p_temperature={0: 0.6, 2: 0.8},  # params targetted to agents by index, eg. 0.6 for sonnet, 0.8 for gemini
)
await c("What is entropy?")  # async default to suport simultaneous display of parallel streaming responses

screenshot 1

[...]

screenshot 2

# ask follow-up question only to first agent (sonnet)
await c("What about quantum entropy?", to=[0])

screenshot3

# re-generate answer for third agent (originally generated reply messagee is kept in conversation history too, but ignored for further request unless explicitly picked by setting its .chosen=True)
await c(to=[2])
# next question targetting *all* agents in conversation
await c("Make me a very concise table with contexts and equations for entropy")
# serializing conversation to JSON
from summony.agents.serialization import conversation_to_dict

conv_dict = conversation_to_dict(c.agents)
with open("./data/example-1-conv.json", "w") as f:
    f.write(json.dumps(conv_dict, indent=2, ensure_ascii=False))
print(json.dumps(conv_dict, indent=2, ensure_ascii=False))
# read store conversation and boot it up in an UI
from summony.agents.serialization import conversation_from_dict

with open("./data/example-1-conv.json", "r") as f:
    conv_dict = json.loads(f.read())
restored_agents = conversation_from_dict(conv_dict)
restored_agents
c2 = NBUI(agents=restored_c_agents)

# (re)display conversation from agents histories
c2.show_conversation(short=80)
# carry on a restored conversation as you'expect
await restored_c.ask("Display it as HTML instead")

Develop / run-from cloned repo

Using UV

NOTE: uv is an awesome alterative to Pipenv, Poetry etc.

# create and activate python virtual environment
uv venv
source ./.venv/bin/activate

# install dependencies as recorded in uv.lock
uv sync --locked --all-extras

# create jupyter kernel for environment
uv run ipython kernel install --user --name=s6-uv

# run jupyter
uv run --with jupyter jupyter lab

Using plain pip

# (optional, recommended) create and activate a Python 3.12+ environment
pip install -r ./requirements.txt
ipython kernel install --user --name=s6-uv  # create jupyter kernel for environment
jupyter notebook  # or: jupyter lab

Release files for summony 0.1.2

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

Source distribution (sdist)

Source distribution for summony 0.1.2
File Size Uploaded
summony-0.1.2.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for summony 0.1.2
File Interpreter ABI Platform
summony-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / summony-0.1.2.tar.gz

Download URL summony-0.1.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
19d027a0cf7b212273559c754aa03c81c93fa7dfc8387514ecab0592fa8ef5ed
BLAKE2b-256 checksum
How to use checksums
da086f8cbaf95636d33f62f1a6256f8c782b6aeb9c4cb20fa1844769f9e15cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release files / summony-0.1.2-py3-none-any.whl

Download URL summony-0.1.2-py3-none-any.whl
Size 30.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
954e709185ff45eea39d4f6f12a41b8fecd0e7cf54ad239a4555743baa593419
BLAKE2b-256 checksum
How to use checksums
6ccd41b6fc1bca4ba1d323781ca7d436c8b11461543b22844858a8a0c86bc276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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