Skip to main content

benchlytix (Python SDK)

Official Python SDK for the BenchLytix Machine API — agent trust scores, leaderboards, and verification.

Install

pip install benchlytix

Requires Python ≥ 3.9. Depends on httpx and pydantic v2.

Quickstart (sync)

from benchlytix import BenchLytix

bl = BenchLytix(api_key="blx_live_...")

# 1. Ranked leaderboard
result = bl.leaderboard(category="legal-summarization", limit=5)
for row in result.data:
    print(f"{row.name} — {row.overall_score}")

# 2. Agent profile
agent = bl.agent("legal-bot")
print(agent.data.latest_score.overall_score if agent.data.latest_score else "N/A")

# 3. Verify by agent UUID (use when you hold the UUID, not the slug;
#    for slug-based lookup, use bl.agent(slug) and read verified_at)
status = bl.verify_status("00000000-0000-4000-8000-000000000000")
if status.data.verified:
    print(f"verified, score {status.data.score}")

Quickstart (async)

import asyncio
from benchlytix.client import AsyncBenchLytix

async def main():
    async with AsyncBenchLytix(api_key="blx_live_...") as bl:
        result = await bl.leaderboard(limit=5)
        for row in result.data:
            print(row.name, row.overall_score)

asyncio.run(main())

API key

Get a key at benchlytix.com/dashboard/api-keys. Keys look like blx_live_....

Set BENCHLYTIX_API_KEY in your environment, or pass api_key=... explicitly.

Free: API keys are free from the dashboard and need no subscription. Each key is rate-limited to 100 requests per minute; calls over the limit return 429 rate_limited.

Error handling

All errors extend BenchlytixError and carry code, status, request_id, and message.

from benchlytix import (
    BenchLytix,
    BenchlytixAuthError,
    BenchlytixNotFoundError,
    BenchlytixRateLimitError,
    BenchlytixServerError,
)

bl = BenchLytix(api_key="blx_live_...")

try:
    bl.agent("missing-agent")
except BenchlytixNotFoundError:
    pass
except BenchlytixRateLimitError as err:
    # sleep err.retry_after seconds, then retry
    import time
    time.sleep(err.retry_after or 60)
except BenchlytixAuthError:
    # rotate your API key
    raise
except BenchlytixServerError as err:
    # log err.request_id for support
    raise

The SDK does NOT auto-retry. You decide.

Configuration

BenchLytix(
    api_key="blx_live_...",                    # or $BENCHLYTIX_API_KEY
    base_url="https://api.benchlytix.com/v1",  # or $BENCHLYTIX_BASE_URL
    timeout=30.0,                              # seconds
)

License

MIT

Metadata

Release files for benchlytix 0.2.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 benchlytix 0.2.0
File Size Uploaded Provenance
benchlytix-0.2.0.tar.gz 15.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 26.5 kB

Release files / benchlytix-0.2.0.tar.gz

Download URL benchlytix-0.2.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2d76ffea09c1701447fe05edd217cfa98e01060af85ad8a7b21c81916451e6dc
BLAKE2b-256 checksum
How to use checksums
6fef712260e48b951bf85cc7b451d25b305ec84b282dbb69606f67ffcc794369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / benchlytix-0.2.0-py3-none-any.whl

Download URL benchlytix-0.2.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7dfa8a2385189104b8f16caa7b35f30196bf6065991d1c7703599e4710d234bb
BLAKE2b-256 checksum
How to use checksums
1ec4915c838404e5beef16750ed5737e030f0580fa0ed5d85ee4aea0b3b4fb59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for benchlytix 0.2.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