Skip to main content

Decision-level observability for ML/LLM pipelines

Project description

X-Ray Logger

Decision-level observability for ML/LLM pipelines.

X-Ray captures why decisions were made—candidates considered, filters applied, scores computed, and reasoning behind each step—not just what functions ran.

Quick Start

1. Start the Server

docker run -d -p 8000:8000 \
  -e XRAY_DATABASE_URL=sqlite+aiosqlite:///./xray.db \
  ghcr.io/mohit-nagaraj/xray-logger:latest

2. Install the SDK

pip install xray-logger

3. Instrument Your Code

from xray_logger import init_xray, step, attach_reasoning

client = init_xray(base_url="http://localhost:8000")

@step(step_type="filter")
def filter_items(items, threshold=0.5):
    result = [i for i in items if i["score"] >= threshold]
    attach_reasoning({"threshold": threshold, "removed": len(items) - len(result)})
    return result

with client.start_run("my-pipeline"):
    filtered = filter_items(items)

Features

  • Decision Transparency - Capture candidates, scores, and reasoning at each step
  • Lightweight SDK - Simple decorators, fail-open design
  • FastAPI Middleware - Automatic HTTP request instrumentation
  • Query API - Filter runs by pipeline, user, status

Documentation

Step Types

Type Use Case
filter Removing candidates by criteria
rank Ordering candidates by score
llm LLM/AI model calls
retrieval Fetching external data
transform Data transformations

Self-Hosting with Docker Compose

git clone https://github.com/mohit-nagaraj/xray-logger.git
cd xray-logger
cp .env.example .env
docker-compose up -d

License

MIT

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

xray_logger-0.1.0.tar.gz (104.0 kB view details)

Uploaded Source

Built Distribution

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

xray_logger-0.1.0-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xray_logger-0.1.0.tar.gz
  • Upload date:
  • Size: 104.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for xray_logger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d32ef8dd2ab70e20dcdcd6a8b854373f901682ddf286a36ee274c9bdee4437e
MD5 634c2b3e215b4a56c537c52b55a6945c
BLAKE2b-256 ba089da5887650bdc6e077d034364e8443c9a7694236f4bed42a3006e83eeafa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xray_logger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for xray_logger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b626246b8b3ec3c3de73cf45bb4b4e5a3ceedbf389fe287ac10f4e230358bbaf
MD5 a435217bee96fd1650b86b99c01b0fea
BLAKE2b-256 f56c5929e9619f88e6d920bf6ad89a09be109e076e13152ac52f1a360146b9eb

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