Observed since 21 Oct, 11:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Lightweight, provider-neutral AI cost tracking and observability for Python.
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.
pip install aiobserve
For the optional OpenAI integration:
pip install "aiobserve[openai]"
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.
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.
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.
PricingCatalog supplied by your application.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.
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
pytest -v
python -m build
python -m twine check dist/*
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 9 Oct 2026 | 7 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:d1ac4ebf803ac7c87302b4eb60263159f86aba8e947c9a26f2e38322a74c82d8