Skip to content

fix(vllm): send structured_outputs instead of removed guided_* keys - #1888

Merged
RobinPicard merged 3 commits into
dottxt-ai:mainfrom
pablopupo:fix/1887-vllm-structured-outputs
Jul 3, 2026
Merged

RobinPicard merged 3 commits into
dottxt-ai:mainfrom
pablopupo:fix/1887-vllm-structured-outputs

Conversation

@pablopupo

Copy link
Copy Markdown
Contributor

from_vllm still sends guided_json / guided_regex / guided_grammar in extra_body, but vLLM dropped those keys in v0.12 and silently ignores unknown fields, so on a 0.23 server the constraint just gets dropped and the output comes back unconstrained.

This swaps them for extra_body={"structured_outputs": {...}} with the json / regex / grammar keys (whitespace_pattern lives inside that dict now), which is what the offline path has done since #1779. Tests and the mock requests are updated to match, and pre-commit plus the vLLM tests pass locally.

The docs still point at the removed guided_decoding_backend as well, happy to fix that in a separate PR.

Fixes #1887

pablopupo and others added 2 commits July 3, 2026 11:30
vLLM removed the per-request guided_json/guided_regex/guided_grammar
extra_body keys in v0.12 and silently ignores unknown request fields,
so from_vllm against a vLLM 0.23 server dropped the constraint and
returned unconstrained output.

Emit extra_body={"structured_outputs": {...}} with the json/regex/
grammar keys (whitespace_pattern nested alongside) instead, mirroring
the offline path migrated in dottxt-ai#1779.

Fixes dottxt-ai#1887
@RobinPicard
RobinPicard force-pushed the fix/1887-vllm-structured-outputs branch from 49aa7b4 to b0470f3 Compare July 3, 2026 10:02

@RobinPicard RobinPicard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great, thanks for the PR! I just added a commit to include some documentation of server version compatibility

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

📚 Documentation preview: https://dottxt-ai.github.io/outlines/pr-preview/pr-1888/

Preview updates automatically with each commit.

@RobinPicard
RobinPicard merged commit b7e85d7 into dottxt-ai:main Jul 3, 2026
6 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.

from_vllm structured outputs broken against vLLM 0.23+ (still sends deprecated guided_json)

2 participants