SDK guide / 01

Take one evaluation from code to inspectable evidence.

This path establishes the complete minimum loop: identify a project and system version, record an evaluation, preserve artifacts, and inspect the result.

The path

Five steps, one evidence chain.

  1. 01
    Install

    Add the Python SDK and CLI to the environment that already runs your evaluation.

  2. 02
    Identify

    Create a project and register the system version whose behavior you are measuring.

  3. 03
    Instrument

    Wrap the existing environment loop in a RunContext and record each interaction.

  4. 04
    Preserve

    Attach metrics and artifacts that make the behavior interpretable and reproducible.

  5. 05
    Inspect

    Review the completed run locally, through the CLI, or in Reliability Studio.

Step 01

Install and establish identity.

The SDK reads ISO_OBS_API_KEY from the environment. The CLI can store the same key in a mode-600 configuration file. Creating a project writes iso-obs.toml in the working directory.

terminalShell
pip install iso-obs
pip install iso-obs-cli

# Generate an actionable local report immediately
python -m iso_obs.quickstart

# Store an API key for the CLI
iso auth login --api-key <YOUR_KEY>
iso auth whoami

# Create a project and local iso-obs.toml
iso project init --name "robot-arm"
FIRST REPORT / UNDER TWO MINUTES

python -m iso_obs.quickstart writes a versioned failure-boundary-report.json with an explicit disposition, three-way boundary cells, limitations, and a content digest. It uses demonstration evidence so you can inspect the full artifact before connecting a robot, simulator, or Studio account.

Steps 02–04

Record the loop without moving the system.

Your policy, simulator, and environment remain where they are. The context records ordered observations, actions, state, rewards, and metrics. Every event emitted for one interaction shares a deterministic step index.

evaluation.pyPython
from iso_obs import ReliabilityClient

client = ReliabilityClient()  # ISO_OBS_API_KEY

with client.run(
    project="robot-arm",
    system_version="policy-v17",
    environment="warehouse-v4",
    scenario="obstructed-pick",
    seed=42,
) as run:
    observation = env.reset(seed=run.seed)
    while True:
        action = policy(observation)
        next_observation, reward, terminated, truncated, info = env.step(action)
        run.step(
            observation=observation,
            action=action,
            reward=reward,
            state=info.get("state"),
            metrics={"tracking_error": info["tracking_error"]},
        )
        observation = next_observation
        if terminated or truncated:
            break
    run.log_artifact("replay.mp4")
FAILURE SEMANTICS

A clean context exit flushes buffered events and completes the run. If the body raises, the run is marked failed, the exception is recorded as its reason, and the original exception is re-raised.

Step 05

Inspect the run and retain its provenance.

Registering a system version binds human-readable versioning to an artifact URI and optional source commit. Run inspection then exposes the captured context and metrics without asking the evaluation code to recreate them.

terminalCLI
# Register a version when you need explicit model provenance
iso system register \
  --project prj_1234567890abcdef12345678 \
  --name "robot-arm-policy" \
  --version "17.0.0" \
  --artifact-uri s3://models/policy-v17.pt

# Inspect the completed run and its metrics
iso run inspect run_1234567890abcdef12345678

Operational behavior

Telemetry remains recoverable when delivery fails.

Requests retry up to three times on rate limits, server failures, and transport errors. A failed flush keeps its buffer for the next attempt. If the final close still cannot deliver, pending events are appended to .iso-obs/pending-events.jsonl.

DO NOT DISCARD

Offline persistence is a recovery artifact, not a second run. Keep the original run identity and resend the buffered evidence rather than generating replacement events.

Relevant API

The classes you use first.

Relevant SDK classes and functions
Class or functionImport fromUse it to
ReliabilityClientiso_obsAuthenticate and access projects, systems, and runs.
RunContextiso_obsOwn run lifecycle, buffering, failure handling, and artifact logging.
ProjectsResourceiso_obs.clientCreate and list Studio projects.
SystemsResourceiso_obs.clientRegister versioned system artifacts and provenance.
RunsResourceiso_obs.clientCreate, stream, complete, fail, and retrieve runs.