OpenTelemetry-native run-level cost attribution for AI workflows
Project description
botanu SDK for Python
botanu is platform that helps AI companies understand the real cost of their AI features per customer, enabling outcome-based pricing and smarter scaling. This SDK is built on OpenTelemetry for event-level cost attribution for AI workflow. For more email- deborah@botanu.ai
Getting Started
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.
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
- GitHub Discussions — questions, ideas, show & tell
- GitHub Issues — bug reports and feature requests
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file botanu-0.1.dev68.tar.gz.
File metadata
- Download URL: botanu-0.1.dev68.tar.gz
- Upload date:
- Size: 47.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cbbb213b892c1562fb5333caf755f93137ca7a872b46662e978af717f4f57b5
|
|
| MD5 |
642b8dd39dacff7053e80e4f762e2479
|
|
| BLAKE2b-256 |
142350f5d7f14be14bd1608959d2a496260b3b18a3e646d59a68e0f6e6c8755a
|
Provenance
The following attestation bundles were made for botanu-0.1.dev68.tar.gz:
Publisher:
release.yml on botanu-ai/botanu-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
botanu-0.1.dev68.tar.gz -
Subject digest:
3cbbb213b892c1562fb5333caf755f93137ca7a872b46662e978af717f4f57b5 - Sigstore transparency entry: 1340687944
- Sigstore integration time:
-
Permalink:
botanu-ai/botanu-sdk-python@a338422485d7352a0077297405ded61e871ed3ee -
Branch / Tag:
refs/heads/main - Owner: https://github.com/botanu-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a338422485d7352a0077297405ded61e871ed3ee -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file botanu-0.1.dev68-py3-none-any.whl.
File metadata
- Download URL: botanu-0.1.dev68-py3-none-any.whl
- Upload date:
- Size: 56.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f75859999dc3ee0f2a2bdd5dbb54b81090261d5034a6d5b3c44f0670365a1e3
|
|
| MD5 |
6fca839e7353b3aa67f1d58b485a4e34
|
|
| BLAKE2b-256 |
95bbe615b0b1746a48afc904cfb571094f89c68a28a4f55438cc696fe4d48c5b
|
Provenance
The following attestation bundles were made for botanu-0.1.dev68-py3-none-any.whl:
Publisher:
release.yml on botanu-ai/botanu-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
botanu-0.1.dev68-py3-none-any.whl -
Subject digest:
2f75859999dc3ee0f2a2bdd5dbb54b81090261d5034a6d5b3c44f0670365a1e3 - Sigstore transparency entry: 1340687950
- Sigstore integration time:
-
Permalink:
botanu-ai/botanu-sdk-python@a338422485d7352a0077297405ded61e871ed3ee -
Branch / Tag:
refs/heads/main - Owner: https://github.com/botanu-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a338422485d7352a0077297405ded61e871ed3ee -
Trigger Event:
workflow_dispatch
-
Statement type: