Skip to content

fix: validate general and tokenizer metadata types - #75

Merged
thxCode merged 1 commit into
gpustack:mainfrom
jpatel2005:fix/metadata-key-types
Nov 19, 2026
Merged

thxCode merged 1 commit into
gpustack:mainfrom
jpatel2005:fix/metadata-key-types

Conversation

@jpatel2005

Copy link
Copy Markdown
Contributor

A GGUF file with incorrectly typed metadata can parse successfully but later panic in Metadata(), Architecture() or Tokenizer(). For example, general.architecture stored as a uint32 causes a panic when read as a string.

Following #49 and #59, this change:

  • Validates the types of general and tokenizer keys used by these readers during parsing, returning an error instead of a later panic.
  • Skips incorrectly typed informational metadata in Metadata() instead of panicking. This also applies to general.quantization_version, which the reader reports but does not use to load tensors.
  • Adds regression tests covering string, array and numeric type mismatches, plus tolerated fields.

The tests check that rejected files produce errors identifying the offending key and that tolerated fields can be read without panicking.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 06:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@gpustack-code-review

gpustack-code-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

Signed-off-by: Jai Patel <mitjaipp@gmail.com>
@jpatel2005
jpatel2005 force-pushed the fix/metadata-key-types branch from 7855643 to d607d8e Compare November 16, 2026 18:16

@thxCode thxCode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thxCode
thxCode merged commit 20ba194 into gpustack:main Nov 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants