Transformers.js Inference Skill
Run Hugging Face models directly inside JavaScript applications.
The documentation discloses remote model downloads, caching, local models, and custom fetch/S3 cache data flows, and provides controls to disable remote loading and clear selected caches. However, remote loading is the normal path; examples read images from external URLs and show Bearer-token injection and cloud caching without user confirmation, credential-safety guidance, source restrictions, complete permission boundaries, or rollback procedures. Apache-2.0 and repository metadata support attribution, but the publisher is unverified, so points are deducted.
Installation, runtime, device, quantization, caching, progress, and error-handling examples are provided, and disposal is repeatedly required. There are no executable tests, CI coverage, or reproducible results; some defaults and API claims are internally tense, such as cache-path and version/API assumptions. Error handling relies mainly on message-string matching and gives limited coverage of malformed input, concurrency, initialization failure, and cleanup failure. The score is therefore limited to a modest static-review level.
The audience and scenarios are broad: browser, Node.js, Bun, Deno, React, Express, and text, vision, audio, and multimodal tasks, with a local/offline mode. Boundaries, input constraints, model-quality limitations, and non-fit cases are insufficiently explicit; Chinese-language guidance is limited; and the remote workflow depends on Hugging Face Hub/CDN reachability, with no mainland-China network assessment.
The material has good information architecture, tables of contents, cross-references, installation notes, parameter examples, troubleshooting, license, author, 4.x metadata, and revision-pinning advice. It lacks a changelog, explicit maintenance owner, update path, and compatibility matrix. The supplied main SKILL content is truncated at the task quick-reference table, and some referenced files or claims cannot be fully verified from the supplied material.
The skill directly supplies installation, pipeline usage, model selection, configuration, caching, and multi-runtime examples, so it plausibly completes core inference tasks. Static evidence does not verify execution, output correctness, performance, model compatibility, or download availability; users must still select models, resolve environment differences, and review model licenses. The score follows the static calibration ceiling.
The material includes a pinned repository revision, official documentation and GitHub links, concrete code, and named APIs, providing limited traceability. It includes no committed tests, CI results, locked dependency evidence, independent review, or execution logs; key capabilities remain documentation claims, so the score cannot exceed the static-review ceiling.
- Remote model downloads and caching are the default path; confirm model provenance, licensing, network requests, disk usage, and cache location before deployment.
- Do not copy the HF_TOKEN or S3 examples into production without secure credential injection, least-privilege access, and log redaction.
- The supplied main SKILL file is incomplete at the task quick-reference section, and no test or CI evidence is provided; validate the target Node.js/browser, device, and mainland-China network environment independently.
- Model outputs are probabilistic, while the material provides no quality benchmarks, privacy boundaries, or sensitive-data handling guidance.
What does this skill do, and when should you use it?
This skill guides agents in using Transformers.js to run pretrained machine-learning models in JavaScript and TypeScript without a Python server. It covers text, vision, audio, and multimodal tasks across browsers, Node.js, Bun, and Deno. Execution can use WASM on CPU or WebGPU when the runtime and hardware support it. The guidance also covers model selection, quantization, caching, progress reporting, batching, error handling, and resource disposal.
It explains how to install @huggingface/transformers and load Hugging Face Hub or local models through the pipeline API; run text classification, entity recognition, question answering, text generation, translation, summarization, image classification, object detection, segmentation, depth estimation, speech recognition, audio classification, text-to-speech, image captioning, document question answering, zero-shot detection, and feature extraction; configure WebGPU or WASM, precision, caching, remote or local model paths, and download progress; and handle batching, revision pinning, inference errors, and pipeline.dispose() cleanup.
- A frontend engineer needs browser-side sentiment analysis, translation, or summarization without deploying a Python backend.
- A Node.js, Bun, or Deno developer needs server-side inference for text, image, or audio workloads using Hugging Face models.
- An application team is building speech recognition, image detection, captioning, or other multimodal features in JavaScript.
- A team needs to balance model size and speed by comparing fp32, fp16, q8, and q4 with WASM or WebGPU execution.
- A developer needs controlled or offline-oriented deployment using local models, cache configuration, and pinned model revisions.
What are this skill's strengths and limitations?
- Runs models directly in JavaScript or TypeScript without a Python server.
- Covers NLP, computer vision, audio, and multimodal tasks.
- Supports browsers, Node.js, Bun, and Deno, with WASM and optional WebGPU execution.
- Documents quantization, caching, batching, progress callbacks, and local-model configuration.
- Models can range from a few megabytes to several gigabytes and may consume substantial memory plus GPU/CPU resources.
- WebGPU depends on runtime and hardware support; unsupported environments require WASM fallback.
- Remote-model loading requires internet access initially; offline use requires local models prepared in advance.
- The source provides no evidence of a dedicated test suite or cross-platform validation for this skill.
How do you install this skill?
Copy or symlink the repository folder skills/transformers-js into a standard .agents/skills location supported by the coding agent, such as a project-level .agents/skills directory. Install the runtime package with: npm install @huggingface/transformers. In a browser, the source also documents importing the package from its jsDelivr ES module URL. The source does not document a more specific installation flow for every client.
How do you use this skill?
Give a coding agent a request such as: "Use the transformers-js skill to build browser-side sentiment analysis with a quantized model and dispose the pipeline when finished." In code, import pipeline, choose a task and model such as pipeline('sentiment-analysis'), process inputs through the returned pipeline, and call await pipe.dispose() when finished. Select device: 'webgpu' when supported, otherwise use the WASM path, and configure dtype, caching, and progress_callback as needed.
How does this skill compare with similar options?
Compared with integrations that require a Python server, this skill focuses on running models directly inside JavaScript applications; the source does not provide a systematic comparison with specific competing libraries.