For application developers
Start with a task and an ONNX-compatible model. Produce JavaScript that preprocesses input, runs inference and returns structured results.
Give your coding assistant the original Hugging Face guide for choosing, loading, using and releasing Transformers.js models.
“I love this library. It works beautifully.”
One q8 English sentiment result from the executed Node CPU fixture. A class score is not measured accuracy.
Start with a task and an ONNX-compatible model. Produce JavaScript that preprocesses input, runs inference and returns structured results.
Make model revision, precision, cache placement, progress and cleanup deliberate parts of the integration.
A target runtime, the intended task, representative data, hardware constraints and a model whose license permits your use.
An assistant-built integration, model and dtype choices, loading/cache behavior, structured output handling and disposal.
Original instructions and seven reference guides covering pipeline options, configuration, caching, model registry, architectures, examples and generation.
The package contains guidance. The npm library, ONNX runtime, model weights and validation app are separate dependencies.
Codex executed one pinned English sentiment model with Transformers.js 4.3.2 and ONNX Runtime Node 1.30.0 on macOS arm64. All 23 checks passed, then passed again after extracting the final ZIP and installing fresh dependencies.
Verified: normal and boundary inputs, batch order, normalized scores, bounded long text, pipeline reuse, exact q8 weight checksum, cache reload with fetch/sockets denied and disposal. This is behavioral validation, not a model-quality or speed benchmark.
Adding local text-model inference to a JavaScript application, planning model downloads or making resource cleanup explicit.
Browser/WASM/WebGPU, Bun/Deno, React/Express templates, embeddings, generation, image and audio tasks are described upstream but were not exercised.
Use an Agent Skills compatible coding assistant and install the Skill as transformers-js. The tested setup needs Node.js, npm and Transformers.js 4.3.2; initial model acquisition needs network access. Public reads used no Hugging Face API key. Assistant model access and optional services may carry separate costs.
The test model has 68,293,700 bytes of unique model/tokenizer/config artifacts; the exercised cache stored 68,294,435 bytes across five files, including a duplicate config entry. Models are not included in the Skill ZIP. Cached inference was tested with network calls denied.
The ONNX conversion card links to the Apache-2.0 DistilBERT SST-2 base model but does not separately declare a license. Model use and redistribution require checking that licensing chain independently of the Skill license. No weights are redistributed here.