hf-mcp
Use Hugging Face Hub via MCP server tools. Search models, datasets, Spaces, papers. Get repo details, fetch documentation, run…
Use Transformers.js to run state-of-the-art machine learning models directly in JavaScript/TypeScript. Supports NLP (text classification, translation, summarization), computer vision (image classification, object detection), audio (speech recognition, audio classification), and
Claude Code
$ npx -y skills add huggingface/skills --skill transformers-js --agent claude-code
Codex
$ npx skills add huggingface/skills --skill transformers-js -a codex -y
Cursor
$ npx skills add huggingface/skills --skill transformers-js -a cursor -y
Gemini CLI
$ npx skills add huggingface/skills --skill transformers-js -a gemini-cli -y
GitHub Copilot
$ npx skills add huggingface/skills --skill transformers-js -a github-copilot -y
OpenCode
$ npx skills add huggingface/skills --skill transformers-js -a opencode -y
Windsurf
$ npx skills add huggingface/skills --skill transformers-js -a windsurf -y
name: transformers-js description: Use Transformers.js to run state-of-the-art machine learning models directly in JavaScript/TypeScript. Supports NLP (text classification, translation, summarization), computer vision (image classification, object detection), audio (speech recognition, audio classification), and multimodal tasks. Works in browsers and server-side runtimes (Node.js, Bun, Deno) with WebGPU/WASM using pre-trained models from Hugging Face Hub. license: Apache-2.0 metadata: author: huggingface version: "4.x" category: machine-learning repository: https://github.com/huggingface/transformers.js compatibility: Requires Node.js 18+ (or compatible Bun/Deno runtime) or modern browser with ES modules support. WebGPU requires runtime and hardware support; WASM is the broad fallback. Internet access is needed for downloading models from Hugging Face Hub (optional if using local models).
Transformers.js enables running state-of-the-art machine learning models directly in JavaScript across browsers and server-side runtimes (Node.js, Bun, Deno), with no Python server required.
Use this skill when you need to:
npm install @huggingface/transformers
<script type="module">
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers';
</script>The pipeline API is the easiest way to use models. It groups together preprocessing, model inference, and postprocessing:
import { pipeline } from '@huggingface/transformers';
// Create a pipeline for a specific task
const pipe = await pipeline('sentiment-analysis');
// Use the pipeline
const result = await pipe('I love transformers!');
// Output: [{ label: 'POSITIVE', score: 0.999817686 }]
// IMPORTANT: Always dispose when done to free memory
await pipe.dispose();**⚠️ Memory Management:** All pipelines must be disposed with `pipe.dispose()` when finished to prevent memory leaks. See examples in [Code Examples](./references/EXAMPLES.md) for cleanup patterns across different environments.
You can specify a custom model as the second argument:
const pipe = await pipeline( 'sentiment-analysis', 'Xenova/bert-base-multilingual-uncased-sentiment' );
**Finding Models:**
Browse available Transformers.js models on Hugging Face Hub:
**Tip:** Filter by task type, sort by trending/downloads, and check model cards for performance metrics and usage examples.
Choose where to run the model:
// Run on CPU (default for WASM)
const pipe = await pipeline('sentiment-analysis', 'model-id');
// Run on GPU (WebGPU)
const pipe = await pipeline('sentiment-analysis', 'model-id', {
device: 'webgpu',
});Control model precision vs. performance:
// Use quantized model (faster, smaller)
const pipe = await pipeline('sentiment-analysis', 'model-id', {
dtype: 'q4', // Options: 'fp32', 'fp16', 'q8', 'q4'
});**Note:** All examples below show basic usage.
const classifier = await pipeline('text-classification');
const result = await classifier('This movie was amazing!');const ner = await pipeline('token-classification');
const entities = await ner('My name is John and I live in New York.');const qa = await pipeline('question-answering');
const answer = await qa({
question: 'What is the capital of France?',
context: 'Paris is the capital and largest city of France.'
});const generator = await pipeline('text-generation', 'onnx-community/gemma-3-270m-it-ONNX');
const text = await generator('Once upon a time', {
max_new_tokens: 100,
temperature: 0.7
});**For streaming and chat:** See **[Text Generation Guide](./references/TEXT_GENERATION.md)** for:
const translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M');
const output = await translator('Hello, how are you?', {
src_lang: 'eng_Latn',
tgt_lang: 'fra_Latn'
});const summarizer = await pipeline('summarization');
const summary = await summarizer(longText, {
max_length: 100,
min_length: 30
});const classifier = await pipeline('zero-shot-classification');
const result = await classifier('This is a story about sports.', ['politics', 'sports', 'technology']);const classifier = await pipeline('image-classification');
const resHugging Face Skills are definitions for AI/ML tasks like dataset creation, model training, and evaluation.
Use Hugging Face Hub via MCP server tools. Search models, datasets, Spaces, papers. Get repo details, fetch documentation, run…
Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and…
Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use…
Set up an isolated Python environment for SageMaker / AWS work, with the right Python version and current boto3. Use this skill…
Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host,…
Ensure a usable SageMaker execution role exists before deploying or training. Use this skill whenever about to create a SageMaker…
Internals of the Feast codebase — how each component works, where the key abstractions live, and the data flow through the…
Query and browse evaluation results stored in MLflow. Use when the user wants to look up runs by invocation ID, compare metrics…