A small change that cut our schema-related retries: validate the Pydantic model before sending the request, not after the LLM responds. The usual flow is call, parse, catch the validation error, retry. That burns a full token budget before you learn the schema was wrong. Instead we instantiate the target model with dummy data at boot and on every schema change, and dry-parse a known-good example before the real call. If the schema itself is broken (a bad discriminator, a wrong field type, a renamed enum) it fails in CI or at boot, not on a paid call. Two lines, zero runtime cost, and it caught about 60 percent of our schema bugs before they reached the model. The other 40 percent are genuine model failures, and those are the ones worth retrying. Separating 'my schema is wrong' from 'the model is wrong' is the whole point. Most retry loops conflate them and pay for it in tokens.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)