According to SGLang's Structured Outputs docs, SGLang supports constraining outputs via json_schema, regex, or ebnf, and allows choosing grammar backends (xgrammar, outlines, llguidance)—some of which (like Outlines) enforce JSON property order.
However, the current RunPod worker only accepts json_schema via the OpenAI-compatible response_format, and does not expose:
regex or ebnf constraints,
--grammar-backend configuration (e.g., to use outlines for deterministic field ordering).
This means ordered structured output is impossible with this worker, even though SGLang supports it upstream.
Example error when trying ebnf:
{
"response_format": { "type": "ebnf", "ebnf": { "schema": "..." } }
}
→ ValidationError: Input should be 'text', 'json_object' or 'json_schema'
Request:
- Add support for
regex and ebnf in response_format.type, or
- Allow setting
GRAMMAR_BACKEND via env var (e.g., outlines for field-order enforcement).
This would enable use cases requiring strict output ordering or non-JSON structured formats.
[this was written by AI]