Agent skill · practicalswan
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.
What it needs
About 9k tokens when loaded.
What this skill does
Transformers.js - Machine Learning for JavaScript 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. 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 Browser Usage (CDN) Core Concepts 1. Pipeline API The pipeline API is the easiest way to use models. It groups together preprocessing, model inference, and postprocessing: ⚠️ Memory Management: All pipelines must be disposed with pipe.dispose() when finished to prevent memory leaks. See examples in Code Examples for cleanup patterns across different environments. 2. Model Selection You can specify a custom model as the second argument: Finding Models: Browse available Transformers.js models on Hugging Face Hub: All models: https://huggingface.co/models?library=transformers.js&sort=trending By task: Add pipelinetag parameter Text generation: https://huggingface.co/models?pipelinetag=text-generation&library=transformers.js&sort=trending Image classification: https://huggingface.co/models?pipelinetag=image-classification&library=transformers.js&sort=trending Speech recognition: https://huggingface.co/models?pipelinetag=automatic-speech-recognition&library=transformers.js&sort=trending Tip: Filter by task type, sort by trending/downloads, and check model cards for performance metrics and usage examples. 3. Device Selection Choose where to run the model: 4. Quantization Options Control model precision vs. performance: Supported Tasks Note: All examples below show basic usage. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills practicalswan/transformers-js