Skip to content

botanu-ai/botanu-sdk-python

botanu SDK for Python

License

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

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