llm-diff
Output diffing and versioning primitives for LLM outputs — semantic diff, version store, and lineage tracking.
Compare two LLM responses, track how outputs evolve across prompt iterations, and build audit trails for prompt engineering workflows.
What's inside
- SemanticDiff — word-level and structural diff between two LLM outputs
- VersionStore — append-only output history keyed by prompt hash
- Lineage — parent/child relationships between prompt versions
- DiffReport — structured diff result: added, removed, changed sections with positions
Use cases
- Prompt regression testing — detect when a prompt change causes output drift
- A/B output comparison — structured diff between two model responses
- Audit trails — record all outputs for a given prompt over time
- Change detection — trigger alerts when output structure changes significantly
Quick start
use ;
let diff = compute;
println!;
let store = new;
store.record?;
store.record?;
let history = store.history?;
Add to your project
[]
= { = "https://github.com/Mattbusel/llm-diff" }
Test coverage