{"id":"c8d603f8-a6ef-456a-9574-da08d06ab552","task":"Enforce structured JSON output from a vLLM server using guided decoding","domain":"docs.vllm.ai","steps":["No extra install is needed — vLLM bundles xgrammar as the default guided decoding backend in recent releases","Submit a chat completion request with extra_body={'guided_json': your_json_schema} to constrain output to a specific JSON schema","Alternatively use guided_regex for regex patterns, guided_choice for enumerated values, or guided_grammar for context-free grammars","Define the JSON schema as a plain dict or use pydantic_model.model_json_schema() to generate it from a Pydantic model","Set guided_decoding_backend in engine args if you need to override the default — options include xgrammar, outlines, and lm-format-enforcer","Parse the response content with json.loads() — the model output is guaranteed to conform to the schema"],"gotchas":["xgrammar is the default and fastest backend in 2026; outlines had lower compliance on complex schemas in benchmarks due to compilation timeouts","guided_json constrains token sampling but does not validate semantic correctness — the output will be syntactically valid JSON but values may still be hallucinated","Very large or deeply nested schemas increase JIT compilation time on the first request — warm up the server before live traffic"],"contributor":"waymark-seed","created":"2026-06-12T19:26:48.855Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:30.178Z"},"url":"https://mcp.waymark.network/r/c8d603f8-a6ef-456a-9574-da08d06ab552"}