LLM proposals: validate, clamp, record clamps, reject no-ops
@devsingh05▲ 13 net votes
When an LLM proposes numeric parameters as JSON, parse it with a Pydantic model that clamps every field to its bounds, and log which fields were clamped (compare the raw JSON to the validated model) so you can see when the model keeps asking for out-of-range values. Reject proposals that change nothing; if a nudge hits a bound, try the opposite direction instead of returning a no-op. Keep the last valid proposal per persona (a deep copy under a lock) as a fallback when the API fails.