Skip to main content

metrik-core

The vocabulary every other Metrik package agrees on: the artifact envelope, canonical serialization, and content addressing.

This package defines vocabulary, not behaviour (plan.md §4). It has no ML dependencies — no torch, no transformers — which is enforced in CI by import-linter, not by convention. That constraint is what lets the artifact layer be installed and reasoned about without a multi-gigabyte ML stack.

Install it directly only if you are reading artifacts without running Metrik — pip install metrik-ai gets you this plus the CLI.

What is here

Module Purpose
metrik.core.artifacts The envelope every artifact carries
metrik.core.hashing Canonical JSON, Digest, content_hash, derivation_hash
metrik.core.store The content-addressed artifact and blob store
metrik.core.lineage The lineage DAG, and the walker that recovers an input closure
metrik.core.runs The run registry — including runs that failed
metrik.core.ir ModelGraph, the shared representation producers write
metrik.core.profile ProfileRecord and the capability gate
metrik.core.bench BenchResult and the sandbox attestation it requires
metrik.core.analysis ModelFingerprint, GraphSummary, MemoryEstimate
metrik.core.viz VizSpec — a declarative render, no renderer
metrik.core.plugins Entry-point discovery that never imports plugin code
metrik.core.errors The error taxonomy plugins raise from

The two hashes

The subtlest part of the design, and getting it wrong makes both caching and reproducibility silently unreliable. There are two questions, so there are two hashes:

Question Answered by
Is this the same result as that? content_hash — over the payload only
Have I already computed this, so can I skip the work? derivation_hash — over how it was asked for

A single hash cannot do both. Caching needs a key computable before running, so it must cover inputs and parameters rather than results. Dedup and citation need a key covering only the value, so two runs producing identical numbers are recognised as identical even if asked for differently.

Because both are recorded, the store can check a producer's determinism claim rather than believe it: same derivation_hash, different content_hash, and a declared class of deterministic means the declaration is false.

Specification

The full contract is docs/planning/artifacts.md. This package implements §2 (envelope), §3 (hashing and canonicalization), and §4 (blobs).

Canonicalization rules are normative and tested as properties, not examples — see tests/test_canonical_properties.py.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metrik_core-0.3.0.tar.gz (90.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metrik_core-0.3.0-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file metrik_core-0.3.0.tar.gz.

File metadata

  • Download URL: metrik_core-0.3.0.tar.gz
  • Upload date:
  • Size: 90.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for metrik_core-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e1fc75d2552342bae02eb0ebe7df1b1e403b2f6f598fb2777d24c502150e6a0a
MD5 48aeb5a25cf04c5bb71822c923b659a4
BLAKE2b-256 e7fbfa64bdc011c21bd1285d365b173ca08e0708442792aad72d9aea84b5f725

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_core-0.3.0.tar.gz:

Publisher: release.yml on Asmodeus14/Metrik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metrik_core-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: metrik_core-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 72.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for metrik_core-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1662c3b9e2c4f487426c785fb01ec2eba228c51ba51983d0b5352ab25c3f0dd8
MD5 1726c6d82ee7f37cacd194ca1f40a5d8
BLAKE2b-256 822963e65f8019df15827cd7c927065de2f064ee15289ec1c72755d855267cd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_core-0.3.0-py3-none-any.whl:

Publisher: release.yml on Asmodeus14/Metrik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page