alterlab-transformers

alterlab-transformers is a skill for Claude Code from AlterLab-IEU/AlterLab-Academic-Skills. It costs 181 tokens per session (2,873 once invoked), scanned A, a copy of transformers, MIT.

A Python library that provides pre-trained models for text, images, audio, and combined media. These models can generate, classify, translate, summarize, answer questions, recognize speech, or be adapted to custom data.

In plain words
What is it for?
Use it for text generation and classification, question answering, translation, summarization, image recognition, object detection, speech recognition, and model fine-tuning.
Why use it?
It gives you ready-made machine-learning models so you can run common AI tasks without training a model from the beginning.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the alterlab-data-science plugin — 22 skills shipped together

Good fit Use it for text generation and classification, question answering, translation, summarization, image recognition, object detection, speech recognition, and model fine-tuning.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers
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.

Any agent
npx skills add AlterLab-IEU/AlterLab-Academic-Skills --skill alterlab-transformers
Clone the repo
git clone --depth 1 https://github.com/AlterLab-IEU/AlterLab-Academic-Skills

Made for: Claude Code.

Or install alterlab-data-science, the plugin that ships this one along with the rest of its 22 skills.

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 alterlab-transformers

README.md
[![agentmods](https://agentmods.dev/badge/skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers/github.svg)](https://agentmods.dev/skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers)
Your own site
<a href="https://agentmods.dev/skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers"><img src="https://agentmods.dev/badge/skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for alterlab-transformers

Your own site · 80×15
<a href="https://agentmods.dev/skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers"><img src="https://agentmods.dev/badge/skills/alterlab-ieu/alterlab-academic-skills/alterlab-transformers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 181 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,873 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod 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.00181 $0.02873
Opus 5.5 $0.00072 $0.01149
Sonnet 5.5 $0.00036 $0.00575
Haiku 4.5 $0.00018 $0.00287

Measured 1mo ago against content hash 483ac67c6f38, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

alterlab-transformers 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 1mo 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.

Origin

This is a copy

94% identical to transformers — 212 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/data-science/alterlab-transformers/SKILL.md · 213 lines

How it starts

The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Transformers

Overview

Hugging Face Transformers loads pretrained checkpoints from the Hub for NLP, vision, audio, and multimodal tasks, runs inference through pipeline() or the Auto* classes, and fine-tunes them with Trainer. This skill targets transformers v5 (≥ 5.0; current 5.17.0 as of 2026-09). v5 is PyTorch-only and changes several v4 idioms, so check "v5 changes that break v4 code" below before reusing older snippets from papers, blogs, or model cards.

When to Use This Skill

Use this skill when the user wants to:

  • Run quick inference with a Hub checkpoint via pipeline() — text classification, NER, zero-shot classification, text generation with a chat model, speech recognition, image classification/detection, or image-text-to-text with a VLM.
  • Load a model plus tokenizer/processor with explicit dtype, device_map, attention backend, or 4/8-bit quantization.
  • Control decoding in model.generate() (greedy, sampling, beam search, streaming, chat templates).
  • Fine-tune an encoder or decoder on a custom labelled dataset with Trainer, optionally with LoRA via peft.
  • Port v4-era code (torch_dtype=, load_in_8bit=, removed pipelines, TF/Flax models) to v5.

Does NOT Trigger

Scenario Use Instead
Classical ML on tabular features (random forests, preprocessing pipelines, CV grid search) alterlab-scikit-learn
Structuring a custom PyTorch architecture's training loop, multi-GPU strategy, and checkpointing with a LightningModule alterlab-pytorch-lightning
Topic models, embeddings, or text classifiers as a social-science measurement design (validity, BERTopic, dictionaries) alterlab-text-as-data
Protein language models (ESM3 / ESM C embeddings, protein design) alterlab-esm
Zero-shot time-series forecasting with a pretrained foundation model alterlab-timesfm

Installation

uv pip install "transformers>=5" torch accelerate datasets
  • Vision: add pillow and torchvision (the default image-processor backend; timm only for timm-backed models).
  • Audio: add librosa soundfile.
  • LoRA / quantization: peft, bitsandbytes (CUDA). Metrics: evaluate or plain scikit-learn metrics.

Read the full file on GitHub · 213 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago Changed · +48 lines · +111 tokens per session 483ac67c6f38
  2. 1mo ago First seen · 165 lines · 70 tokens per session scan A 1301523f18da

Subscribe to this mod's changes

alterlab-transformers is a skill published in the GitHub repository AlterLab-IEU/AlterLab-Academic-Skills (78 stars, last pushed yesterday), licensed MIT. It adds 181 tokens to every session and 2,873 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to transformers, differing in 212 lines, and is treated as a copy.

Related

Other skills, from other repositories

r-spss-syntax-architect

A guide for turning research hypotheses into repeatable R or SPSS code for statistical analysis. It covers panel data, where the same companies or other units are observed over time, as well as interaction effects, curves, and mediation.

Nero1688/claude-academic-skills · 535 tokens

multi-source-data-integrator

A method for combining independent data sources into one traceable, reproducible research dataset.

Nero1688/claude-academic-skills · 685 tokens

outlines

Guarantee valid JSON/XML/code structure during generation, use Pydantic models for type-safe outputs, support local models (Transformers, vLLM), and maximize inference speed with Outlines - dottxt.ai's structured generation library.

davila7/claude-code-templates · 50 tokens

ml-expert

Expert-level machine learning, deep learning, model training, and MLOps. Use when the user mentions machine learning, deep learning, neural networks, MLOps, or data science, or when the task involves Machine Learning Fundamentals, Data Preparation, or Model Training.

personamanagmentlayer/pcl · 58 tokens

llm-engineering-expert

Build reliable applications on large language models: prompt design, structured output, evaluation, guardrails, and cost and latency control. Use when the user mentions LLMs, prompts, prompt engineering, few-shot examples, structured or JSON output, function calling, hallucination, model evaluation, token costs…

personamanagmentlayer/pcl · 92 tokens

partner-anthropic

Anthropic intelligence — Claude model family, Claude Code, MCP protocol, Claude for Work programs, May 2026 state, Frank's relationship state, integration patterns. Use when generating Anthropic content, writing about Claude/MCP/Claude Code, partnership-conversation prep for Anthropic, or evaluating new Anthropic…

frankxai/claude-skills-library · 69 tokens