Skip to main content

AIObserve

Lightweight, provider-neutral AI cost tracking and observability for Python.

AIObserve is an early-stage open-source SDK for recording model usage, estimating costs from explicitly configured pricing, and tracking request latency and errors. The core has no mandatory third-party dependencies and supports in-memory or SQLite storage.

Alpha notice: APIs and integrations may change. AIObserve does not currently fetch live pricing automatically. Unknown model prices are reported as unknown rather than guessed.

Install

pip install aiobserve

For the optional OpenAI integration:

pip install "aiobserve[openai]"

Quick start: manual tracking

from aiobserve import configure, record, get_observer
from aiobserve.pricing import ModelPricing, PricingCatalog

pricing = PricingCatalog()
pricing.register(ModelPricing(
    provider="openai",
    model="your-model-name",
    input_per_million=1.00,   # Replace with current provider pricing.
    output_per_million=4.00,  # Replace with current provider pricing.
))

configure(project="support-agent", environment="production", pricing=pricing)
record(
    provider="openai",
    model="your-model-name",
    input_tokens=1000,
    output_tokens=500,
    latency_ms=820,
)
print(get_observer().summary())

Prices above are illustrative only. Confirm the current rates with your provider and configure the correct currency and token categories before using cost reports for billing decisions.

OpenAI Responses API instrumentation

from openai import OpenAI
from aiobserve import configure, get_observer
from aiobserve.integrations.openai import instrument

configure(project="my-app", environment="development")
client = instrument(OpenAI())
response = client.responses.create(
    model="your-supported-model",
    input="Explain observability in one sentence.",
)
print(response.output_text)
print(get_observer().summary())

The adapter records response usage and elapsed time when the provider response exposes them. The provider response is returned unchanged. Telemetry errors are swallowed so monitoring does not replace the application's result. Streaming and full async-client support are not yet guaranteed.

Storage

In-memory storage is the default. To persist events locally:

from aiobserve import configure, get_observer
from aiobserve.storage import SQLiteStorage

configure(project="my-app", storage=SQLiteStorage("aiobserve.db"))

SQLite is intended for local development and small workloads. Call get_observer().storage.close() when shutting down if using SQLite.

Cost semantics

  • Costs are estimates based on the PricingCatalog supplied by your application.
  • Unknown prices are not treated as verified zero-cost events; summary output separates known and unknown cost events.
  • Cached input tokens can have a separately configured rate.
  • Currency conversion is not automatic. Do not sum costs across currencies as if they were the same currency.
  • Provider invoices remain the source of truth for actual billing.

Privacy

AIObserve does not automatically capture prompt or response content. Pass only metadata you are comfortable storing. Avoid putting secrets, raw personal information, or conversation content in metadata. capture_content and redact_pii are configuration placeholders in this alpha release and should not be interpreted as a complete PII-redaction implementation.

Development

python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
pytest -v
python -m build
python -m twine check dist/*

Roadmap

  • Provider-neutral event model and manual recording
  • Configurable pricing catalog
  • In-memory and SQLite storage
  • Function decorator for latency and error tracking
  • Initial OpenAI Responses API wrapper
  • Thorough async and streaming support
  • Anthropic and Gemini adapters
  • Trace aggregation and agent/tool spans
  • PII redaction and privacy controls
  • OTLP exporter and hosted dashboard

License

MIT

Metadata

Release files for aiobserve 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 aiobserve 0.1.1
File Size Uploaded Provenance
aiobserve-0.1.1.tar.gz 14.2 kB With provenance Details

Built distribution (wheel)

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

Total release size: 29.5 kB

Release files / aiobserve-0.1.1.tar.gz

Download URL aiobserve-0.1.1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dab95a14a58ad7325b6bb7fab087a46213c07f79f6e852685348f70bc170a332
BLAKE2b-256 checksum
How to use checksums
c70bb7107eaba9c8dbf34cc876a4d06cf025846698f382cfd7f78c0e19f46110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

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

Download URL aiobserve-0.1.1-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd150afda6a47017deda4e272d0f11593c1c68bfe19cbd663e5ad15e562f8a21
BLAKE2b-256 checksum
How to use checksums
0943387a2ec3abcbd24604a118e53f4fa4e902f15a0a5e223183eb3ae62fa6f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Security for aiobserve 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiobserve-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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