Validate structured decisions and fix provider compatibility - #1
Merged
Merged
Conversation
RodrigoAlbe
marked this pull request as ready for review
September 26, 2026 16:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Missing answers previously became negative decisions with full confidence, and pooled token logprobs could overwrite different batch answers with the same value. This change validates every answer locally and preserves the model's JSON decision. Invalid, refused, or truncated batches now fail explicitly.
Changes
raw_response, require a token position in extraction helpers, and identify confidence as model-reported. No inferred class distribution or calibrated-confidence claim.Retry-After, reuse the sync client within a retry cycle, and avoid sleeping after exhaustion.None. Replace hard-coded benchmark comparisons with JSON reports, dataset hashes, measured latency/tokens/failures, and optional labeled accuracy/Brier metrics.Validation
httpx==0.24.0.git diff --checkpassed.httpx.MockTransport; no live inference calls or paid benchmarks were executed.Compatibility and remaining work
Callers must handle explicit invalid-response errors and optional cost; logprobs no longer rewrite answers or confidence. Groq/Gemini diagnostic opt-in currently fails locally.
max_retriesretains its existing meaning of total attempts. Native schema support for custom models can be selected explicitly and must be verified against the endpoint.The bundled benchmark scenarios are still unlabeled smoke examples. This PR adds support for independently labeled datasets; it does not claim empirical calibration, real-provider performance, or introduce automatic confidence-based abstention. No package release or merge is included.