Metadata-Version: 2.4
Name: ai-parrot-openlit-bridge
Version: 0.2.4
Summary: Minimal OTLP endpoint validation helper for OpenLIT — no monkey-patching SDK required (FEAT-462)
Author-email: Jesus Lara <jesuslara@phenobarbital.info>
License-Expression: MIT
Project-URL: Homepage, https://github.com/phenobarbital/ai-parrot
Project-URL: Repository, https://github.com/phenobarbital/ai-parrot
Keywords: ai,observability,opentelemetry,openlit,otlp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Framework :: AsyncIO
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9

# ai-parrot-openlit-bridge

Minimal OTLP endpoint validation helper for [AI-Parrot](https://pypi.org/project/ai-parrot/)'s OpenLIT integration (FEAT-462 — Unified Telemetry Bus).

AI-Parrot no longer depends on the `openlit` Python SDK (a monkey-patching
LLM SDK instrumentor whose pinned `openai` version range conflicted with
ai-parrot's own `openai` dependency). OpenLIT is now a pure deployment-time
OTLP endpoint — configure `ObservabilityConfig.otlp_targets` (multi-endpoint
OTLP export) or `OpenLitUsageRecorder` (usage-only spans) in `ai-parrot`
itself. This package provides two small, optional helpers on top of that:

1. `validate_endpoint(url)` — an async probe that checks whether an OTLP
   collector is reachable, with zero heavy dependencies (only `aiohttp`,
   already a workspace dependency).
2. `parrot-openlit-check` — a CLI wrapper around the same probe.
3. A bundled `docker-compose.openlit.yml` to run an OpenLIT collector +
   dashboard locally.

## Installation

```bash
pip install ai-parrot-openlit-bridge
# or, via the ai-parrot extra:
pip install "ai-parrot[observability-openlit]"
```

## Usage

### Python

```python
from ai_parrot_openlit_bridge import validate_endpoint

status = await validate_endpoint("http://localhost:4318")
if status.reachable:
    print(f"OTLP collector reachable (status={status.status_code})")
else:
    print(f"Unreachable: {status.error}")
```

### CLI

```bash
parrot-openlit-check http://localhost:4318
# ✅ Endpoint reachable: http://localhost:4318
#    Status: 200
```

Exit code is `0` when reachable, `1` otherwise — suitable for health-check
scripts / CI smoke tests.

### Local OpenLIT collector

```bash
docker compose -f docker-compose.openlit.yml up -d
parrot-openlit-check http://localhost:4318
```

Then point ai-parrot at it, e.g.:

```bash
export OBSERVABILITY_ENABLED=true
export OBSERVABILITY_BACKEND=otel
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
```
