Transformers.js

SkillWeb & browsing

Lets your agent run machine learning models in JavaScript for text, image, and audio tasks like classification and speech recognition.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Transformers.js skill

About this capability

Build and validate local browser or Bun inference with Hugging Face Transformers.js, WebGPU or WASM backends, quantization, caching, and cleanup.

What this skill tells your AI

The instructions your AI receives, as published by metaspartan/cybara in plugins/huggingface-workflows/skills/transformers-js/SKILL.md and read by ahel’s review.

Use @huggingface/transformers for JavaScript or TypeScript inference in Bun, Node-compatible runtimes, and browsers.

Setup

bun add @huggingface/transformers
import { pipeline } from "@huggingface/transformers";

const classifier = await pipeline("text-classification");
try {
  const result = await classifier("Cybara runs this model locally.");
  console.log(result);
} finally {
  await classifier.dispose();
}

Workflow

  1. Choose a model whose card lists Transformers.js or ONNX compatibility for the required task.
  2. Pin the model ID and revision when reproducibility matters.
  3. Start with CPU/WASM compatibility, then enable WebGPU only after feature detection.
  4. Select dtype or quantization from measured memory, latency, and quality requirements.
  5. Configure the cache explicitly for desktop or server runtimes.
  6. Warm the model before benchmarking and separate download time from inference latency.
  7. Dispose pipelines and tensors when the workflow ends.
  8. Test unavailable WebGPU, interrupted downloads, offline cache reuse, and malformed inputs.

Do not load untrusted custom model code. For browser applications, keep model downloads visible to the user and avoid blocking the main thread during initialization or long inference.

Signals

GitHub stars
28
Forks
7
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
transformers-js
Source
github.com/metaspartan/cybara