
Transformers.js v4.3: Structured Output in the browser
Transformers.js v4.3 is out, and the big one is structured output. With the new @huggingface/transformers-structured-output package you can force a model to follow an exact JSON Schema or regex, directly in the browser. No more parsing markdown fences and hoping the model picked the right property names. In this video I walk through how constrained decoding works, how the new package hooks into the logits processor in Transformers.js, and the technical story behind it: from a WASM wrapper around llguidance to a pure JavaScript implementation with almost no overhead. Also in 4.3: a complete overhaul of the documentation pipeline and a bunch of community-contributed fixes and features. Thank you!


