Transformers
Hugging Face's library of open model definitions.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkWhat it is
Transformers holds reference implementations of text, vision, audio, video and multimodal models, with a pipeline API for quick inference, generate for text generation and a Trainer for training on PyTorch. Training tools such as Axolotl and Unsloth and inference engines such as vLLM and SGLang reuse its model definitions, so a model supported here tends to work across that ecosystem. Checkpoints load straight from the Hugging Face Hub.
Best for
Python developers who want to load, test or fine-tune open models in code.
Skills it helps with
Learn Transformers by doing
- Fine-tune a small model with LoRA
Fine-tune a small open model with LoRA using TRL and PEFT, measure it on a held-out set before and after, and decide whether the gain is worth keeping.
Related tools
Hugging Face
Hub for models, datasets and Spaces, plus open-source ML libraries.
MLX LM
Runs and fine-tunes LLMs on Apple silicon with MLX.
Together AI
Cloud for running and fine-tuning open models, with serverless endpoints and GPUs.
LLM
CLI and Python library for prompting many models.
Modal
Serverless cloud for running Python on GPUs for inference, batch jobs and training.
Outlines
Python library for structured LLM outputs via constrained decoding.