llama-stack
llama-stack copied to clipboard
Add support for Structured Output / Guided decoding
Added support for structured output in the API and added a reference implementation for meta-reference.
A few notes:
- Two formats are specified in the API: Json schema and EBNF based grammar
- Implementation only supports Json for now
- We use
lm-format-enhancerto provide the implementation right now but may change this especially because BNF grammars aren't supported by that library.
Fireworks has support for structured output and Together has limited supported for it too. Subsequent PRs will add these changes. We would like all our inference providers to provide structured output for llama models since it is an extremely important and highly sought-after need by the developers.