$ the-wire · showcase
Transformers.js adds structured output and docs overhaul
By RepoJournal · Filed · About Hugging Face
Transformers.js shipped a dependency-free structured-output constraint and rebuilt its documentation pipeline, while Tau fixed Anthropic usage accounting and exposed resolved install paths.
Transformers.js landed two closely related capabilities for constrained decoding [1][2]. A new dependency-free package, `@huggingface/transformers-response-constraint`, supports JSON Schema, JSON object, and regex constrained generation by hooking into token sampling, and a commit creates the `@huggingface/transformers-structured-output` package that wraps it. A parallel PR overhauls the docs: it replaces jsdoc-to-markdown with a custom parser, fixes broken links, upgrades the build, and adds agents.md and skills [3]. Separately, a bug fix ensures RawAudio.toBlob() is correct for TypedArray views with non-zero byteOffset or length; previously the WAV data-chunk size came from `chunk.length` while the payload was built from `chunk.buffer`, producing leading silence or only the first N samples [4]. Also, browser cache writes are now skipped for non-http(s) resources, fixing failures when a model is bundled inside a browser extension with a chrome-extension:// local model path [5]. "The browser Cache API only supports http(s) request keys, so the put always fails." [5]
Tau fixed two correctness issues across providers. Anthropic streaming usage now respects the provider's contract: since Anthropic's input_tokens already excludes cache reads/writes, Tau preserves it as fresh input and reports total input as the sum of fresh, cache-read, and cache-write tokens [6]. Z.AI thinking serialization now preserves the logical thinking toggle when raw reasoning_effort is unsupported, serializes the documented thinking object, and only sends effort values for compatible models [7]. Extensions gained access to resolved paths: ExtensionContext now exposes TauPaths, so extensions no longer hardcode `~/.tau` and break when a host moves the home directory [8]. A new session-only `/sidebar` TUI command toggles the sidebar without changing configured placement [9], and docs code blocks got a one-click copy button [10].
Tooling and dependency churn round out the day. hf-mount bumped the actions group with 2 updates [11], and TRL grouped Dependabot GitHub Actions and pre-commit updates into a single PR so CI pins land together instead of as split PRs [12][13], while the actions group itself got 5 updates [14].
Action items
- → Test RawAudio.toBlob() output when passing subarrays (e.g. Float32Array.subarray) and upgrade to include the fix huggingface/transformers.js [immediate]
- → Review the new transformers-structured-output and response-constraint packages for use in constrained generation huggingface/transformers.js [plan]
- → If you run tau-subagents or other extensions hardcoding `~/.tau`, follow the ExtensionContext.paths addition and update your extension huggingface/tau [plan]
- → Check Anthropic token reporting after the usage-accounting alignment; totals now follow the provider contract huggingface/tau [monitor]
References
- [1] Add dependency-free response constraints ↗ huggingface/transformers.js
- [2] Create `@huggingface/transformers-structured-output` package (#1758) ↗ huggingface/transformers.js
- [3] Massive documentation overhaul ↗ huggingface/transformers.js
- [4] [Fix] RawAudio.toBlob() ignores TypedArray byteOffset/length (#1704) ↗ huggingface/transformers.js
- [5] Skip browser cache writes for non-http(s) resources ↗ huggingface/transformers.js
- [6] Align Anthropic usage accounting with provider contract ↗ huggingface/tau
- [7] Fix Z.AI thinking request serialization ↗ huggingface/tau
- [8] Add ExtensionContext.paths to expose resolved TauPaths ↗ huggingface/tau
- [9] Add session-only TUI sidebar toggle ↗ huggingface/tau
- [10] docs: add copy button to docs code blocks ↗ huggingface/tau
- [11] chore(deps): bump the actions group with 2 updates ↗ huggingface/hf-mount
- [12] Group Dependabot GitHub Actions and pre-commit updates in a single PR ↗ huggingface/trl
- [13] Group Dependabot GitHub Actions and pre-commit updates in a single PR (#7088) ↗ huggingface/trl
- [14] Bump the actions group with 5 updates ↗ huggingface/trl