Reusable, deterministic IPC (Interpretive Provenance Chain) hashing utilities for Pipe-Works projects.
compute_payload_hash(payload_dict)compute_system_prompt_hash(prompt_text)compute_output_hash(output_text)compute_ipc_id(input_hash, system_prompt_hash, model, temperature, max_tokens, seed)payload_hash(payload_model)convenience wrapper for objects exposingmodel_dump()
The first release preserves Axis Descriptor Lab semantics so IPC values are reproducible across projects.
This project targets Python 3.12+.
pyenv install -s 3.12.8
pyenv local 3.12.8
python -Vpip install -e .
pip install -e ".[dev]"
pip install -e ".[docs]"Use one of these approaches when pipeworks-ipc is not yet published to PyPI.
Local path (editable):
pip install -e /path/to/pipeworks_ipcGitHub tag:
pip install "pipeworks-ipc @ git+https://github.com/pipe-works/pipeworks_ipc.git@v0.1.1"GitHub commit SHA (strict reproducibility):
pip install "pipeworks-ipc @ git+https://github.com/pipe-works/pipeworks_ipc.git@<commit-sha>"For consumer pyproject.toml dependencies before PyPI publication:
[project]
dependencies = [
"pipeworks-ipc @ git+https://github.com/pipe-works/pipeworks_ipc.git@v0.1.1"
]Publish when all of these are true:
- at least one consumer project uses
pipeworks-ipcin production-like flow - IPC semantics are stable and deterministic tests are green
- CI/docs/release automation are consistently passing
- you want to stop relying on local paths and Git URL dependencies
Recommended progression:
- integrate in a consumer project and stabilize
- release to TestPyPI first
- release to PyPI
pre-commit install
pre-commit run --all-filespytest -vBuild locally:
make -C docs htmlOpen:
docs/build/html/index.htmlfrom pipeworks_ipc.hashing import (
compute_payload_hash,
compute_system_prompt_hash,
compute_output_hash,
compute_ipc_id,
)
payload = {"seed": 42, "world_id": "pipeworks", "policy_hash": "abc", "axes": {}}
input_hash = compute_payload_hash(payload)
prompt_hash = compute_system_prompt_hash("You are ornamental.")
output_hash = compute_output_hash("A weathered figure stands.")
ipc_id = compute_ipc_id(
input_hash=input_hash,
system_prompt_hash=prompt_hash,
model="gemma2:2b",
temperature=0.2,
max_tokens=120,
seed=42,
)