2 ms·
I implemented a similar pattern in my LLM tool and Python library back in February: https://simonwillison.net/2025/Feb/28/llm-schemas/ https://simonwillison.net
by simonw 1y ago
I implemented a similar pattern in my LLM tool and Python library back in February: https://simonwillison.net/2025/Feb/28/llm-schemas/ https://simonwillison.net/2025/Feb/28/llm-schemas/
My version works with Pydantic models or JSON schema in Python code, or with JSON schema or a weird DSL I invented on the command-line:
curl https://news.ycombinator.com/ | \
llm --schema-multi 'headline,url,votes int' \
-m gpt-4.1 --system 'all links'
Result: https://gist.github.com/simonw/f8143836cae0f058f059e1b8fc2d989c#response https://gist.github.com/simonw/f8143836cae0f058f059e1b8fc2d9...