Skip to main content

OpenTelemetry-native run-level cost attribution for AI workflows

Project description

Botanu SDK for 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.dev61.tar.gz (35.9 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.dev61-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: botanu-0.1.dev61.tar.gz
  • Upload date:
  • Size: 35.9 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.dev61.tar.gz
Algorithm Hash digest
SHA256 eaf399771ed04d0556ee0dde29e0e8408dbb2022b26ff895df814b4d4c28fd2a
MD5 855095fc39edb74e11f8b4fd8975e313
BLAKE2b-256 2eedbc3dfd704431858159c311957a214f4703f65f698fb76659583e251b596e

See more details on using hashes here.

Provenance

The following attestation bundles were made for botanu-0.1.dev61.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.dev61-py3-none-any.whl.

File metadata

  • Download URL: botanu-0.1.dev61-py3-none-any.whl
  • Upload date:
  • Size: 42.4 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.dev61-py3-none-any.whl
Algorithm Hash digest
SHA256 a32d61d809286b40387925cbde4e59c7da19221d2bb59b02914196ce2c3c659c
MD5 2bb83a8cf44e33be0327f9e51a295914
BLAKE2b-256 53954b101c7896a3dec5ee4cbafbd0ca1e6dd5e0c05a9ccd9ef71879a7bc7fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for botanu-0.1.dev61-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