skills
Skills and an MCP server that let Claude Code work with the Hugging Face Hub, covering model training, dataset creation, the hf CLI, and deploying models to Amazon SageMaker.
Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
$ git clone https://github.com/huggingface/transformers

English | 简体中文 | 繁體中文 | 한국어 | Español | 日本語 | हिन्दी | मराठी | Русский | Português | తెలుగు | Français | Deutsch | Italiano | Tiếng Việt | العربية | اردو | বাংলা | فارسی | Română | Türkçe
Transformers is the model-definition framework for machine learning models in text, computer vision, audio, video, and multimodal tasks. It defines each model once, in PyTorch, and you use that definition for both inference and training.
Training frameworks, inference engines, and local runtimes build on that definition instead of writing their own. Transformers adds new architectures as they're released and matches each one to its original results, so those tools get each new model as soon as it's added.
Fine-tune with less memory. Unsloth trains LLMs in 4-bit, 8-bit, and 16-bit precision with custom kernels.
Serve LLMs at scale. vLLM batches requests continuously and keeps KV cache memory compact with PagedAttention.
Serve LLMs with low latency. SGLang is a high-throughput inference engine with a frontend language for agentic workflows.
Transformers standardizes how every model is written, so hundreds of architectures share one structure. Each model is one file that reads from top to bottom and stays simple without giving up performance. An improvement made once reaches every architecture, so if you find one, contribute it.
Transformers is designed to be read and modified by humans and coding agents alike. To swap how a model computes, register your own attention or experts function, or load an optimized kernel from the Hub, and the model uses it without edits to its code.
Install Transformers with PyTorch. See the Installation guide for other setups.
uv pip install "transformers[torch]"
Create a Pipeline with a chat model from the Hugging Face Hub and pass it a message.
from transformers import pipeline
pipe = pipeline(task="text-generation", model="Qwen/Qwen3-0.6B")
messages = [
{"role": "user", "content": "What's the secret to baking a really good cake? Answer in one sentence."},
]
output = pipe(messages, tokenizer_encode_kwargs={"enable_thinking": False})
print(output[0]["generated_text"][-1]["content"])
# The secret to baking a really good cake is combining the perfect balance of ingredients, technique, and a warm, loving atmosphere.
The Quickstart covers loading models, running inference on other tasks, and training.
Copy the prompt below into your coding agent. It has the agent check your installed version, read the docs for that version, and use the current Transformers v5 APIs.
I'm building with Hugging Face Transformers. Before you write any Transformers code:
1. Check the installed version with `python -c "import transformers; print(transformers.__version__)"`. If Transformers isn't installed, install it with `pip install "transformers[torch]"`.
2. Read the docs index for that version at https://huggingface.co/docs/transformers/v<version>/llms.txt, for example v5.22.2. For a .dev version, use https://huggingface.co/docs/transformers/main/llms.txt. Add .md to any docs page URL to read it as Markdown. Look up each class and argument there instead of relying on memory.
3. If the version is 5.0 or later, read https://github.com/huggingface/transformers/blob/main/MIGRATION_GUIDE_V5.md. Don't use APIs from older versions.
4. Read the model card of each model you use on the Hugging Face Hub. Many models need specific arguments, like a chat template option or a minimum Transformers version.
Load a pretrained model and run it on text, images, audio, video, or any combination of modalities.
transformers chat, or pass a chat history to a pipeline.Serve a model to other applications over HTTP. transformers serve is for evaluation, experimentation, and moderate load. For large production deployments, use an inference engine with a Transformers model as the backend.
transformers serve.Fine-tune a pretrained model on your data, on one GPU or many.
torch.compile.Fit a model on your hardware and speed it up.
Add a model to Transformers or edit an existing one.
We now have a paper you can cite for the 🤗 Transformers library:
Skills and an MCP server that let Claude Code work with the Hugging Face Hub, covering model training, dataset creation, the hf CLI, and deploying models to Amazon SageMaker.
Skills for writing, optimizing, and benchmarking GPU compute kernels for Hugging Face libraries, covering CUDA on NVIDIA, Triton on NVIDIA and AMD, ROCm on AMD, Intel XPU, and C++ CPU SIMD kernels.
Gives you a Python library for building and training deep learning models, with tensor math that runs on GPUs and a flexible autograd system for computing gradients. Work in familiar Python and reuse libraries such as NumPy and SciPy.
Skills for the MLflow repository that analyze failed GitHub Actions jobs, review pull requests, triage issues, and enforce Python and workflow coding conventions.
Skills and an MCP server that let Claude Code work with the Hugging Face Hub, covering model training, dataset creation, the hf CLI, and deploying models to Amazon SageMaker.
Gives a machine learning team one place to define features and serve them consistently, so training data and live predictions use the same values. Covers the offline store, online store and feature server.
Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training. Free and open source.
Is this tool yours?
Claim it with GitHubSubmit a pluginPromote it