---
title: "Transformers.js - Machine Learning for JavaScript"
type: skill
id: "huggingface-skills/hub-and-models/transformers-js"
category: "AI & machine learning"
publisher: "Hugging Face"
license: "Apache-2.0"
source: "https://github.com/huggingface/skills/tree/25910b3"
canonical: "https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/transformers-js"
open_in_pho: "https://pho.chat/customize?item=huggingface-skills%2Fhub-and-models%2Ftransformers-js&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library"
---

# Transformers.js - Machine Learning for JavaScript

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.

Source: Hugging Face (Apache 2.0), copied at a pinned commit. Free to use. Part of the Phở Skills library (https://labs.pho.chat/en/skills).
Skill set: Hugging Face Hub and models (https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models.md).

## What it covers
- 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
  - Feature Extraction (Embeddings)
- Finding and Choosing Models
  - Browsing the Hugging Face Hub
  - Choosing the Right Model
  - Example: Finding a Text Generation Model
  - Tips for Model Selection

## Other skills in this set
- [HuggingFace Best Model Finder](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/huggingface-best.md): Use when the user asks about finding the best, top, or recommended model for a task, wants to know what AI model to use, or wants to compare models by benchmark scores. Triggers on: "best model for…
- [Hf mem](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/hf-mem.md): Hugging Face CLI to estimate the required memory to load Safetensors or GGUF model weights for inference from the Hugging Face Hub
- [Hugging Face Local Models](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/huggingface-local-models.md): Use to select models to run locally with llama.cpp and GGUF on CPU, Mac Metal, CUDA, or ROCm. Covers finding GGUFs, quant selection, running servers, exact GGUF file lookup, conversion, and…
- [Hugging Face Dataset Viewer](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/huggingface-datasets.md): Use this skill for Hugging Face Dataset Viewer API workflows that fetch subset/split metadata, paginate rows, search text, apply filters, download parquet URLs, and read size or statistics.
- [Hugging Face Paper Pages](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/huggingface-papers.md): Look up and read Hugging Face paper pages in markdown, and use the papers API for structured metadata such as authors, linked models/datasets/spaces, Github repo and project page. Use when the user…
- [Hf cli](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/hf-cli.md): Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication…
- [TRL](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/trl-training.md): Post-train LLMs with TRL (Transformers Reinforcement Learning) — SFT, DPO, GRPO, KTO, and reward-model training. Use when writing or debugging training code with the TRL Python API or the trl CLI.
- [Trackio - Experiment Tracking for ML Training](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/huggingface-trackio.md): Track and visualize ML training experiments with Trackio. Use when logging metrics during training (Python API), firing alerts for training diagnostics, or retrieving/analyzing logged metrics (CLI)…
- [SageMaker Deployment Planner](https://labs.pho.chat/en/skills/huggingface-skills/hub-and-models/hf-cloud-sagemaker-deployment-planner.md): Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like…

## Use it
- In Phở: open https://pho.chat/customize?item=huggingface-skills%2Fhub-and-models%2Ftransformers-js&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library and press Try, or add it so Phở loads it whenever a request matches. Phở works with your own API key (OpenAI, Anthropic, Google and others).
- Full instructions (original SKILL.md, unchanged): https://labs.pho.chat/skills/raw/huggingface-skills/hub-and-models/skills/transformers-js/SKILL.md
- Original files: https://github.com/huggingface/skills/tree/25910b3 (Apache 2.0).
- Full machine-readable index: https://labs.pho.chat/skills.json
