5 comments

[ 3.9 ms ] story [ 26.6 ms ] thread
I wrote this library this weekend after realizing that Zod was really not designed for the use-cases I want JSON schemas for: 1) defining response formats for LLMs and 2) as a single source of truth for data structures.
Had you considered using something like XML as the transport format rather than JSON? If the UX is similar to zod it wouldn't matter what the underlying data format is, and XML is meant to support schemas unlike JSON.
While llms accept json schemas for constrained decoding, they might not respect all of the constraints.
> It checks a fixed sample of items (roughly 1%) regardless of size

> This provides O(1) performance

Wouldn’t 1% of N still imply O(N) performance?

> For large arrays (>97 items) and large dictionaries

How did we end up in a world where 97 items is considered large?