transformers-js
Run Hugging Face models in JavaScript or TypeScript with Transformers.js in Node.js or the browser.
npx skills add majiayu000/claude-skill-registry --skill transformers-js --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Runs Hugging Face models in JavaScript or TypeScript with Transformers.js in Node.js or the browser.
How it works
- Provides a Pipeline API to simplify preprocessing, inference, and postprocessing for tasks like text classification, translation, summarization, and more.
- Allows specifying a model by ID when creating a pipeline, e.g., pipeline('text-classification', 'model-id').
- Supports device selection (CPU by default; optional WebGPU for GPU acceleration).
- Supports quantization options (e.g., dtype: 'q4', 'q8', etc.) to trade accuracy for speed/size.
- Includes a Browser/Node usage path via npm install and CDN import.
- Emphasizes memory management by disposing pipelines when finished (pipe.dispose()).
- Encourages model discovery on Hugging Face Hub and provides example model IDs.
- Offers advanced environment configuration (env) for loading remote/local models, caching, and paths.
- Documents a variety of tasks across NLP, Computer Vision, Audio, and Multimodal pipelines, with code examples for setup and use.
When to use it
- You need to run ML models client-side or in Node.js without a backend.
- You want to perform text analysis, generation, translation, image tasks, audio processing, or multimodal tasks in JavaScript/TypeScript.
- You require optional GPU acceleration via WebGPU or quantized models for performance/cost trade-offs.
- You need a straightforward way to fetch or load models from Hugging Face Hub or use local models with caching.
What it can touch
- Code paths for npm installation:
npm install @huggingface/transformers. - Browser CDN usage:
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers';. - Model loading via
pipeline(...)with model-id and optional config such asdtypeanddevice. - Environment configuration via
envfrom@huggingface/transformersto control remote/local models, caching, and paths. - Tokenizers and models loaded with
AutoTokenizerandAutoModelas shown in examples.
Caveats
- Compatibility requires Node.js 18+ or a modern browser with ES modules support; WebGPU support is conditional on browser/environment.
- Internet access may be needed to download models from Hugging Face Hub (local models can be used if available).
- Memory management is manual; pipelines must be disposed to prevent leaks.
- The skill notes risk status as unknown.
# Transformers.js - Machine Learning for JavaScript Transformers.js enables running state-of-the-art machine learning models directly in JavaScript, both in browsers and Node.js environments, with no server required. ## When to Use This Skill Use this skill when you need to: - Run ML models for text analysis, generation, or translation in JavaScript - Perform image classification, object detection, or segmentation - Implement speech recognition or audio processing - Build multimodal AI applications (text-to-image, image-to-text, etc.) - Run models client-side in the browser without a backend ## Installation ### NPM Installation ```bash npm install @huggingface/transformers ``` ### Browser Usage (CDN) ```javascript <script type="module"> import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers'; </script> ``` ## Core Concepts ### 1. Pipeline API The pipeline API is the easiest way to use models. It groups together preprocessing, model inference, and postprocessing: ```javascript import { pipeline } from '@huggingface/transformers'; // Create a pipeline for a specific task const pipe = await pipeline('sentiment-analysis'); // Use the pipeline const result = aw
- When to Use This Skill
- Installation
- NPM Installation
- Browser Usage (CDN)
- Core Concepts
- 1. Pipeline API
- 2. Model Selection
- 3. Device Selection
- 4. Quantization Options
- Supported Tasks
- Natural Language Processing
- Computer Vision
- Audio Processing
- Multimodal
npm install @huggingface/transformers
What does the transformers-js skill do?
Run Hugging Face models in JavaScript or TypeScript with Transformers.js in Node.js or the browser.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill transformers-js --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
