Harden GGUF role gating and fold projector size into the memory gate#338
Merged
Conversation
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
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.
Description
Thuki re-reads a GGUF's header at install and load so non-chat models can never become a Ready primary chat model, and folds a vision model's projector size into the pre-load memory gate so vision loads are sized accurately. This closes the gap where a renamed companion, an embedding model, or a mis-sized projector could slip past the browse-time filename heuristics.
Key changes
-m. Known non-chat families (embedding/encoder arches such asbert,t5, andclip, plus audio tokenizers) and projector/adapter roles are rejected with a clear "not a chat model" message. Missing architecture stays soft (filename heuristics) so an incomplete or list-time header never bricks an install.mmproj) size, taken from the on-disk blob length when present or the curated registry size otherwise, folds into the pre-load memory gate and the Library/Discover fit hint through one shared helper, so the gate and the fit estimate never size a projector differently.Testing
cargo test+cargo llvm-cov(100% line coverage),cargo clippy -D warnings, and the full frontend + backend build gate.Notes
DENIED_PRIMARY_ARCHESis a baked-in, pin-scoped denylist: an engine bump may need it extended when new non-chat families appear. It lives inconfig/defaults.rswith the other baked-in constants and is documented indocs/configurations.md.