> 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?
N is increasing. O(1) means constant (actually capped). We never check more than 100 items.
Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
21–30 of 31 posts
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#22How did we end up in a world where 97 items is considered large?
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#23I 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.
Will you support Standard Schema (https://standardschema.dev)? How does this compare to typebox (https://github.com/sinclairzx81/typebox)?
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#24Had 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.
JSON Schema is a schema built on JSON and it’s already being used. Using XML would mean converting the XML into JSON schema to define the response from the LLM. That said, JSON is “language neutral” but also super convenient for JavaScript developers and typically more convenient for most people than XML.
Why would we need to concert XML, which already supports schemas and is well understood by LLMs, back to JSON schema?
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#25Earlier quoted context omitted.
JSON Schema is a schema built on JSON and it’s already being used. Using XML would mean converting the XML into JSON schema to define the response from the LLM. That said, JSON is “language neutral” but also super convenient for JavaScript developers and typically more convenient for most people than XML.
Maybe I missed a detail here, sorry if that's the case! Why would we need to concert XML, which already supports schemas and is well understood by LLMs, back to JSON schema?
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#26> For large arrays (>97 items) and large dictionaries How did we end up in a world where 97 items is considered large?
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#27> For large arrays (>97 items) and large dictionaries How did we end up in a world where 97 items is considered large?
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#28Earlier quoted context omitted.
Maybe I missed a detail here, sorry if that's the case! Why would we need to concert XML, which already supports schemas and is well understood by LLMs, back to JSON schema?
Because most of the world uses JSON and has rich tooling for JSONSchemas, notable many LLM providers allow JSONSchemas to be part of the request when trying to get structured output
Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#29Re: Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library
#30Earlier quoted context omitted.
LLMs are not people. We want a format for LLMs or for people?
JSON schema is very human readable.