Metria
Test inference changes before you ship them.
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.6
metria --version
Metria 0.1.6 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 FP8 KV cache (CUDA, SM89+) | FP8 KV-cache verification |
| vLLM local serving concurrency | Serving measurements |
Each profile has specific runtime, model, device, and evidence requirements. 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
- Copyable verification examples
- Recipe CLI
- Capability inspection
- Saved-record comparison
- Fidelity methods and migration
- Verifier pilot checklist
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.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| metria-0.1.6.tar.gz | 403.1 kB | With provenance | Details for metria-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| metria-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for metria-0.1.6-py3-none-any.whl |
Total release size: 845.6 kB
Release files / metria-0.1.6.tar.gz
| Download URL | metria-0.1.6.tar.gz |
|---|---|
| Size | 403.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d18db817a93f1d5ecc696d578ff92ad5ba25a27a4693442a06b2513a3e9ab10b
|
|
BLAKE2b-256 checksum How to use checksums |
f9816b0c318aab59b39b2028bd60e5423653e4455787b02865e3027ebad57b8b
|
| 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 13, 2026.
Transparency logRelease files / metria-0.1.6-py3-none-any.whl
| Download URL | metria-0.1.6-py3-none-any.whl |
|---|---|
| Size | 442.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52bfa111988897af00c05f605d342a78d6448b47481d0a3830cb2a4160b93bc0
|
|
BLAKE2b-256 checksum How to use checksums |
93aff3963a184215643f0d69fa4af6216c29509a153bc593cc70c311b0210fca
|
| 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 13, 2026.
Transparency logSecurity for metria 0.1.6
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.
Attestation for metria-0.1.6.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 13, 2026.
Transparency logA 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.