Skip to main content

bench-observe

Python SDK for Bench — observability for AI agents. Zero dependencies.

pip install bench-observe

Usage

import asyncio
from bench import observe

agent = observe(api_key="bk_xxx", agent="my-agent")

async def search(t):
    result = await do_search()
    t.log("found", len(result))
    t.cost(0.004)
    return result

async def main():
    result = await agent.task("search", {"query": "python"}, search)

asyncio.run(main())

Context manager

async with agent.task_ctx("summarize", {"doc": url}) as t:
    summary = await llm.generate(prompt)
    t.log("tokens", 1200)
    t.cost(0.012)

Subtasks

async def pipeline(t):
    await t.subtask("fetch", {"url": url}, fetch_fn)
    await t.subtask("parse", {"html": html}, parse_fn)
    await t.subtask("embed", {"text": text}, embed_fn)

await agent.task("full-pipeline", input, pipeline)

Custom events

agent.event("tool.use", {"tool": "search", "query": q})

LangChain adapter

pip install bench-langchain
from bench import observe
from bench_langchain import BenchCallbackHandler

agent = observe(api_key="bk_xxx", agent="my-langchain-agent")
handler = BenchCallbackHandler(agent)

# Every chain/LLM/tool call is now a traced Bench task
chain.invoke({"input": "..."}, config={"callbacks": [handler]})

After one run you get a live dashboard, public profile, and README badge — no other setup.

Metadata

Release files for bench-observe 0.1.1

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

Source distribution (sdist)

Source distribution for bench-observe 0.1.1
File Size Uploaded Provenance Actions
bench_observe-0.1.1.tar.gz 4.1 kB Without provenance Details for bench_observe-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bench-observe 0.1.1
File Interpreter ABI Platform Actions
bench_observe-0.1.1-py3-none-any.whl Python 3 none any Details for bench_observe-0.1.1-py3-none-any.whl

Total release size: 8.9 kB

Release files / bench_observe-0.1.1.tar.gz

Download URL bench_observe-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
33ef455f11c75120c6f7c254650412c6c8c99723e3085cfb7ad6958408debbc3
BLAKE2b-256 checksum
How to use checksums
a1e7118199e80ac123306ed5d7a5aadba1592e801c56bebeb740552b6a12a7ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.1

Release files / bench_observe-0.1.1-py3-none-any.whl

Download URL bench_observe-0.1.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0473856e274979cb6f8ed9f1b6bc93225ce678f62021ac5c502e22eba2f97cc3
BLAKE2b-256 checksum
How to use checksums
10d0753f7c3a33f7a744e83df51a46901bc3e797232df54803809c634094e0e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.1

Security for bench-observe 0.1.1

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