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
- 1Install 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.
- 2Choose a model
It filters Hub models by the transformers.js library and task, checks for ONNX files and pins a revision for production.
- 3Set device and precision
It uses WebGPU where supported with WASM as the fallback, and q8 or q4 dtypes to shrink downloads.
- 4Handle loading and errors
It wires a progress callback for large downloads and wraps pipeline calls in error handling.
- 5Clean 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 --consentCommands 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
/hf-cliGive your agent the complete Hugging Face Hub command lineGives the agent the full hf command reference for downloads, uploads, repos, buckets, Jobs, Spaces, endpoints and webhooks.Read the guide →/hf-cloud-sagemaker-deployment-plannerPlan a SageMaker model deployment with few questionsPlans a SageMaker deployment by asking few questions, picking real-time, scale-to-zero or async, and checking instance quotas.Read the guide →/huggingface-spacesBuild and debug Hugging Face Spaces the agent can verifyCreates, pushes, debugs and verifies Hugging Face Spaces, choosing SDK and hardware such as ZeroGPU from your account's limits.Read the guide →/train-sentence-transformersTrain embedding and reranker models from tested templatesTrains embedding models, rerankers, SPLADE or ColBERT encoders from production templates, with a baseline score and a verdict line.Read the guide →
Also in this pack
/hf-cloud-aws-context-discoveryReads your active AWS profile, region and caller identity before any AWS work instead of assuming a default region.↗/hf-cloud-python-env-setupCreates an isolated Python 3.10 to 3.12 environment with current boto3 for SageMaker scripts, never the system Python.↗/hf-cloud-sagemaker-iam-preflightValidates or discovers a usable SageMaker execution role before deploying, creating a new one only when none fits.↗/hf-cloud-sagemaker-production-defaultsDeploys a SageMaker endpoint with autoscaling, CloudWatch alarms and cleanup tags switched on from the start.↗/hf-cloud-serving-image-selectionChooses the serving container for a SageMaker model, preferring Hugging Face vLLM or TEI images, and finds its current URI.↗/hf-memEstimates the memory needed to run a Safetensors or GGUF model, optionally with KV cache, without downloading its weights.↗/huggingface-datasetsReads Hub datasets through the Dataset Viewer API: splits, row paging, text search, filters, parquet links and column statistics.↗/huggingface-gradioBuilds Gradio apps with Interface or Blocks, wires event listeners and custom HTML components, and calls them from the CLI.↗/huggingface-lora-space-builderDesigns and publishes a private Gradio Space tailored to one LoRA, following the trigger words and settings on its model card.↗/huggingface-papersFetches Hugging Face paper pages as markdown and pulls metadata such as authors, linked models, datasets and GitHub repo.↗/huggingface-trackioAdds Trackio metric logging and diagnostic alerts to training code and reads the results back through its CLI.↗/huggingface-vision-trainerFine-tunes object detection, image classification and SAM or SAM2 segmentation models on Hugging Face Jobs GPUs or locally.↗
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.