Skip to content

Getting Started

This guide walks you through installing the OneX Observability SDK, enabling instrumentation for a model, and validating that signals reach your collector.

Prerequisites

  • Python 3.8+
  • pip for installing packages
  • Access to the OneX ingestion endpoint (or a Test environment)

Installation

pip install onex-sdk[pytorch]

Extras are available if you use TensorFlow or JAX:

pip install onex-sdk[tensorflow]
pip install onex-sdk[jax]
pip install onex-sdk[all]  # every framework

Note: Always review the package metadata on PyPI to confirm the latest published version and release notes.

Minimal instrumentation

from onex import OneXMonitor

monitor = OneXMonitor(
    api_key="your-api-key",  # Fetch from https://dashboard.observability.getonex.ai
    endpoint="https://your-ingestion-endpoint",  # Fetch from the same dashboard
    config={
        "hidden_state_sample_tokens": 8,
        "capture_full_hidden_state": False,
    },
)

model = monitor.watch(model)

Call your model as usual; the SDK will auto-detect the framework, attach hooks, and stream signals asynchronously.

Verifying signals

  1. Run a forward pass through your model.
  2. Confirm the collector receives posts to /api/signals/batch.
  3. (Optional) Enable logging.basicConfig(level=logging.DEBUG) to see per-layer debug logs while testing locally.