Hugging Face Transformers
The Python library that defines most open models: the reference way to load, run and fine-tune a model straight from its release.
Transformers is Hugging Face's open-source library of model definitions for text, vision, audio, video and multimodal models, for both inference and training. Its stated aim is to centralize the definition of each model so the whole ecosystem agrees on it. If Transformers supports a model, the model is compatible with most training frameworks (Axolotl, Unsloth, DeepSpeed, FSDP) and inference engines (vLLM, SGLang, TGI) too.
That is why model cards usually show their example code with Transformers. The high-level pipeline API loads a model from the Hugging Face Hub and runs text, audio or vision tasks in a few lines. The project counts over a million Transformers-compatible checkpoints on the Hub. It needs Python 3.11 or newer and PyTorch 2.6 or newer.
It is the best choice for experiments, research and fine-tuning, and for checking how a new model is supposed to behave. For serving many users or running big models on modest hardware, its speed and memory use usually lose to specialized engines such as vLLM or llama.cpp.
Good for
- Trying a new model the day it is released, using the code on its model card
- Research, evaluation and fine-tuning in Python
- Anyone building on top of the Hugging Face ecosystem
Watch out for
- It is a Python library, not an app, so you need some programming comfort
- Plain Transformers inference is usually slower and uses more memory than dedicated serving engines
- Large models need a GPU setup that matches the memory table on the model page