Skip to main content

Python SDK for automating and integrating with the HeyBee controller.

Project description

heybee

Python SDK for automating and integrating with the HeyBee controller.

Install

pip install heybee

Quick start

The public API supports the product language users see in the app:

  • evaluation / output / variant / prompt
  • client.evaluations.create()
  • client.outputs.upload()
  • client.voting_links.create()
  • client.results.get()
  • client.insights.parameters()
from heybee import HeyBee

client = HeyBee(api_key="hb_...")

evaluation = client.evaluations.create(
    name="SDXL sampler benchmark",
    evaluation_type="image",
    objective="benchmark",
    prompt_field="prompt",
    variant_definitions=[
        {"name": "sampler", "type": "categorical", "values": ["euler", "dpmpp_2m"]},
        {"name": "steps", "type": "continuous", "min_value": 10, "max_value": 60},
    ],
)

uploaded_outputs = client.outputs.upload(
    evaluation_id=evaluation.id,
    outputs=[
        {
            "path": "outputs/cat-euler.png",
            "prompt": "A cinematic photo of a cat",
            "variant_key": "sdxl-euler",
            "variant_label": "SDXL Euler",
            "parameters": {"sampler": "euler", "steps": 30},
        },
        {
            "path": "outputs/cat-dpmpp.png",
            "prompt": "A cinematic photo of a cat",
            "variant_key": "sdxl-dpmpp",
            "variant_label": "SDXL DPM++ 2M",
            "parameters": {"sampler": "dpmpp_2m", "steps": 30},
        },
    ],
    spend_limit=500,
)

voting_link = client.voting_links.create(
    evaluation_id=evaluation.id,
    name="SDXL round 1",
    max_participants=200,
)

print(evaluation.id)
print(voting_link.voting_url if voting_link else "No voting link created")

Compatibility names remain supported for existing scripts:

from heybee import ExperimentSpec, HeyBee, ParameterDefinition, SampleInput

client = HeyBee(api_key="hb_...")

result = client.publish.experiment(
    experiment=ExperimentSpec(
        name="SDXL sampler benchmark",
        experiment_type="image",
        kind="advanced",
        objective="benchmark",
        anchor_field="prompt",
        parameter_schema=[
            ParameterDefinition(name="sampler", type="categorical", values=["euler", "dpmpp_2m"]),
            ParameterDefinition(name="steps", type="continuous", min_value=10, max_value=60),
        ],
    ),
    samples=[
        SampleInput(
            path="outputs/cat-euler.png",
            anchor_value="A cinematic photo of a cat",
            candidate_key="sdxl-euler",
            candidate_label="SDXL Euler",
            parameters={"sampler": "euler", "steps": 30},
        ),
        SampleInput(
            path="outputs/cat-dpmpp.png",
            anchor_value="A cinematic photo of a cat",
            candidate_key="sdxl-dpmpp",
            candidate_label="SDXL DPM++ 2M",
            parameters={"sampler": "dpmpp_2m", "steps": 30},
        ),
    ],
    fund_comparisons=500,
)

print(result.experiment.id)
print(result.voting.voting_url if result.voting else "No voting link created")

The compatibility snippet maps current SDK names to the same product concepts: experiments are evaluations, samples are outputs, anchors are prompts, and candidates are variants. Owner-paid credits are authoritative: counted votes spend from the evaluation credit owner's account, spend_limit maps to the evaluation spend limit, and fund_comparisons / fund() are compatibility APIs for that spend-limit behavior rather than a separate comparison pool.

Design goals

  • Sync-first API for scripts and notebooks
  • API-key, JWT bearer, and anonymous seat-token route support
  • A stable, product-facing public surface (evaluations, outputs, voting links, results, insights) with wider controller route coverage available for advanced use
  • Typed models for stable workflows plus dictionary payloads for broad route parity
  • Backward-compatible experiment/sample naming while product-language aliases migrate users toward evaluations and outputs

Public surface

The supported, semver-stable surface contains customer-owned product resources only. Internal administration and test-runner routes are intentionally absent from the package. Private operations use a separately distributed admin tool.

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

heybee-0.9.0.tar.gz (345.4 kB view details)

Uploaded Source

Built Distribution

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

heybee-0.9.0-py3-none-any.whl (870.4 kB view details)

Uploaded Python 3

File details

Details for the file heybee-0.9.0.tar.gz.

File metadata

  • Download URL: heybee-0.9.0.tar.gz
  • Upload date:
  • Size: 345.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for heybee-0.9.0.tar.gz
Algorithm Hash digest
SHA256 9f17938c65b47b84f1079f3b427699091f5dd326faeeeb8aff0ec05c727e221e
MD5 93dd1336a8221b828b355eaec780c1c6
BLAKE2b-256 8bb5aa589a46d83ab6e424662038db7cebad0ea6bc6ff0c9343c737dcfbd66af

See more details on using hashes here.

File details

Details for the file heybee-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: heybee-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 870.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for heybee-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b95b5634ccc8dbbaa7c42425eb5658f64394077ff7515ad5257d52056316e4aa
MD5 bf87b6c5657b3136f0fcc31c5b95ed34
BLAKE2b-256 7a4666473a15f318b7c1e405d32f4b5b2c210af28189ef33df1dcad7e0d8e9a4

See more details on using hashes here.

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