TraceML

1.3.0 · active · verified Fri Apr 17

TraceML is the client-side engine for ML/Data tracking, visualization, dashboards, and model UI, designed specifically for integration with the Polyaxon MLOps platform. It allows users to log metrics, parameters, artifacts, and manage experiment runs programmatically. The current version is 1.3.0, and it maintains a relatively frequent release cadence, often aligning with Polyaxon platform updates.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to initialize a TraceML run, log a metric, a parameter, and declare an artifact kind. By default, it runs in offline mode for local execution without a Polyaxon server. To track to a remote Polyaxon instance, ensure authentication is configured (e.g., via `POLYAXON_TOKEN` environment variable) and set `is_offline=False`.

import os
from traceml.tracking import run
from traceml.artifacts import V1ArtifactKind

# Ensure Polyaxon is configured. For remote tracking, POLYAXON_TOKEN env var must be set
# or ~/.polyaxon/config.yaml configured. For this quickstart to run standalone
# without a Polyaxon server, 'is_offline=True' is used.

# Log a simple metric and declare a model artifact
with run.start(
    project="quickstart-traceml",
    name="my-first-experiment",
    tags=["python", "demo"],
    is_offline=True  # Set to False to track to a Polyaxon server
) as r:
    print(f"Started run with UUID: {r.uuid}")
    r.log_metric("accuracy", 0.925)
    r.log_param("learning_rate", 0.001)
    # Log an artifact type. The actual model file would be uploaded later.
    r.log_outputs(model=V1ArtifactKind.MODEL)
    print("Logged metric, param, and model artifact kind.")
print("Run finished.")

view raw JSON →