xmllm – Structured LLM streaming output using lenient XML parsing
Hi HN. I made a little JS library for streaming structured data from LLMs using leniently-parsed XML as a medium. E.g. await simple('fun pet names', { schema: { name: Array(String) }, model: 'openrouter:mistralai/ministral-3b' }); // => ["Daisy", "Whiskers", "Rocky"] Demos: xmllm.j11y.io When using LLMs, I've ended up gravitating towards boring time-tested XML-esque tag-based delimiters instead of JSON/function-calling for the following reasons: - Diverse presence in training corpuses (consider flavours of content commonly adjacent to these syntaxes vs. JSON) - HTML was…
What it does
In the maker’s words, at launch
Hi HN. I made a little JS library for streaming structured data from LLMs using leniently-parsed XML as a medium. E.g. await simple('fun pet names', { schema: { name: Array(String) }, model: 'openrouter:mistralai/ministral-3b' }); // => ["Daisy", "Whiskers", "Rocky"] Demos: xmllm.j11y.io When using LLMs, I've ended up gravitating towards boring time-tested XML-esque tag-based delimiters instead of JSON/function-calling for the following reasons: - Diverse presence in training corpuses (consider flavours of content commonly adjacent to these syntaxes vs. JSON) - HTML was built for fallible humans to write; LLMs are equally fallible. Let them cook [html]! - IME better and more consistent adherance than very delicate JSON/YAML etc. - Lenient by nature (following Postel's law of being liberal in what you accept) - No provider lock-in to function-calling/'tool' APIs - Supports streaming with 'eventually-fulfilled schemas' for progressive UI updates - CSS-style selections when you need more flexibility than schemas It is provider/API/model-agnostic and has good schema-adherance across models from Qwen 2.5B and Ministral 3B all the way up to the frontier stuff like Claude and GPT-4o. It has in-built model preferencing and fallbacks (like asking it to prefer Claude but fall back to Mistral via e.g. openrouter/togetherai/whatever), plus 'inner' truncation to avoid context limitations. I originally built this for my own projects I've found it to be a stable abstraction and quick to prototype with on the client-side especially (with the proxy feature). I wanted to share it here mostly to gather feedback and hear what other people are doing to source structured schema-conforming data from LLMs? I know there's new work being done in constraining big param LLMs to fixed grammars, and that's probably the future, but I've no real context or knowledge about that and for the past few years I've just been trying to /get stuff done/ in a reliable and consistant way. Hence this project. Demos and sandbox-y things (try the top flag generator thing!) https://xmllm.j11y.io Repo: https://github.com/padolsey/xmllm Blog post (+background and other reflections): https://blog.j11y.io/2024-12-15_xmllm/ And please, if you've a moment: I'm vvv interested in what people are currently using to get reliable structured data from LLMs? Perhaps most are completely satisfied with Function-Calling APIs?
Does the same job
all alternatives →


- SESmelt – Extract structured data from PDFs and HTML using LLMMar 2026 · github.com · ▲6
I built a CLI tool in Go that extracts structured data (JSON, CSV, Parquet) from messy PDFs and HTML pages. The core idea: LLMs are great at understanding structure but wasteful for bulk data extraction. So smelt uses a two-pass architecture: 1. A fast Go capture layer parses the document and detects table-like regions 2. Those regions (not the whole document) get sent to Claude for schema inference — column names, types, nesting 3. The Go layer then does deterministic extraction using the inferred schema This means the LLM is never in the hot path of actual data processing. It figures out…
- LSlangdiff – Stream valid JSON from LLMs with type-safe callbacks2025 · github.com · ▲8
Ever had json.loads() explode halfway through an LLM stream? langdiff fixes that with a schema + callback approach. Define your schema → attach callbacks → push streaming tokens → get structured events immediately.
- CRChainFactory – Run Structured LLM Inference with Easy Parallelism2024 · github.com · ▲8
hi everyone. how does moving llm call prompts and output structure definitions away from code into configuration land sound? would you use something like this if it was stable and well documented enough? please don't hold back the criticism. i appreciate all feedback (constructive & otherwise).
More ai this month
the category →
I trained a 125M-parameter transformer to autocomplete piano performances in real time (~108 notes/sec on an iPhone 15). The idea is basically GitHub Copilot or Tabnine, except instead of prompting it with code, you prompt it by playing a few notes on a MIDI piano. The model then continues what you played, entirely on-device. The app is free if anyone wants to try it. Happy to answer questions about the model, training, Core ML, or the many things that didn't work.
AI · 17d ago · simedw.com
Astute▲585Automate your B2B brand going viral, with new media creators
AI · 18d ago · company-app.joinastute.com


Hey HN, Henry from Cactus here! We previously released Cactus Needle, a 14MB agentic LLM for tool call, device use, and structured extraction for phones, wearables, smart homes, small robots and microcontrollers. We got really great feedback here, and have now incorporated the suggestions to release Needle 2. The whole model is a single 14MB binary that runs a full session in 28MB of RAM; 45m parameters at 2bit compression. Needle hits 500 tokens/sec decode speed on a Raspberry Pi 5, sits between 400-1,500 tokens/sec on VR devices like Meta Quest 3S and Apple Vision Pro, and ranges…
AI · 26d ago · cactuscompute.com

