← AI solutions

Open source · ★ 167,694 GitHub stars (as of 2026-10-14)

transformers

Transformers is a Hugging Face library for inference and training of text, image and speech models.

Overview

Transformers is Hugging Face's open-source library for defining text, computer vision, audio, video and multimodal models and using them for inference and training. Its goal is to centralize model definitions so that the models it supports are also compatible across many training frameworks and inference engines.

Every model is implemented with three classes: configuration, model and preprocessor. It provides Pipeline for simple inference across many tasks, Trainer with support for mixed precision, torch.compile, FlashAttention and distributed training, and generate with support for streaming and multiple decoding strategies.

It suits developers, machine learning engineers and researchers who want to load pretrained models from the Hugging Face Hub and use them directly or fine-tune them.

What it is used for

Pricing and license

Apache-2.0

Getting started

  1. Install the Transformers library in a Python environment.
  2. Find the model you want on the Hugging Face Hub.
  3. Load the model with Pipeline and run inference.
  4. If needed, fine-tune with Trainer.

Links

Related terms and companies

Recent mentions in briefings

Sources

Compiled from public sources (official pages, READMEs). Pricing and features change, so check the official site.