Repository navigation
feat(llm): prepare generation requests for each model candidate - #264
Merged
Merged
Conversation
skhaz
approved these changes
Nov 13, 2026
skhaz
approved these changes
Nov 13, 2026
This was referenced Nov 13, 2026
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.
Generation clients can shape messages and output reservations for the actual model attempted by the existing fallback chain. The optional
prepare_requestcallback runs per candidate before output planning and context admission, and stays local to the call.Without the callback, request construction and fallback behavior stay unchanged. Native errors retain their identity and classification. Direct provider calls supply no resolved card. This provides the dependency needed for model-specific OCR request profiles in kicksideai/providers#108; the consumer integration follows the framework release.
Validation uses runtime v0.3.59a: the new tests fail before the change, all seven new cases pass, the directly affected LLM and request-golden tests pass (268 tests total), and LLM lint reports no issues. Tests cover concrete and class fallback, candidate token limits, context admission, direct calls, invalid callback results, and native error preservation.