Skip to content

Conversation

ochafik
Copy link
Collaborator

@ochafik ochafik commented Oct 17, 2025

Fixes #16622

z.number().int() changed in zod v4 & now adds a maximum constraint of Number.MAX_SAFE_INTEGER, which overflows llama.cpp's json schema -> grammar conversion logic. int64_t saves the day!

A separate issue is with large max values probably about to become more commonplace with that change in zod, we'll need to optimize the grammar generated. Will send separately.

@ochafik ochafik requested a review from ggerganov as a code owner October 17, 2025 00:45
@github-actions github-actions bot added the testing Everything test related label Oct 17, 2025
@ochafik ochafik changed the title fix: use int64_t to avoid int overflows in int schema to grammar conversio… fix: use int64_t to avoid overflows in int schema to grammar conversion Oct 17, 2025
@ggerganov ggerganov merged commit 79967ec into ggml-org:master Oct 17, 2025
67 of 70 checks passed
@ochafik ochafik deleted the fix-int64-overflow branch October 17, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eval bug: integer params issue when using zod4

2 participants