A practical comparison of three approaches to getting structured data from LLMs: prompt-only JSON, API-level JSON mode and function calling, and grammar-constrained decoding with Outlines, Guidance, and vLLM.
Structured output from LLMs: JSON mode, function calling, and grammar-constrained decoding