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.1.tar.gz (98.8 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.1-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xray_logger-0.1.1.tar.gz
  • Upload date:
  • Size: 98.8 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.1.tar.gz
Algorithm Hash digest
SHA256 6f091d64eda3f3acf1f00c131f68f44b8884f8e8f8bf299a1cdfc1d616dd6697
MD5 2d3b7ed7ba59bdc46b664e6441586c7c
BLAKE2b-256 3197f4cc6246082426460bdf5da9a1cf836ff57138ead443ef4702dc89cf2223

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xray_logger-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2487f58416411113d7b798fdcf27453aa043b52c8dd5bc0bb7e772094a0c4ce
MD5 38b6dd384e8d3e37163208c9d8557fde
BLAKE2b-256 25768119a37fa5a3fd6f2b09b3edca80c3dc2f628c2f23736080a07eff539e71

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