π€ Transformers
Hugging Face Transformers is the model-definition framework for state-of-the-art text, vision, audio, video and multimodal models β for both inference and training.
Adapted for this playbook from the π€ Transformers documentation by Hugging Face. Official page: https://huggingface.co/docs/transformers/index. Images Β© Hugging Face (
documentation-images) unless noted. This is not a substitute for the upstream docs β verify against the current version.

Source: Hugging Face Transformers documentation (transformers_as_a_model_definition.png).
Why Transformers mattersβ
Hugging Face positions transformers as the pivot across the ecosystem: if a model definition is supported here, it is compatible with most training stacks (Axolotl, Unsloth, DeepSpeed, FSDP, β¦), inference engines (vLLM, SGLang, TGI, β¦) and adjacent libraries (llama.cpp, MLX, β¦).
There are 1M+ Transformers model checkpoints on the Hub.

Source: Hugging Face Transformers documentation.
Design principles (summary)β
- Fast and easy to use β each model is configuration + model + preprocessor; use Pipeline or Trainer quickly.
- Pretrained models β reuse checkpoints instead of training from scratch; reduce carbon, cost and time.
- Three core classes β configuration, model, preprocessor (
from_pretrained/save_pretrained/push_to_hub).
See Philosophy for the full tenets.
How this playbook maps to Hugging Face docsβ
| Playbook section | Hugging Face docs area | Start here |
|---|---|---|
| Get started | Installation, Quickstart, Philosophy | Installation |
| Base classes | Models, Preprocessors | Loading models |
| Inference | Pipeline, Generate, Optimisation, Chat, Serving | Pipeline |
| Training | Trainer, PEFT, distributed, hardware | Trainer |
| Quantization | Quantization guides | Concepts |
| Ecosystem | Community integrations | Inference engines |
| Tasks | Task how-tos | NLP tasks |
| Resources | Glossary, timeline, troubleshooting | Glossary |
| Flagship models | Selected model_doc deep dives | BERT |
| API map | Main classes + full model API on HF | API map |
Credit policyβ
Every page in this section:
- Credits Hugging Face and links to the official Transformers doc URL
- Hosts selected diagrams from Hugging Face
documentation-imageswith figure captions - Rewrites content for playbook clarity (British spelling, enterprise notes) rather than mirroring API reference dumps
- Does not replace the upstream docs β always verify against huggingface.co/docs/transformers

Source: Hugging Face brand assets.
Learning pathβ
- Installation β Quickstart β Philosophy
- Pipeline for fast inference; Loading models when you need control
- Text generation and Chat for LLMs
- Fine-tuning + PEFT for adaptation
- Quantization and Serving for production
Discussion
Commentsβ
Share feedback or questions about this page. No account required.
Loading commentsβ¦