Structured output
Constrain model output against a runtime-supplied JSON Schema.
Running on the dummy driver?
The dummy driver honors constraint masks, so these inferlets emit in-grammar / schema-valid output — but the content inside the structure (string field values, numbers) is uniform random. The structural assertions hold; semantic ones don't.
| Inferlet | What it shows |
|---|---|
json-schema-constrained-decoding | Compile a JSON Schema, feed grammar masks into PTIR, and decode valid JSON. |
Related guide
- Constrained generation: the
SchemaandConstrainAPI these inferlets use. - Generator:
collect_jsonand theconstrainbuilder method.