Metadata-Version: 2.4
Name: infertrace
Version: 0.1.0
Summary: Developer-first ML & LLM observability SDK. OpenTelemetry for Machine Learning.
Project-URL: Homepage, https://github.com/suryanandanbabbar/infertrace
Project-URL: Documentation, https://github.com/suryanandanbabbar/infertrace/tree/main/docs
Project-URL: Repository, https://github.com/suryanandanbabbar/infertrace
Project-URL: Issues, https://github.com/suryanandanbabbar/infertrace/issues
Author-email: Suryanandan Babbar <suryanandanbabbar@gmail.com>
License: MIT
Keywords: infertrace,langchain,llm,machine-learning,mlops,monitoring,observability,openai,telemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Monitoring
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: click>=8.0
Requires-Dist: jinja2>=3.0
Requires-Dist: plotly>=5.0
Requires-Dist: pydantic>=2.0
Requires-Dist: rich>=13.0
Requires-Dist: streamlit-option-menu>=0.3.0
Requires-Dist: streamlit>=1.30
Provides-Extra: all
Requires-Dist: anthropic>=0.20; extra == 'all'
Requires-Dist: datadriftguard>=0.1; extra == 'all'
Requires-Dist: duckdb>=0.9; extra == 'all'
Requires-Dist: google-genai>=1.0; extra == 'all'
Requires-Dist: langchain>=0.1; extra == 'all'
Requires-Dist: litellm>=1.0; extra == 'all'
Requires-Dist: ollama>=0.1; extra == 'all'
Requires-Dist: openai>=1.0; extra == 'all'
Requires-Dist: tiktoken>=0.5.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.20; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: httpx>=0.25; extra == 'dev'
Requires-Dist: mypy>=1.5; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Provides-Extra: drift
Requires-Dist: datadriftguard>=0.1; extra == 'drift'
Provides-Extra: duckdb
Requires-Dist: duckdb>=0.9; extra == 'duckdb'
Provides-Extra: gemini
Requires-Dist: google-genai>=1.0; extra == 'gemini'
Provides-Extra: langchain
Requires-Dist: langchain>=0.1; extra == 'langchain'
Provides-Extra: litellm
Requires-Dist: litellm>=1.0; extra == 'litellm'
Provides-Extra: ollama
Requires-Dist: ollama>=0.1; extra == 'ollama'
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == 'openai'
Requires-Dist: tiktoken>=0.5.0; extra == 'openai'
Provides-Extra: reports
Requires-Dist: pyarrow>=14; extra == 'reports'
Requires-Dist: weasyprint>=60; extra == 'reports'
Description-Content-Type: text/markdown

# 🔭 InferTrace

**Developer-first ML & LLM observability SDK. OpenTelemetry for Machine Learning.**

![Python Version](https://img.shields.io/badge/python-3.9+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![PyPI Version](https://img.shields.io/badge/pypi-v0.1.0-blue.svg)
![CI](https://img.shields.io/badge/build-passing-brightgreen.svg)

## Why InferTrace?

The modern AI stack is complex enough. Existing observability tools often require deploying heavy infrastructure, managing Docker containers, setting up Kubernetes clusters, or paying exorbitant SaaS fees. 

**InferTrace is different.** We believe ML observability should be as simple as a pip install. 
It works immediately, locally, and effortlessly. No containers to spin up, no infrastructure to manage—just actionable insights in seconds.

## Quick Install

```bash
pip install infertrace
```

**With optional provider integrations:**
```bash
pip install "infertrace[openai]"     # OpenAI integration
pip install "infertrace[anthropic]"  # Anthropic integration
pip install "infertrace[ollama]"     # Ollama integration
```

## 5-Minute Quick Start

### 1. Manual Tracking (3 lines)

```python
from infertrace import Monitor

# Initialize monitor
monitor = Monitor()

# Track any ML operation
monitor.track_request(
    model="custom-model-v1",
    prompt="Hello",
    response="World",
    latency_ms=150
)
```

### 2. Auto-Instrumentation (3 lines)

```python
from infertrace import Monitor
import openai

# Initialize monitor and patch OpenAI client
monitor = Monitor()
monitor.instrument_openai()

# All OpenAI calls are now automatically tracked!
client = openai.Client()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Tell me a joke."}]
)
```

### 3. Function Decorator

```python
from infertrace import Monitor

monitor = Monitor()

@monitor.track(model="text-classifier")
def classify_text(text: str) -> str:
    # Your ML code here
    return "positive"
```

### 4. Launch Dashboard

Visualize your data instantly with the built-in local dashboard:
```bash
infertrace dashboard
```

## Key Features

* **🔭 Auto-Instrumentation**: Drop-in monitoring for major LLM SDKs with zero code changes to your application logic.
* **📡 Provider-Agnostic**: A unified event model that standardizes metrics across OpenAI, Anthropic, local models, and custom APIs.
* **📊 Beautiful Dashboard**: A sleek, local-first web UI to visualize requests, latencies, tokens, and drift in real-time.
* **⚡ Zero Config**: SQLite storage backend by default means it works out of the box. No database setup required.
* **🔌 Plugin System**: Easily extensible architecture to write custom provider adapters or storage backends.
* **📈 Analytics & Metrics**: Track cost, latency, token usage, and error rates effortlessly.
* **📋 Reports**: Generate sharable markdown or HTML reports of your system's health.
* **🛠️ CLI**: Powerful command-line interface to manage data, generate reports, and launch the dashboard.
* **🎯 DataDriftGuard Integration**: Ready to integrate with advanced drift detection algorithms out of the box.
* **🔒 Local-First**: Your data never leaves your machine unless you explicitly configure a remote backend. Privacy by design.

## CLI Commands

```bash
# Initialize configuration
infertrace init

# Launch local Streamlit dashboard
infertrace dashboard --port 8501

# Run DataDriftGuard data drift analysis
infertrace drift --baseline baseline.csv --incoming incoming.csv --save

# Generate telemetry reports
infertrace report --format html

# Export telemetry data
infertrace export --format csv

# System health & dependency check
infertrace doctor
```

## Author

**Suryanandan Babbar**  
Email: [suryanandanbabbar@gmail.com](mailto:suryanandanbabbar@gmail.com)  
GitHub: [https://github.com/suryanandanbabbar/infertrace](https://github.com/suryanandanbabbar/infertrace)

## License

This project is licensed under the MIT License.
