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.
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-jsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/huggingface/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/skills/transformers-js ~/.gemini/antigravity-cli/skills/transformers-jsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
