locc - LLM Output Contract Check
Structured output contract testing for LLM systems. Define what your LLM must output. locc tells you when it drifts.
Install
pip install locc
Quickstart
locc run \
--contract examples/contract.json \
--snapshot examples/snapshot.json \
--output json
What it checks
- Schema conformance: required fields, types, enum values
- Snapshot diff: what changed between runs
- Contract violations: hard constraints your LLM must satisfy
Output
Sample JSON artifact:
{
"status": "FAIL",
"checks": [
{
"name": "schema_conformance",
"result": "FAIL",
"reason": "Missing required field: category"
}
],
"diff": {
"category": {
"expected": "billing",
"actual": null
}
}
}
Exit codes
| Code | Meaning |
|---|---|
| 0 | PASS |
| 1 | HOLD |
| 2 | FAIL |
GitHub Actions
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install locc
- run: |
locc run \
--contract contracts/current.json \
--snapshot snapshots/current.json \
--output json > locc_result.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: locc-result
path: locc_result.json
Stack integration
locc is part of the LLM Reliability Stack. locc output feeds Release Governor for staging-time promotion gating.
| Stage | Component |
|---|---|
| Design-time | PFA |
| CI | locc |
| Staging | Release Governor |
| Runtime | EGA |
License
MIT
Metadata
Release files for llm-locc 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_locc-1.1.0.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_locc-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.4 kB
Release files / llm_locc-1.1.0.tar.gz
| Download URL | llm_locc-1.1.0.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5aa4febdece1cd275fac34fb9cc0f529f6c521c7b2b74b9237669be124a9a164
|
|
BLAKE2b-256 checksum How to use checksums |
2d2306f4cca5f1f60c161683b62a8c21b2c6315187f6ca865b02fce2ee0b0438
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 7, 2026.
Transparency logRelease files / llm_locc-1.1.0-py3-none-any.whl
| Download URL | llm_locc-1.1.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80c20e5444db2e7cb10f196ea13153725b336eb2679be10fe5e84c4a3e65e6a1
|
|
BLAKE2b-256 checksum How to use checksums |
e4febe9d2d27ad6ba8207a495caf6fc997e6088ae7ae56bb1873632ce972950e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 7, 2026.
Transparency log