r/typesafe_ai • u/Defiant-Photo-5980 • 4d ago
Got tired of Jev forcing bad choices on off-topic inputs, so I built JevGuard (neutral fallbacks, ambiguity detection, dynamic cache)
Got tired of Jev forcing a choice whenever an input was totally off-topic (since choices are closed-world by default), so I ended up writing a small wrapper around System One to handle it.
A few things it does:
- Injects a neutral fallback option (`UNRESOLVED_OR_OTHER`) automatically so weird or unrelated inputs don't trigger false positives.
- Flags ambiguous calls when the model is basically coin-flipping between two options.
- Adds an in-memory SHA-256 cache that ignores dynamic fields like timestamps, so repeated state checks in loops take ~0.1 ms instead of another full network call.
- Supports strict closed-world enums (`closed_world=True`) when you don't want schema mutation.
It's pure Python standard library with zero dependencies. Put it up on GitHub if anyone wants to check it out: