Transformers.js v4.3: Structured Output in the browser

From the creator

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! Chapters 0:00 Transformers.js 4.3 is out 0:26 New documentation pipeline 1:00 Community contributions 1:19 The problem: unreliable JSON from LLMs 2:18 How constrained decoding works 3:25 Adding the structured output processor 3:37 The new packages folder and plugin approach 6:03 Using regex instead of JSON Schema 6:45 Demo: recipe generator 7:33 Behind the feature: llguidance 9:02 Rewriting it in pure JavaScript 9:22 Performance across Gemma 4, Granite and LFM 2.5 10:26 Try it out Links Release notes: https://github.com/huggingface/transformers.js/releases/tag/4.3.0 NPM: https://www.npmjs.com/package/@huggingface/transformers/v/4.3.0 Structured output package: https://www.npmjs.com/package/@huggingface/transformers-structured-output

Choose to Build with AI
Matched to Developers

AI Maker Residence at KOKO

The third AI workshop taught by our legendary teacher, Nick Sarafa. In one of the last events we did an asset manager raised an additional £25M on their fund within a space of 9 months. This is a full-day hands-on training workshop for purposeful co-creation with AI using Claude Code. Imagine having access to hundreds of billions of dollars of computing power and knowing exactly how to make it work for you through the power of super intelligence. One person did.

◆ Fri 09 Oct 2026 ◆ KOKO Cafe, London ◆ With Nick Sarafa
AI Maker Residence at KOKO
Live event
AI Maker Residence at KOKO
Fri 09 Oct 2026

More like this

Running one yourself?

List your AI event,
wherever it is.

A meetup, a workshop, a hackathon, a conference. Any city, or online. Tell us about it and it lands in front of people already learning this stuff.