This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.
LLMs have gotten pretty good at generating structured data recently, but unlike with text you can't use the results in real-time, since the returned JSON isn't valid until the end of the response. To solve this, I built a fast JSON syntax validator of sorts, which keeps track of the current context (are we inside a string, object, key, etc.) and can revert back to the latest valid state or…

LLMs have gotten pretty good at generating structured data recently, but unlike with text you can't use the results in real-time, since the returned JSON isn't valid until the end of the response.
To solve this, I built a fast JSON syntax validator of sorts, which keeps track of the current context (are we inside a string, object, key, etc.) and can revert back to the latest valid state or complete the JSON to make it parseable.
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.