Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

transformers-js

Skill by huggingface

Runs machine learning models directly in JavaScript through a single pipeline() function. It is for developers who want text, vision, audio, and multimodal inference in browsers, Node.js, Bun, or Deno without a Python server.

  • Score 91
  • 16k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install transformers-js

Built from the published package, never by AI.

git clone --depth 1 https://github.com/huggingface/transformers.js /tmp/transformers.js && mkdir -p ~/.claude/skills && cp -r /tmp/transformers.js/.ai/skills/transformers-js ~/.claude/skills/transformers-js

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install transformers-js in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

transformers.js is a skill built on the @huggingface/transformers library. It runs ML inference in JavaScript, without a Python server. The main entry point is pipeline(task, model?, options?), and when no model is passed, the task's default model is used. The source lists about two dozen tasks across text, audio, and vision, including classification, speech recognition, text-to-speech, object detection, and embeddings.

The library runs in browsers and in Node.js, Bun, and Deno, with WebGPU or WASM execution. Models are downloaded from the Hugging Face Hub and must include ONNX weights. The skill tells the assistant to verify that a model has ONNX files before recommending it, and it covers dtype options, device selection, caching, and disposing of pipelines. It is for JavaScript developers who need on-device or server-side model inference.

Written from the project's SKILL.md and checked against it.

What it can do

  • Text pipelinesRuns text classification, NER, question answering, summarization, translation, and text generation.
  • Audio pipelinesRuns speech recognition, text-to-audio, and audio classification tasks.
  • Vision pipelinesRuns image classification, object detection, segmentation, depth estimation, and background removal.
  • Feature extractionCreates embeddings with the feature-extraction task, also called embeddings.
  • Model verificationChecks whether a Hub model ships ONNX weights using ModelRegistry.get_available_dtypes.
  • Quantization optionsSelects dtype values such as fp32, fp16, q8, q4, and q4f16 to trade size for accuracy.
  • WebGPU device optionSets device to webgpu to run on the GPU when the runtime and hardware support it.
  • Cache and environment settingsConfigures model sources, Node.js disk caching, browser caching, and logging through env.
  • Memory cleanupCalls pipe.dispose() to release model weights and backend sessions when work is done.

What you need

  • Node.js 20+, or Bun or Deno
  • A modern browser with ES modules, if running in the browser
  • Network access to the Hugging Face Hub, unless models are shipped locally
  • WebGPU runtime and hardware support, if using WebGPU

Try asking

  • Use transformers.js to classify the sentiment of this review text.
  • Write a Node.js script that transcribes an audio file with transformers.js.
  • Check whether a Hub model has ONNX files before using it with transformers.js.

Good to know

  • Models must include ONNX weights to load.
  • Model downloads need network access unless models are shipped locally.
  • WebGPU needs runtime and hardware support; WASM is the fallback.
  • A disposed pipeline must not be reused; create a new one instead.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .ai/skills/transformers-js/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md10 KB
  • references/CONFIGURATION.md10 KB
  • references/PIPELINE_OPTIONS.md20 KB
  • references/TASKS.md38 KB

Alternatives to transformers-js

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

transformers-js: common questions

Can transformers.js run in the browser?

Yes. The source says it runs in browsers as well as Node.js, Bun, and Deno, with a modern browser that supports ES modules.

What happens if a model has no ONNX files?

The library cannot load the model without ONNX weights. The source says to check for an onnx/ directory on the Hub or use ModelRegistry.get_available_dtypes before suggesting a model.

Does it need a GPU?

No. The default is CPU with WASM. WebGPU is optional and requires runtime and hardware support.

How do I install transformers-js?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is transformers-js free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is transformers-js safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to transformers-js?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

transformers-js Install

Add to stack

Loading.