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.1.tar.gz (346.6 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.1-py3-none-any.whl (876.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: heybee-0.9.1.tar.gz
  • Upload date:
  • Size: 346.6 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.1.tar.gz
Algorithm Hash digest
SHA256 3ff788cc57af843b8fbd872bc16176b987de8a33dfb16967ee88bbaae1df6522
MD5 55d4d92386e0279919ca8c25f14ce9f9
BLAKE2b-256 7e5da820c5b6a86bedf30401ac35ddc6f43fbf51feeb66ce30b7ab0cdc4c4896

See more details on using hashes here.

File details

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

File metadata

  • Download URL: heybee-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 876.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 771a52dd64a3344b4c84c926d8d6afb544a5a056c3d77a6affd15d4e7c45aa64
MD5 ca202034fcc2b656006625b4eb147643
BLAKE2b-256 037b8551d19a422e9a9d278a329537c6acfbc80b7ff475594d656dfd144452e2

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