Skills Prompts Hues

Popular categories

Agent skill · Hugging Face Skills

/transformers-js Run Hugging Face models in JavaScript with Transformers.js

The transformers-js skill teaches the agent to use Hugging Face's JavaScript library to run models in the browser or in Node, Bun and Deno without a Python server. It covers the pipeline API across text, vision, audio and multimodal tasks, picking compatible models, WebGPU versus WASM, quantised dtypes, caching, progress callbacks and freeing memory.

Works with

  • Claude Code
  • Gemini CLI

When to use it

  • You want sentiment, translation or speech recognition running client-side in a web app.
  • You need text embeddings in a Node service without a separate ML backend.
  • You are choosing between WebGPU and WASM and between fp32 and quantised weights.

How it works

  1. 1
    Install and create a pipeline

    The agent installs the package or imports it from a CDN and builds a task pipeline, optionally with a specific model ID.

  2. 2
    Choose a model

    It filters Hub models by the transformers.js library and task, checks for ONNX files and pins a revision for production.

  3. 3
    Set device and precision

    It uses WebGPU where supported with WASM as the fallback, and q8 or q4 dtypes to shrink downloads.

  4. 4
    Handle loading and errors

    It wires a progress callback for large downloads and wraps pipeline calls in error handling.

  5. 5
    Clean up

    It disposes pipelines when they are no longer needed so model memory is released.

What it steers the agent away from

  • Memory leaks from pipelines that are never disposed.
  • Picking Hub models that lack ONNX weights.
  • Recreating a pipeline for every request instead of reusing it.

Install this skill

It installs with the Hugging Face Skills pack.

Claude CodeThe plugin marketplace exposes only hf-cli; the rest are added one by one with the hf CLI.
/plugin marketplace add huggingface/skills
/plugin install hf-cli@huggingface/skills
hf skills add <skill-name>
Gemini CLIInstalls the repository as a Gemini CLI extension; you can also run the install from a local checkout.
gemini extensions install https://github.com/huggingface/skills.git --consent

Commands come from the author’s README; check it for changes before you run them.

Questions

Which runtimes does it target?

Modern browsers with ES modules, plus Node.js 18 or later and compatible Bun or Deno runtimes.

Can models be loaded without internet access?

Yes. The environment settings can disable remote models and point to a local model directory instead.

More guides from Hugging Face Skills

Also in this pack

All 19 skills →

Summary by trendhub. The skill itself lives in huggingface/skills/skills/transformers-js by Hugging Face (Apache-2.0); read the full, current text there.