Skip to main content

X-Ray

X-Ray is a deterministic execution-analysis engine for multi-step LLM workflows.

X-Ray analyzes ordered output traces to decide whether a run forms one evolving execution trajectory, where structural contribution peaks, and how much token volume appears after that peak.

X-Ray is infrastructure, not an LLM judge.

Status: Beta (v0.1.0)

Why X-Ray Exists

Multi-step LLM systems often continue executing after meaningful contribution has already peaked.

Additional execution may:

  • repeat earlier work
  • increase token cost without adding signal
  • drift across tasks
  • create apparent progress without meaningful structural change

X-Ray analyzes the execution trajectory itself.

Install

Package install command:

pip install veloryn-xray

Editable local install:

pip install -e .

SDK

from veloryn.xray import analyze_structured, analyze_raw

Structured SDK Example

from veloryn.xray import analyze_structured

result = analyze_structured(
    {
        "steps": [
            {"output": "sort descending"},
            {"output": "use reverse=True"},
        ]
    }
)

print(result.to_dict())

Current runtime shape:

{
    "is_valid": True,
    "verdict": {
        "peak_step": 2,
        "should_stop_at": 2,
        "waste_percentage": 0,
    },
    "summary": {"reason": "Most value was captured early."},
    "meta": {"version": "0.1.0"},
    "timeline": [
        {"step": 1, "label": "improving"},
        {"step": 2, "label": "peak"},
    ],
    "analysis": {
        "signals": {
            "redundancy_trend": "stable",
            "contribution_trend": "stable",
        }
    }
}

X-Ray is:

  • deterministic
  • lexical
  • bounded
  • typed at the SDK boundary

X-Ray is not:

  • a semantic understanding system
  • an embeddings-based analyzer
  • a correctness evaluator
  • a workflow control system

Raw SDK Example

from veloryn.xray import analyze_raw

result = analyze_raw("sort descending\nuse reverse=True")
print(result.to_dict())

Raw mode parses newline-separated steps or JSON payloads and returns the same typed SDK result shape.

Fail-Safe SDK Example

from veloryn.xray import analyze_structured

result = analyze_structured(
    {
        "steps": [
            {"output": "capital of france"},
            {"output": "capital of germany"},
        ]
    }
)

print(result.to_dict())

Canonical fail-safe SDK output:

{
    "is_valid": False,
    "verdict": {"message": "No clear execution pattern detected."},
    "summary": {"reason": "This does not appear to be a single evolving task."},
    "meta": {"version": "0.1.0"},
}

Fail-safe omits:

  • timeline
  • analysis
  • internal signals

CLI

xray trace.json
xray trace.json --analysis
xray trace.json --debug

## Serialization Example

```python
import json

from veloryn.xray import analyze_structured

result = analyze_structured(
    {
        "steps": [
            {"output": "a"},
            {"output": "a"},
        ]
    }
)

payload = result.to_dict()
print(json.dumps(payload))

Input Shape

Structured SDK input must be:

{
    "steps": [
        {"output": "step 1 text"},
        {"output": "step 2 text"},
    ]
}

Rules:

  • top-level must be a dict
  • steps must exist
  • steps must be a list
  • each step must contain string output

Invalid schema raises ValueError.

Execution invalidity returns fail-safe.

Determinism

X-Ray uses no randomness, no embeddings, no semantic model, and no LLM calls.

For the same input and same algorithm versions, output is stable.

Peak selection uses a stabilized selector trajectory rather than raw normalized contributions directly. CLI and UI plots are aligned to the final selected peak.

Validation

Run Python tests:

python -m unittest discover -s tests

Build UI:

npm run build

Metadata

Release files for veloryn-xray 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veloryn-xray 0.1.0
File Size Uploaded
veloryn_xray-0.1.0.tar.gz 25.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for veloryn-xray 0.1.0
File Interpreter ABI Platform
veloryn_xray-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.5 kB

Release files / veloryn_xray-0.1.0.tar.gz

Download URL veloryn_xray-0.1.0.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d559059da78b76efa95b45dcc64b68bb8554d3963065dddf6b87a7bbe5fbac7c
BLAKE2b-256 checksum
How to use checksums
b3d9c25c4d10481215fcfd11fed46376f363baef8dbba64ddc5fd4308e1c5f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / veloryn_xray-0.1.0-py3-none-any.whl

Download URL veloryn_xray-0.1.0-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36d6fc9f440d9318af07e672b8af74e53fbfd5dff5b71fd83fa96b235c002353
BLAKE2b-256 checksum
How to use checksums
d5050094bebf020c1241784786279353c19e658b8a6cf9948a7e6a17d23e9a13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page