# umarise-mlflow

Anchor every MLflow artifact at inception. One hash. Independent proof. Bitcoin-anchored.

## What it does

Every model, dataset, and artifact you log in MLflow gets a cryptographic fingerprint
anchored in Bitcoin via OpenTimestamps. Not after the fact. At the moment of creation.

The origin_id is logged back into your MLflow run. Verifiable by anyone.
Without trusting Umarise. Without an account. Forever.

## Install

pip install umarise-mlflow

## Usage

### Auto-anchor everything in a run

import mlflow
from umarise_mlflow import auto_anchor

with mlflow.start_run():
    with auto_anchor(api_key="um_..."):
        mlflow.log_artifact("model.pkl")
        mlflow.log_artifact("dataset.parquet")

Every artifact logged inside the context is automatically anchored.
The origin_id appears as a parameter in your MLflow run.

### Anchor a single artifact

from umarise_mlflow import anchor_artifact

result = anchor_artifact("model.pkl", api_key="um_...")
print(result["origin_id"])

### Anchor all artifacts in an existing run

from umarise_mlflow import anchor_run_artifacts

results = anchor_run_artifacts(run_id="abc123", api_key="um_...")

## What gets anchored

The SHA-256 hash of the file. Nothing else. The file never leaves your system.
Umarise receives only the fingerprint.

## What you get back

{
    "origin_id": "fb025c0e-...",
    "hash": "sha256:a1b2c3...",
    "captured_at": "2026-03-30T09:00:00Z",
    "proof_status": "pending"
}

proof_status moves from pending to anchored after Bitcoin confirmation.
Typically within 1-2 hours.

## Verify independently

Every anchor is verifiable without Umarise:

curl https://core.umarise.com/v1-core-proof?origin_id=fb025c0e-...

The returned .ots file verifies against Bitcoin directly using the
OpenTimestamps CLI. No account. No permission. No Umarise dependency.

## Why this exists

MLflow logs everything. Every log lives next to the thing it describes.
The timestamp comes from the same clock as the run. The audit trail is
written by the audited.

When a regulator, auditor, or counterparty asks "prove this model existed
before the incident" — MLflow alone cannot answer that.

umarise-mlflow gives MLflow the one thing it cannot give itself:
independently verifiable origin proof, anchored at inception.

## Get an API key

umarise.com/developers

## License

MIT
