4 comments

  • podperson 3 hours ago
    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.
    • 7thpower 3 hours ago
      What led you to that conclusion?
      • dsabanin 2 hours ago
        Zod's validation errors are awful, the json schema it generates for LLM is ugly and and often confusing, the types structures Zod creates are often unintelligible in the and there's even no good way to pretty print a schema when you're debugging. Things are even worse if you're stuck with zod/v3
        • sesm 1 hour ago
          What's wrong with Zod validation errors?
        • light_hue_1 56 minutes ago
          None of this makes a lot of sense. Validation errors are largely irrelevant for LLMs and they can understand them just fine. The type structure looks good for LLMs. You can definitely pretty print a schema at runtime.

          This all seems pretty uninformed.

      • nerdponx 3 hours ago
        And what makes this different? What makes it LLM-native?
        • podperson 1 hour ago
          It generates schemas that are strict by default while Zod requires you to set everything manually.

          This is actually discussed in the linked article (READ ME file).

          • halayli 1 hour ago
            That's not true based on zod docs. https://zod.dev/api?id=objects

            most of the claims you're making against zod is inaccurate. the readme feels like false claims by ai.

      • podperson 1 hour ago
        1. Zoe’s documentation, such as it is 2. Code examples
  • bbminner 1 hour ago
    While llms accept json schemas for constrained decoding, they might not respect all of the constraints.
  • yunohn 26 minutes ago
    > 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?

  • _heimdall 2 hours ago
    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.
    • podperson 1 hour ago
      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.

      • yeasku 58 minutes ago
        LLMs are not people.

        We want a format for LLMs or for people?

        • hombre_fatal 50 minutes ago
          They aren’t people but their interface is more person than machine parser.

          Also I don’t think XML is better for machines. JSON is more strict. XML has weird whitespace to make it easier for humans and it has too many ways to represent the same things like an array or k/v pairs.

          I often find myself converting XML, TOML, and other formats to JSON just for strict clarity on what is being represented.

        • podperson 34 minutes ago
          JSON schema is very human readable.