Install any skill in seconds. Free to start, no credit card required.
Get Started Free →waybarrios/transformers-js
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.
Passed 22 of 22 test cases with the skill, and 11 of 22 without it.
and 9 more in the full report
11 fixed11 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 11 test cases the skill fixed. Same model, same prompt, with and without the skill.
In a JS application, I need to tokenize text for a model without loading the full model inference weights into memory. Which package from Hugging Face provides lightweight standalone tokenization for JavaScript?
| Checked | Without skill | With skill |
|---|---|---|
| Identifies @huggingface/tokenizers as the dedicated standalone package. | Missed | Passed |
The instructions your model reads when the skill loads.
Runs state-of-the-art ML models directly in JavaScript, in browsers and server-side runtimes (Node.js, Bun, Deno), with no Python server required.
npm install @huggingface/transformers
// Browser (CDN)
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers';
Pipeline API — groups preprocessing, inference, and postprocessing. Always dispose() when done to free memory (see references/EXAMPLES.md for cleanup patterns):
import { pipeline } from '@huggingface/transformers';
const pipe = await pipeline('sentiment-analysis');
const result = await pipe('I love transformers!');
await pipe.dispose();
Model selection — pass a model ID as the second argument, e.g. pipeline('sentiment-analysis', 'Xenova/bert-base-multilingual-uncased-sentiment'). Browse compatible models at https://huggingface.co/models?library=transformers.js&sort=trending, filtered by pipeline_tag for a specific task.
Device: { device: 'webgpu' } for GPU acceleration (falls back to WASM/CPU when unsupported); omit for CPU/WASM default.
Quantization: { dtype: 'q4' } — options fp32 (largest/most accurate), fp16, q8, q4 (smallest, some accuracy loss).
One pipeline call per task, e.g. await pipeline('image-classification')('https://example.com/image.jpg'). Task IDs by category:
text-classification/sentiment-analysis, token-classification/ner, question-answering, fill-mask, summarization, translation, text-generation, text2text-generation, zero-shot-classificationimage-classification, object-detection, image-segmentation, depth-estimation, zero-shot-image-classification, image-to-imageautomatic-speech-recognition, audio-classification, text-to-speech/text-to-audioimage-to-text, document-question-answering, zero-shot-object-detectionfeature-extraction (add { pooling: 'mean', normalize: true } for sentence embeddings), sentence-similaritytest cases passed, vs 11 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.