ToolsCompaniesAbout

Transformers

by Hugging Face@huggingfaceUnited States and FranceNo ratings yet

Open-source Python library defining state-of-the-art ML models for inference and training

Visit huggingface.co
Tool type
Python ML model library
Made for
Developers, ML engineers, researchers
Runs on
Local Python with PyTorch
Tested on Python 3.11+ and PyTorch 2.6+; CUDA, CPU and Intel XPU install options
Last checked
28 Oct 2026
4 product sources

What it does

Transformers is a Python library from Hugging Face that defines machine learning models for text, computer vision, audio, video and multimodal tasks. You load a pretrained checkpoint from the Hugging Face Hub, which hosts over a million of them, and the library handles configuration, model code and preprocessing. Output depends on the task: generated text, sentiment labels, image segmentations, speech transcripts or document answers, or a fine-tuned model you trained yourself.

In practice, developers call the Pipeline class for quick inference, use generate for text generation with LLMs and vision language models, or use Trainer for PyTorch training with mixed precision, torch.compile, FlashAttention and distributed training. Its distinguishing role is as a shared model definition: the docs say supported models are compatible with most training frameworks, inference engines such as vLLM, SGLang and TGI, and libraries like llama.cpp and mlx.

It suits developers, machine learning engineers and researchers comfortable with Python. The docs state it has been tested on Python 3.11+ and PyTorch 2.6+, and it installs with uv, pip or conda. Models are downloaded from the Hub and cached locally, with an offline mode available. Limitations: it targets PyTorch, expects coding skills, and needs suitable hardware such as an NVIDIA GPU for heavier models. Installing from source may be less stable than releases.

What it can do

  • Pipeline class for inference across tasks such as text generation, image segmentation, speech recognition and document question answering
  • Trainer for PyTorch training with mixed precision, torch.compile, FlashAttention and distributed training
  • Generate method for LLM and vision language model text generation with streaming and multiple decoding strategies
  • Loads pretrained checkpoints from the Hugging Face Hub with local caching
  • Offline mode for firewalled environments using pre-downloaded model files

Works with

  • Axolotl
  • Unsloth
  • DeepSpeed
  • FSDP
  • PyTorch-Lightning
  • vLLM
  • SGLang
  • TGI
  • llama.cpp
  • mlx

Example workflows

Classify text with a pretrained model
Input: a sentence. Steps: create a virtual environment, install transformers[torch], run a sentiment-analysis pipeline. Output: a label and score for the text.
Prepare a model for offline use
Input: a Hub repository ID. Steps: download it with snapshot_download, set HF_HUB_OFFLINE=1, load with from_pretrained. Output: a model loaded from the local cache without Hub calls.

Before you choose

  • Documentation states support for PyTorch; other frameworks are not mentioned as supported
  • Installing from source gives the latest changes but may be less stable than the released version
  • Model downloads are cached locally (default ~/.cache/huggingface/hub), so plan disk space and cache location

Listed under

Get started

Follow the installation guide

  1. Create a virtual environment, for example with uv venv
  2. Install with uv pip install "transformers[torch]" or conda install conda-forge::transformers
  3. Run the sentiment-analysis pipeline one-liner to confirm the install works
Install with uv, pip or conda

Plans and prices

The source code is available under Apache 2.0. You supply compute; model licenses and optional hosting have their own terms.

Open-source softwareFreeCode only; excludes infrastructure and external services
  • Apache 2.0 license

Source: github.com/huggingface/transformers, checked 28 Oct 2026. Prices can change; check before you buy.

Sources for this overview

Product pages, documentation, and pricing checked 28 Oct 2026. Each source supports part of the overview; availability and prices can change.

Ratings and reviews

No ratings for Transformers yet.

Be the first to rate it

What’s changed

Free account

See what’s changed at Transformers

Launches, price moves and pivots, each with a date and a source. Free with an account.

Signals

Free account

See Transformers’s signals

Launch traction, hiring and release activity, tracked over time. Free with an account.

Data and security

Free account

See how Transformers handles your data

Training on your files, compliance, hosting and the models behind it. Free with an account.

Compare with similar tools

Free account

Compare Transformers side by side

Prices, platforms and features against similar tools, with sources. Free with an account.

Where this comes from

How we research
Company website
huggingface.co: product, pricing and policy pages
YC directory mirror
Batch and company name
Web search
Confirms the official site
Social accounts
Accounts the company links, and its posts on X
Human review
Checked by a person
knowledge_base

Last checked 28 Oct 2026. Every field keeps its source and date; unknown means we couldn’t confirm it.