Transformers: a PyTorch model-definition framework for inference and training
Transformers is a Hugging Face library that defines state-of-the-art machine learning models in PyTorch, for both running and training them.
Transformers defines each model once, in PyTorch. According to the README, training frameworks, inference engines and local runtimes build on that definition instead of writing their own. Each model is one file, and the README says hundreds of architectures share one structure. The library covers text, computer vision, audio, video and multimodal tasks.
Install it with uv pip install transformers[torch]. The README's example creates a text-generation pipeline for the Qwen/Qwen3-0.6B model from the Hugging Face Hub. The README describes transformers serve as a local OpenAI-compatible server for evaluation and moderate load. For larger production deployments, it points to engines such as vLLM or SGLang, which use a Transformers model as the backend. For training, it lists the Trainer, PEFT, FSDP, and tensor and expert parallelism. All of these mention GPUs.
The README header marks the project under the Apache License 2.0. It also includes a citation for a 2020 EMNLP demo paper about the library. The README does not list hardware requirements for running models, and it does not say how much of the code is written by which contributors. Its ongoing claim is that new architectures are added as they are released and checked against their original results.
In the author's words
Transformers is the model-definition framework for machine learning models in text, computer vision, audio, video, and multimodal tasks.
From the README or the author's post. We checked that the sentence is there, not that it is true.
When to reach for it
If you want one reference implementation that inference servers and training tools can share, the README's approach is worth studying. It defines each model in a single readable file and then reuses it everywhere. Use the pipeline call first to check a model's behaviour before writing your own loop.
Works with
See it
AI wrote this entry from the project's own README or its author's post. What the project does, and that AI built it where the entry says so, are the author's statements, quoted here. Nobody at IKANGAI ran or tested it. How this list is made