A first KLM validation
Run the validator against valid and invalid records, and read the scope of a conformance result correctly.
You can begin exploring KLM without running a language model. Validating the repository's example records is a practical way to see what the contract requires and which inconsistencies it rejects.
This guide uses the public repository revision inspected on 9 October 2026. It validates records, not a model's entire behaviour.
1. Get the repository
With Python 3 and Git available:
git clone https://github.com/omasim/KLM.git
cd KLM
git checkout 459aa899c42d27afcbaf475546542b7d17d2cc29
The pinned revision reproduces this guide's checks. Follow the main branch separately for subsequent development. The repository's verification path uses Python's standard library.
2. Validate the worked example
python3 schema/validate_attestation.py --level 4 \
schema/examples/attestation-worked-example.json
For this example, the validator returned KLM-4 Attributable. The record has two claims, two evidence objects, one procedure and six relationships. It declares klm-attestation/0.1, illustrating how legacy records retain their original rules.
This does not mean every claim in the answer is true. The example includes an unsupported claim. The validator examines how that state and its evidence relationships are recorded.
3. Run a record that must fail
python3 schema/validate_attestation.py \
schema/examples/invalid/attestation-violations.json
A FAIL result and a nonzero exit code are expected here; they are the purpose of the example.
The detected violations include inconsistent source fields for parametric knowledge, an activated procedure whose trigger is false, a reference to a nonexistent output span and a confidence gap inconsistent with its components. Rejecting these records matters as much as accepting a valid one.
4. Try changing a support label
Keep the original and make a copy:
cp schema/examples/attestation-worked-example.json \
/tmp/klm-supported-without-evidence.json
In the copy, find the claim with support_status set to unsupported and change only that value to supported. Do not add an evidence relationship. Then run:
python3 schema/validate_attestation.py --level 2 \
/tmp/klm-supported-without-evidence.json
The label alone does not establish support. The validator reports a missing supports relationship and rejects the requested KLM-2 level.
Reading the result
What passes or fails is a record, under a specified schema and requested level. The result is not a whole-model conformance claim, an independent certificate or a guarantee of factual correctness.
For your own implementation, the next step is to produce real source and claim identities, preserve missing signals explicitly and inspect why the validator accepts or rejects the record.
The project introduction and unknown-versus-zero essay explain the framework behind these checks.
Sources and revision
This article is based on the public repository inspected on 9 October 2026. The links below are pinned to that revision; the project may subsequently change.
This connects to
Documents the KLM record validator using valid and invalid examples.