I've added schema support to my LLM Python library and a CLI tool: you can now provide a JSON schema - or a new concise schema DSL - and supported models will return data matching that format https://simonwillison.net/2025/Feb/28/llm-schemas/
Comments
Log in with your Bluesky account to leave a comment
@simon ha! Right when I wanted my team to use the Adaptive Cards JSON schema in the response_format of Azure OpenAI I see your post explaining the concept 😄
@simon My experiments with Gemini showed that the content of the output was affected by using the JSON API. I even saw a difference between using the API and appending the desired schema to the prompt. Have you encountered this?
I'm doing a lot of work with structured outputs professionally, and being able to just try things out in the cli for quick prototyping and testing will be extremely useful.
This was definitely one feature I felt LLM was missing.
Comments
Thanks a lot for making my job easier. 😉
If ever we get to meet IRL, I owe you a meal. 😊
LLMs are weird!
I'm doing a lot of work with structured outputs professionally, and being able to just try things out in the cli for quick prototyping and testing will be extremely useful.
This was definitely one feature I felt LLM was missing.
Thank you for such a great and […]