huggingface-transformers

huggingface-transformers is a skill for Claude Code, Codex from stefan-jansen/claude-code-toolkit. It costs 52 tokens per session (5,062 once invoked), scanned A, original, MIT.

A reference guide for Hugging Face Transformers, a Python library for using transformer-based machine-learning models. It covers loading models, preparing text, training on custom data, running language or vision tasks, and serving models.

In plain words
What is it for?
Use it when building or debugging applications with models such as BERT, GPT, T5, LLaMA, or vision transformers, including fine-tuning and production inference.
Why use it?
It helps developers avoid common mistakes with model setup, tokenization, training, inference, and deployment. It also explains ways to make model predictions use less time or memory.

Skill for Claude CodeCodex

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

Good fit Use it when building or debugging applications with models such as BERT, GPT, T5, LLaMA, or vision transformers, including fine-tuning and production inference.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stefan-jansen/claude-code-toolkit/huggingface-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 stefan-jansen/claude-code-toolkit --skill huggingface-transformers
Clone the repo
git clone --depth 1 https://github.com/stefan-jansen/claude-code-toolkit

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/stefan-jansen/claude-code-toolkit/huggingface-transformers/github.svg)](https://agentmods.dev/skills/stefan-jansen/claude-code-toolkit/huggingface-transformers)
Your own site
<a href="https://agentmods.dev/skills/stefan-jansen/claude-code-toolkit/huggingface-transformers"><img src="https://agentmods.dev/badge/skills/stefan-jansen/claude-code-toolkit/huggingface-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 huggingface-transformers

Your own site · 80×15
<a href="https://agentmods.dev/skills/stefan-jansen/claude-code-toolkit/huggingface-transformers"><img src="https://agentmods.dev/badge/skills/stefan-jansen/claude-code-toolkit/huggingface-transformers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,062 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00052 $0.05062
Opus 5.5 $0.00021 $0.02025
Sonnet 5.5 $0.00010 $0.01012
Haiku 4.5 $0.00005 $0.00506

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

Security

Grade A, and why

huggingface-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.

skills/huggingface-transformers/SKILL.md · 840 lines

How it starts

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

Hugging Face Transformers Best Practices

Comprehensive guide to using the Hugging Face Transformers library including model loading, tokenization, fine-tuning workflows, pipeline usage, custom datasets, and deployment optimization.


Quick Reference

When to use this skill:

  • Loading and using pre-trained transformers (BERT, GPT, T5, LLaMA, etc.)
  • Fine-tuning models on custom data
  • Implementing NLP tasks (classification, QA, generation, etc.)
  • Optimizing inference (quantization, ONNX, etc.)
  • Debugging tokenization issues
  • Using Hugging Face pipelines
  • Deploying transformers to production

Models covered:

  • Encoders: BERT, RoBERTa, DeBERTa, ALBERT
  • Decoders: GPT-2, GPT-Neo, LLaMA, Mistral
  • Encoder-Decoders: T5, BART, Flan-T5
  • Vision: ViT, CLIP, Stable Diffusion

Part 1: Model Loading Patterns

Pattern 1: Basic Model Loading

from transformers import AutoModel, AutoTokenizer

# Load model and tokenizer
model_name = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

# For specific tasks
from transformers import AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained(
    model_name,
    num_labels=3  # For 3-class classification
)

Pattern 2: Loading with Specific Configuration

from transformers import AutoConfig, AutoModel

# Modify configuration
config = AutoConfig.from_pretrained("bert-base-uncased")
config.hidden_dropout_prob = 0.2  # Custom dropout
config.attention_probs_dropout_prob = 0.2

# Load model with custom config
model = AutoModel.from_pretrained("bert-base-uncased", config=config)

# Or create model from scratch with config
model = AutoModel.from_config(config)

Pattern 3: Loading Quantized Models (Memory Efficient)

from transformers import AutoModel, BitsAndBytesConfig
import torch

# 8-bit quantization (50% memory reduction)
quantization_config = BitsAndBytesConfig(load_in_8bit=True)

model = AutoModel.from_pretrained(
    "meta-llama/Llama-2-7b-hf",
    quantization_config=quantization_config,
    device_map="auto"  # Automatic device placement
)

# 4-bit quantization (75% memory reduction)
quantization_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_compute_dtype=torch.float16,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_use_double_quant=True
)

model = AutoModel.from_pretrained(
    "meta-llama/Llama-2-13b-hf",
    quantization_config=quantization_config,
    device_map="auto"
)

Read the full file on GitHub · 840 lines

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 First seen · 840 lines · 52 tokens per session scan A 58d6f8db3e61

Subscribe to this mod's changes

huggingface-transformers is a skill published in the GitHub repository stefan-jansen/claude-code-toolkit (89 stars, last pushed 3mo ago), licensed MIT. It adds 52 tokens to every session and 5,062 once invoked, about $0.0002 per session on Opus 5.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

llamaindex

Data framework for building LLM applications with RAG. Specializes in document ingestion (300+ connectors), indexing, and querying. Features vector indices, query engines, agents, and multi-modal support. Use for document Q&A, chatbots, knowledge retrieval, or building RAG pipelines. Best for data-centric LLM…

davila7/claude-code-templates · 70 tokens

langchain

Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG…

davila7/claude-code-templates · 79 tokens

sglang

Fast structured generation and serving for LLMs with RadixAttention prefix caching. Use for JSON/regex outputs, constrained decoding, agentic workflows with tool calls, or when you need 5× faster inference than vLLM with prefix sharing. Powers 300,000+ GPUs at xAI, AMD, NVIDIA, and LinkedIn.

davila7/claude-code-templates · 72 tokens

dataset-transformation

Generates code that transforms datasets between ML schemas for model training or evaluation. Use when the user says "transform", "convert", "reformat", "change the format", or when a dataset's schema needs to change to match the target format — always use this skill for format changes rather than writing inline…

awslabs/agent-plugins · 110 tokens

dataset-evaluation

Validates dataset formatting and quality for SageMaker model fine-tuning (SFT, DPO, or RLVR). Use when the user says "is my dataset okay", "evaluate my data", "check my training data", "I have my own data", or before starting any fine-tuning job. Detects file format, checks schema compliance against the selected model…

awslabs/agent-plugins · 93 tokens

use-case-specification

Creates a reusable use case specification file that defines the business problem, stakeholders, and measurable success criteria for model customization, as recommended by the AWS Responsible AI Lens. Use as the default first step in any model customization plan. Skip only if the user explicitly declines or already has…

awslabs/agent-plugins · 85 tokens