Skip to main content

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

Project description

🔭 InferTrace

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

Python Version License PyPI Version CI

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

pip install infertrace

With optional provider integrations:

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)

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)

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

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:

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

# 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
GitHub: https://github.com/suryanandanbabbar/infertrace

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infertrace-0.1.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infertrace-0.1.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file infertrace-0.1.0.tar.gz.

File metadata

  • Download URL: infertrace-0.1.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.4

File hashes

Hashes for infertrace-0.1.0.tar.gz
Algorithm Hash digest
SHA256 55935262f4ca01835e487801bccff01d33920c44a7687f78de82750a8fd8e29e
MD5 b23649ec9eca86e890d9fd1945466819
BLAKE2b-256 2d5f8594dc7621f5a0c7af0a04f8edbd021395558c800460f4597b3d01f5c18a

See more details on using hashes here.

File details

Details for the file infertrace-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: infertrace-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.4

File hashes

Hashes for infertrace-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af8c768ce8f5922f140f1c6b86b4f4caa8dc7171f7ab78bbdae46a842a877a7f
MD5 d2a8e4abe6a69ec1b1cb352a532fd7b0
BLAKE2b-256 778926556edf3a401ff6d64885bc003eb76a90feb893eb095d6ae8a6297a24ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page