Skip to main content

OpenTelemetry-native run-level cost attribution for AI workflows

Project description

Botanu SDK for Python

CI PyPI version Python License

Event-level cost attribution for AI workflows, built on OpenTelemetry.

An event is one business transaction — resolving a support ticket, processing an order, generating a report. Each event may involve multiple runs (LLM calls, retries, sub-workflows) across multiple services. By correlating every run to a stable event_id, Botanu gives you per-event cost attribution and outcome tracking without sampling artifacts.

Getting Started

pip install botanu

One install. Includes OTel SDK, OTLP exporter, and auto-instrumentation for 50+ libraries.

from botanu import enable, botanu_workflow, emit_outcome

enable()  # reads config from environment variables

@botanu_workflow("my-workflow", event_id="evt-001", customer_id="cust-42")
async def do_work():
    result = await do_something()
    emit_outcome("success")
    return result

Entry points use @botanu_workflow. Every other service only needs enable(). All configuration is via environment variables — zero hardcoded values in code.

See the Quick Start guide for a full walkthrough.

Documentation

Topic Description
Installation Install and configure the SDK
Quick Start Get up and running in 5 minutes
Configuration Environment variables and options
Core Concepts Events, runs, context propagation, architecture
LLM Tracking Track model calls and token usage
Data Tracking Database, storage, and messaging
Outcomes Record business outcomes for ROI
Auto-Instrumentation Supported libraries and frameworks
Kubernetes Zero-code instrumentation at scale
API Reference Decorators, tracking API, configuration
Best Practices Recommended patterns

Requirements

  • Python 3.9+
  • OpenTelemetry Collector (recommended for production)

Contributing

We welcome contributions from the community. Please read our Contributing Guide before submitting a pull request.

This project requires DCO sign-off on all commits:

git commit -s -m "Your commit message"

Looking for a place to start? Check the good first issues.

Community

Governance

See GOVERNANCE.md for details on roles, decision-making, and the contributor ladder.

Current maintainers are listed in MAINTAINERS.md.

Security

To report a security vulnerability, please use GitHub Security Advisories or see SECURITY.md for full details. Do not file a public issue.

Code of Conduct

This project follows the LF Projects Code of Conduct. See CODE_OF_CONDUCT.md.

License

Apache License 2.0

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

botanu-0.1.dev60.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

botanu-0.1.dev60-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file botanu-0.1.dev60.tar.gz.

File metadata

  • Download URL: botanu-0.1.dev60.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for botanu-0.1.dev60.tar.gz
Algorithm Hash digest
SHA256 a6468d8495852631801903acf12b0feb958789a251f20b5c664ce88cdcc6470b
MD5 27edbfa65ee77b49e05772684bf9e419
BLAKE2b-256 3af13a496269bc67da11ddb9a5aa54aacc601fa2f271c6c93c888db9b3aae994

See more details on using hashes here.

Provenance

The following attestation bundles were made for botanu-0.1.dev60.tar.gz:

Publisher: release.yml on botanu-ai/botanu-sdk-python

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

File details

Details for the file botanu-0.1.dev60-py3-none-any.whl.

File metadata

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

File hashes

Hashes for botanu-0.1.dev60-py3-none-any.whl
Algorithm Hash digest
SHA256 27eab8b7a5ad7283c2a9de1b28f0228fc9f0d0bf26bb4143433c61cc199206c5
MD5 801c14d4c39e7a9305bcf7c12bde54c2
BLAKE2b-256 5eadf571d40ed43911b01e57bec9173bd5dea5c28c02f602bc35b2ae8ec6f1e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for botanu-0.1.dev60-py3-none-any.whl:

Publisher: release.yml on botanu-ai/botanu-sdk-python

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