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 and TypeScript using Transformers.js. It is aimed at developers who want NLP, vision, audio and multimodal tasks in browsers or server runtimes.

  • Score 94
  • 11k 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/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/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 library from Hugging Face for running machine learning models directly in JavaScript and TypeScript. The skill describes how to use it across browsers and server-side runtimes such as Node.js, Bun and Deno, without a Python server. It covers installation through npm or a CDN and the pipeline API, which groups preprocessing, model inference and postprocessing into one call.

The skill documents tasks in natural language processing, computer vision, audio and multimodal work, plus feature extraction for embeddings. It shows how to pick a model from the Hugging Face Hub, choose a device such as WebGPU or WASM, and select a quantization level like q4 or q8. It is written for developers building JavaScript apps that need to run models on the client or the server.

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

What it can do

  • Pipeline APICreates a task pipeline with preprocessing, inference and postprocessing in one call.
  • Text tasksCovers text classification, named entity recognition, question answering, generation, translation and summarization.
  • Vision tasksCovers image classification, object detection, segmentation and depth estimation.
  • Audio tasksCovers speech recognition, audio classification and text-to-speech.
  • Multimodal tasksCovers image-to-text captioning and document question answering.
  • Device selectionRuns models on CPU by default or on GPU through WebGPU.
  • Quantization optionsLets the user choose fp32, fp16, q8 or q4 precision to trade accuracy for speed and size.
  • Model selectionLoads a specific model from the Hugging Face Hub and links to task filters for finding models.

What you need

  • Node.js 18+, or a compatible Bun or Deno runtime
  • Or a modern browser with ES module support
  • Internet access to download models from Hugging Face Hub, unless local models are used

Try asking

  • Use transformers.js to classify the sentiment of a product review.
  • Write a JavaScript snippet that transcribes an audio file with transformers.js.
  • Show me how to create embeddings with transformers.js and mean pooling.

Good to know

  • WebGPU requires runtime and hardware support. WASM is the broad fallback.
  • All pipelines must be disposed with pipe.dispose() to avoid memory leaks.
  • Large models are better suited to Node.js or powerful devices.

Security check

A

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

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

Inside the skill

  • SKILL.md24 KB
  • references/CACHE.md9 KB
  • references/CONFIGURATION.md11 KB
  • references/EXAMPLES.md15 KB
  • references/MODEL_ARCHITECTURES.md5 KB
Show all 8 files
  • references/MODEL_REGISTRY.md6 KB
  • references/PIPELINE_OPTIONS.md15 KB
  • references/TEXT_GENERATION.md8 KB

Alternatives to transformers-js

All alternatives →

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

transformers-js: common questions

Does Transformers.js need a Python server?

No. The source says it runs models directly in JavaScript across browsers and server-side runtimes with no Python server required.

Which runtimes does Transformers.js support?

The source lists browsers and server-side runtimes including Node.js, Bun and Deno. It requires Node.js 18+ or a compatible Bun or Deno runtime, or a modern browser with ES modules.

Where do the models come from?

Models are pre-trained models from the Hugging Face Hub. Internet access is needed to download them unless local models are used.

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 94 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.