Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
46 points by podperson
by kevmo314
2 subcomments
> For large arrays (>97 items) and large dictionaries
How did we end up in a world where 97 items is considered large?
by podperson
2 subcomments
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.
by bbminner
0 subcomment
While llms accept json schemas for constrained decoding, they might not respect all of the constraints.
by yunohn
1 subcomments
> 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?
by _heimdall
1 subcomments
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.