transformers-js

transformers-js is a skill for Claude Code, Codex from metaspartan/cybara. It costs 35 tokens per session (338 once invoked), scanned A, original, MIT.

A guide for running Hugging Face machine-learning models locally from JavaScript or TypeScript. It covers browsers, Bun, and Node-compatible runtimes using CPU, WebAssembly, or WebGPU.

In plain words
What is it for?
Use it to add local tasks such as text classification to an application. It helps configure quantization, benchmark inference, reuse downloaded models, and handle unavailable WebGPU or interrupted downloads.
Why use it?
It helps you choose compatible models and settings without relying on a remote inference service. It also addresses memory use, caching, startup time, cleanup, offline use, and invalid input.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/metaspartan/cybara/transformers-js
Any agent
npx skills add metaspartan/cybara --skill transformers-js
Clone the repo
git clone --depth 1 https://github.com/metaspartan/cybara

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for transformers-js

README.md
[![agentmods](https://agentmods.dev/badge/skills/metaspartan/cybara/transformers-js.svg)](https://agentmods.dev/skills/metaspartan/cybara/transformers-js)
Your own site
<a href="https://agentmods.dev/skills/metaspartan/cybara/transformers-js"><img src="https://agentmods.dev/badge/skills/metaspartan/cybara/transformers-js.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 338 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00338
Opus 5 $0.00017 $0.00169
Sonnet 5 $0.00007 $0.00068
Haiku 4.5 $0.00003 $0.00034

Measured 6d ago against content hash 91c448c1019e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

transformers-js scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/huggingface-workflows/skills/transformers-js/SKILL.md · 41 lines

What it actually says

Transformers.js

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.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 41 lines · 35 tokens per session scan A 91c448c1019e

Subscribe to this mod's changes

transformers-js is a skill published in the GitHub repository metaspartan/cybara (26 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 338 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ecc-cost-aware-llm-pipeline

Skill "ecc-cost-aware-llm-pipeline" from KornLabs/truss, covering cost-aware llm pipeline, when to activate, core concepts, 1. model routing by task complexity and 2. immutable cost tracking.

KornLabs/truss · 0 tokens

bigquery-ai-ml

Skill for BigQuery AI and Machine Learning queries using standard SQL and AI. functions (preferred over dedicated tools).

google/adk-python · 31 tokens

ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI…

vercel-labs/open-agents · 155 tokens

salary-market-scanner

Scan live job boards and salary databases to find real-time compensation data for any role and location. Use this skill when a user asks "what's the going rate for a senior React engineer in London", "software engineer salary Singapore", "how much do ML engineers make", "what should I be earning as a [role]", "is my…

tinyfish-io/tinyfish-cookbook · 114 tokens

openmaic-classroom

将 RAG 检索结果、文档块或知识图谱概念转换为 OpenMAIC 互动课程。当用户要求将知识库内容、检索到的文档片段、上传的文档、或知识图谱中的概念批量转换为教学课件/互动课堂时使用此技能。支持纯需求生成、基于 PDF 内容的课程生成、和基于概念图遍历的批量课堂生成。.

Tencent/WeKnora · 102 tokens

weknora-shared

Use when driving a WeKnora RAG server through the weknora CLI as an agent — authenticating, managing knowledge bases / documents / sessions / agents, running search or chat, or interpreting the CLI's JSON envelopes and exit codes. Read this before any other weknora- skill.

Tencent/WeKnora · 68 tokens