docs(google/gemma-4-31b-it): document compact JSON workaround - #679
Open
Mujae wants to merge 1 commit into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the metadata date for the Gemma 4 31B model and adds documentation under the "Structured Outputs" section to address a whitespace loop issue by configuring vLLM with xgrammar. The reviewer suggested presenting only the --structured-outputs-config flag instead of a standalone vllm serve command to prevent out-of-memory errors, as the model typically requires tensor parallelism parameters to run.
Signed-off-by: Mujae <phs514525@nate.com>
Mujae
force-pushed
the
docs/gemma4-compact-json
branch
from
July 24, 2026 09:55
5664cff to
440e917
Compare
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.
Summary
document the grammar-valid whitespace-loop symptom for Gemma 4 31B JSON Schema output
add the existing compact-xgrammar mitigation to the canonical model recipe
clarify that the setting removes optional whitespace between JSON tokens, not whitespace inside string values
Related to vllm-project/vllm#40080.
Why
The current Gemma 4 31B recipe mentions structured outputs but does not document a known failure mode where the model produces a valid JSON prefix and then emits optional whitespace until
max_tokens.I revalidated the behavior with the same request body across both server configurations:
Server structured-output configuration | Runs | Result -- | -- | -- default (backend=auto, whitespace allowed) | 3/3 | finish_reason=length, 8,000 completion tokens, invalid/incomplete JSON, 93.6555% whitespace backend=xgrammar, disable_any_whitespace=true | 3/3 | finish_reason=stop, 368 completion tokens, valid JSON Schema outputModel:
google/gemma-4-31B-itRevision:
842da3794eaa0b77d5f08bae87a17459d91ff475vLLM:
0.25.1Transformers:
5.13.1xgrammar:
0.2.3CUDA / GPU: CUDA 13.0 / NVIDIA B200
Precision: BF16, TP=1
The prompt, JSON Schema, request body, sampling parameters, model snapshot, and runtime were held constant. The mitigation is documented conditionally rather than changing the recipe's default server arguments.
Validation
YAML parses successfully with
js-yamlMarkdown fences in the rendered
guideare balancedgit diff --checkpassesthe repository API validator was also attempted; current
mainfails first on an unrelated pre-existingmodels/zai-org/GLM-5.2.yamlfeature-mode validation error