Skip to main content

Metria

Test inference changes before you ship them.

PyPI CI Metria core License: Apache-2.0


Metria verifies changes to LLM inference systems. Give it a reference and a candidate configuration to check what actually ran, measure behavioral change, and evaluate the result against your acceptance criteria. Keep both runs and a report you can review locally or in CI.

Installation

Use Python 3.10–3.14 in a virtual environment:

python -m pip install metria==0.1.3
metria --version

Metria 0.1.3 is an alpha release. The base package has no runtime dependencies; install native inference engines and models separately for real verification. See the release notes.

Try the Report

Run a complete synthetic example without a model or GPU:

metria demo --case pass --output demo-pass

Open demo-pass/report.md to see the decision, evidence checks, and behavioral diagnostics. Try --case fail or --case not-comparable with a new output directory to see a policy failure or an invalid comparison. These examples are labeled synthetic throughout; they do not establish runtime support, model quality, or performance.

Verify an Inference Change

Start with the installed workflow to prepare a qualified runtime, a pinned local model, and a workload. For a vLLM prefix-cache comparison, run from your prepared runtime environment:

metria recipe prepare-vllm \
  --model /path/to/local/model \
  --descriptor trusted-model-files.json \
  --workload prompts.jsonl \
  --policy policy.json \
  --output study.json

metria recipe validate study.json
metria verify study.json --output verification --json

The descriptor pins your model and tokenizer files; the policy defines your acceptance criteria. Preparation checks those inputs and the installed runtime before writing the recipe. It does not download models or install engines. Choose a new recipe filename and a new evidence directory for each comparison.

Metria checks requested → resolved → observed configuration: the setting you asked for, the artifacts and configuration selected to launch, and native evidence of what actually applied. Missing readback or an undeclared tokenizer or generation change prevents a successful comparison.

These profiles have retained native qualification within their documented scope:

Change Guide
llama.cpp CPU thread count Local configuration
llama.cpp CPU build Build regression
GGUF Q8_0 weight quantization Quantization
vLLM prefix caching Prefix-cache verification
vLLM CPU runtime version Runtime upgrade
vLLM local serving concurrency Serving measurements

Each profile has specific runtime, model, device, and evidence requirements. FP8 KV-cache precision remains staged pending supported GPU qualification. See runtime qualification before using a different configuration.

Read the Decision

A completed bundle contains the canonical result, a readable report, and both run records:

verification/
  verification.json
  report.md
  reference.run.json
  candidate.run.json

The report describes the intended change, checks execution evidence and comparison controls, then reports behavioral and compatible systems impact. It keeps execution status, comparison validity, and policy acceptance separate. manifest.json remains a compatibility alias for verification.json.

Outcome Meaning Exit
VERIFIED Execution and valid behavioral comparison completed; no acceptance policy was evaluated. 0
PASS / FAIL A valid comparison met / did not meet your explicit acceptance policy. 0 / 1
Invalid input The recipe or configuration could not be used. 2
NOT_COMPARABLE An undeclared or controlled difference prevents comparison. 3
INSUFFICIENT_EVIDENCE Required identity, runtime readback, or captures are missing or inconsistent. 4
EXECUTION_FAILED Execution, preflight, analysis, or persistence failed. 5
Interrupted Verification was interrupted. 130

VERIFIED establishes that comparison completed. For a keep/reject decision, add task checks and an acceptance policy. PASS applies to your stated criteria on the supplied workload; Metria supplies no universal behavior or safety threshold.

Behavioral diagnostics include token-prefix agreement, exact matches, and first-divergence positions. Systems measurements retain their method and limitations: cold-process llama.cpp latency, loaded-engine vLLM latency, or local serving measurements. Missing native measurements remain unavailable.

Use in CI

Provision the qualified runtime and model, then run the same verification command as a job step:

- name: Verify inference change
  run: metria verify .metria/change.json --output metria-verification --json

Preserve the exit status and retain the evidence directory even when verification fails. The copyable GitHub Actions workflow includes report summaries and artifact retention. See the CI guide for failure handling and machine-readable results.

Reference

Use --help to explore commands and options:

metria verify --help
metria recipe --help
metria inspect --help
metria fidelity --help

Developing

Use Python 3.11–3.14 and uv 0.11.8 or newer for the development workspace. From a fresh checkout:

uv sync --locked --all-packages
uv run pre-commit install
uv run --locked pre-commit run --all-files
uv run --locked python -m pytest

Useful source entry points:

Path Purpose
src/metria/ CLI, verification, and shared evidence contracts
src/metria/fidelity/ Integrated behavioral methods and assets
components/kv-fidelity/ Method documentation, characterization tests, and source compatibility bridge
components/turboquant-reference/ Portable research reference implementation
docs/ Current guides and architecture
tools/ Qualification, diagnostics, and maintenance utilities
artifacts/ Retained qualification and experiment evidence

Runtime dependencies stay optional. Install only the backend stack you need; native backend extras require Python 3.11 or newer to use patched dependencies. The dependency-free core retains Python 3.10 support, tested with a separate locked compatibility environment. See Contributing for platform setup, coverage gates, and distribution checks.

Contributing

Focus contributions on one inference change or evidence failure. Open a design issue before changing public contracts, methodology, dependencies, or release policy. See Contributing, Governance, and Support.

When citing an experimental result, use CITATION.cff and the specific retained report. Historical evidence keeps its original scope and known gaps under the provenance policy.

License

Original software is released under Apache-2.0. See NOTICE for attribution. Third-party and model-derived material retains its separately documented rights.

Metadata

Release files for metria 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metria 0.1.3
File Size Uploaded Provenance Actions
metria-0.1.3.tar.gz 380.6 kB With provenance Details for metria-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metria 0.1.3
File Interpreter ABI Platform Actions
metria-0.1.3-py3-none-any.whl Python 3 none any Details for metria-0.1.3-py3-none-any.whl

Total release size: 807.8 kB

Release files / metria-0.1.3.tar.gz

Download URL metria-0.1.3.tar.gz
Size 380.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d0487f5dc8e002c6cae72f3fb16200699a82e13374b10684acd97b771426a480
BLAKE2b-256 checksum
How to use checksums
dd63bec8b1bfa12794dd6d2b9b498e7f8c218080419b7b13682095b41eb4d6eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / metria-0.1.3-py3-none-any.whl

Download URL metria-0.1.3-py3-none-any.whl
Size 427.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
215b111b39f5ecbd37f10dab9eba468a1144b61e25d21e31d68d4299cd002605
BLAKE2b-256 checksum
How to use checksums
0095b2e86311070662ae9b2e1a0206a25d4a1a55fffb49933021fba2b4e88551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for metria 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for metria-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page