This release is a pre-release and may not be stable for production use.
VIPER
Run and verify reproducible ML experiments with machine-readable guardrails for agents.
VIPER freezes an experiment before execution. The frozen plan identifies the source commit, stage code, parameters, inputs, environment, and reproducibility controls. After execution, VIPER verifies the files and relationships that support the result.
Install
VIPER requires Python 3.11 or newer.
python -m pip install viper-provenance
The distribution installs the viper Python package and the viper command.
Create a project
viper init my-project --package my_project
cd my-project
python -m pip install -e ".[test]"
python -m pytest -q
The generated project contains one decorated function for each stage kind. The project owns those functions, its parameter classes, its metrics, and its artifact loaders.
Define a stage
from pathlib import Path
import viper
class TrainParameters(viper.parameters.Train):
epochs: int
learning_rate: float
@viper.train_stage(parameter_model=TrainParameters)
def train(context: viper.StageContext[TrainParameters]) -> None:
dataset: Path = context.inputs["dataset"]
weights_path: Path = context.artifacts["parameters"]
run_training(
dataset=dataset,
weights_path=weights_path,
epochs=context.params.epochs,
learning_rate=context.params.learning_rate,
)
Freezing identifies train, TrainParameters, and their source files by
repository-relative path, SHA-256 digest, and byte count. Execution constructs
the validated TrainParameters value and passes it through context.params.
The parameters artifact key is VIPER's required slot for trained model state;
weights_path is the destination used by the project code.
Run a frozen plan
Commit the project source before freezing the plan.
viper freeze-run path/to/draft.yaml --repository-root .
viper preflight path/to/run/spec.yaml --repository-root .
viper run path/to/run/spec.yaml --repository-root .
A project can start the same coordinator from its Python entrypoint:
if __name__ == "__main__":
viper.run(train)
python train.py \
--run path/to/run/spec.yaml \
--stage train \
--repository-root .
Both entrypoints execute inside the selected host. The same commands work in a local terminal and in a terminal connected to a provisioned VM.
Inspect the result
viper --json verify-run path/to/resolved.yaml \
--trust-source https://github.com/example/project
viper --json lineage path/to/resolved.yaml \
--trust-source https://github.com/example/project
viper --json compare-runs left.yaml right.yaml \
--trust-source https://github.com/example/project
verify-run starts from ResolvedRun, retrieves every hash-bound dependency,
checks the frozen plan, validates each attempt, and returns the accepted stage
and measurement summary. JSON mode emits one document with a stable operation
name and error code.
What VIPER verifies
For one terminal run, VIPER checks the following chain:
RunSpec
-> exact stage specifications
-> typed stage invocations
-> resolved inputs and artifacts
-> measurements and metric recomputation
-> canonical attempt files
-> ResolvedRun
Each file reference carries a path, byte count, and SHA-256 digest. Each stage invocation carries the selected implementation and a serializable binding for the values delivered to the callable. Runtime evidence describes the host, compute backend, Python environment, and applied reproducibility controls.
An evaluation measures one candidate. A benchmark applies one evaluation
definition across candidates and requires an independently executed
confirmation. viper execute-benchmark produces that confirmation and verifies
artifact parity plus the declared metric criteria.
Example
examples/synthetic
contains the project generated by
viper init, an authored download stage, and project tests. The release test
copies that project into a temporary Git repository and executes acquisition,
the five-stage candidate plan, benchmark confirmation, and terminal
verification.
python -m pytest tests/test_generated_project_acceptance.py -q -m release
Documentation
Development
VIPER uses the mantra Conda environment for repository checks.
conda activate mantra
make check
make check-integration
make check-release
The testing guide defines the cost tiers, domain markers, CI jobs, installed-wheel checks, and live CUDA gate.
License
VIPER is licensed under the Apache License 2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file viper_provenance-0.1.0a2.tar.gz.
File metadata
- Download URL: viper_provenance-0.1.0a2.tar.gz
- Upload date:
- Size: 261.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee1abf6c4af841409c469d1e263304adf98992577f8effdbb31d0bd550bcd5dd
|
|
| MD5 |
b40116986aec671fa71b2772996adf3b
|
|
| BLAKE2b-256 |
509d8e602ae9cacbbde9b617f8bbef8d29ec8e306171aceab2369f6a065c7257
|
Provenance
The following attestation bundles were made for viper_provenance-0.1.0a2.tar.gz:
Publisher:
release.yml on pvd232/viper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viper_provenance-0.1.0a2.tar.gz -
Subject digest:
ee1abf6c4af841409c469d1e263304adf98992577f8effdbb31d0bd550bcd5dd - Sigstore transparency entry: 2617638327
- Sigstore integration time:
-
Permalink:
pvd232/viper@c014662e257f735f809585e8e365c3254e0f6200 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/pvd232
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c014662e257f735f809585e8e365c3254e0f6200 -
Trigger Event:
push
-
Statement type:
File details
Details for the file viper_provenance-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: viper_provenance-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 149.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f867cfd0b9955d398c69395b435fab8e577d0dc89724f3dab6776d10566635ea
|
|
| MD5 |
b4da1ccf5b19c5a313b4c7f36e2bedab
|
|
| BLAKE2b-256 |
05d1f3e7f2eea45d7fb43705666a5513c54d810eed0b3efc5476c0b68f9eb299
|
Provenance
The following attestation bundles were made for viper_provenance-0.1.0a2-py3-none-any.whl:
Publisher:
release.yml on pvd232/viper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viper_provenance-0.1.0a2-py3-none-any.whl -
Subject digest:
f867cfd0b9955d398c69395b435fab8e577d0dc89724f3dab6776d10566635ea - Sigstore transparency entry: 2617638336
- Sigstore integration time:
-
Permalink:
pvd232/viper@c014662e257f735f809585e8e365c3254e0f6200 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/pvd232
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c014662e257f735f809585e8e365c3254e0f6200 -
Trigger Event:
push
-
Statement type: