Skip to main content

pySunshower is a Python library for evaluating AI agents in a declarative way.

Project description

pySunshower

Declarative and Distributed Benchmarking for AI Agents
pySunshower is a Python library for evaluating AI agents during the design phase of system development. It allows you to pit AI agents against each other in parallel environments to find the best architecture for your specific agent-driven task.

Overview

Not all AI agents are created equal. In the design phase of system development, choosing the right harness and model is critical. pySunshower automates this decision-making process by running trials in parallel and using an LLM to score the results.

diagram

Features

  • Declarative: Define your entire experiment (teams, models, harnesses, and metrics) in YAML
  • Efficient: Uses Ray to run multiple trials in parallel across available CPU/GPU cores
  • Automated Judging: Implements a LLM-as-a-Judge approach to evaluate outputs based on custom rubrics like accuracy, cost, trajectory, and speed

Installation

Step 1. Create a Python virtual environment.

python -m venv .venv

Step 2. Activate the Python virtual environment you just created. This step assumes you're working in a Linux-based environment. If you're using another operating system, adjust accordingly.

source .venv/bin/activate

Step 3. Install pySunshower.

pip install pysunshower

The Experiment Schema

pySunshower uses Kubernetes-inspired YAML to define experiments. The example below defines an experiment that will run two different AI agents three times (in parallel).

---
apiVersion: v1
kind: ExperimentSet
metadata:
  name: Experiment Set 1
  description: The purpose of this experiment is to determine which team is the best at achieving the task.
spec:
  task: Generate a report that summarized the top 3 trending topics in cyber-related news.
  trials: 3
  teams:
    - name: Team 1
      agents:
        - name: Alpha
          model:
            provider: openai
            name: gpt-4.1
            prompt: You are a helpful assistant.
          harness:
            tools:
              - serper
    - name: Team 2
      agents:
        - name: Bravo
          model:
            provider: openai
            name: gpt-4.1
            prompt: You are a Cyber Threat Intelligence analyst assigned to support a Cyber Security Service Provider (CSSP) within the Department of Defense.
          harness:
            tools:
              - serper
  judges:
    - name: Judge 1
      model:
        provider: openai
        name: gpt-4.1
        prompt: You are a judge responsible for evaluating the output of AI agents.
      harness:
        tools:
          - serper
      metricsToEvaluate: 
        - metric: cost
          prompt: The total cost for the agent's execution must not exceed $0.05 USD, calculated from total token usage for all LLM calls. 
        - metric: speed
          prompt: The agent's total execution time must remain under 3.0 seconds.
        - metric: trajectory
          prompt: Penalize the team 1 point for every unnecessary tool call made during the workflow.
      teamsToEvaluate: [ all ]

Usage

Step 1. Create a .env file in your current working directory to contain your API keys.

OPENAI_API_KEY=your_key_here
SERPER_API_KEY=your_key_here

Step 2. Run an experiment using a Python script or Jupyter Notebook. Below is a code block example.

from sunshower import engine

# This will:
# 1. Spin up a local Ray cluster
# 2. Run your agents in parallel
# 3. Generate a 'results.md' scorecard
engine.start(experiments.yaml)

Step 3. After the run finishes, pySunshower will produce a results.md containing a detailed breakdown of which team "won" based on the criteria defined in your experiment file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysunshower-0.0.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysunshower-0.0.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pysunshower-0.0.2.tar.gz.

File metadata

  • Download URL: pysunshower-0.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pysunshower-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4eec5553c21ff0c2266e38ba005a386f421ba87fff1bb126e65ce56d0be39278
MD5 a89cab86fb4439e5d6d6e65a822c1f27
BLAKE2b-256 11c5cde02370533a89766553b10a80c350b2ebd34c1a9342cb4205f7c61022e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysunshower-0.0.2.tar.gz:

Publisher: publish.yaml on deathlabs/pySunshower

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysunshower-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pysunshower-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pysunshower-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 334236754610153ab9a566060e314d6fbdc063debb6f7a4702542732d9e26888
MD5 ec706fdee05df6276d55a9dc317d715a
BLAKE2b-256 ba9edcb2d9b096e110ecad876e1b3e810ebd5149920d3d2faf8c0966cdefae28

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysunshower-0.0.2-py3-none-any.whl:

Publisher: publish.yaml on deathlabs/pySunshower

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page