All Repos
LLM FrameworksPythonApache-2.0

transformers

huggingface/transformers · Updated

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

huggingface/transformers is a Python repository in the LLM Frameworks category with 168,269 stars and 35,015 forks on GitHub, released under the Apache-2.0 license, last updated today.

#audio#deep-learning#deepseek#gemma#glm#hacktoberfest#llm#machine-learning
View on GitHub 168kGitHub stars

How to install transformers in your AI client

Setup for Claude Code, Claude Desktop, Cursor, Codex, Windsurf, Cline and VS Code — copy-paste ready.

How to install transformers in Claude CodeAnthropic's agentic CLI

  1. Clone & open

    bash
    git clone https://github.com/huggingface/transformers.git
    cd transformers
    claude
  2. Let Claude read it

    Ask “/init” to generate a CLAUDE.md, then have Claude explain, run, or extend the codebase. It reads files on demand.

Documentation

Full README

<b>English</b> | 简体中文 | 繁體中文 | 한국어 | Español | 日本語 | हिन्दी | मराठी | Русский | Português | తెలుగు | Français | Deutsch | Italiano | Tiếng Việt | العربية | اردو | বাংলা | فارسی | Română | Türkçe

State-of-the-art pretrained models for inference and training

Transformers acts as the model-definition framework for state-of-the-art machine learning with text, computer vision, audio, video, and multimodal models, for both inference and training.

It centralizes the model definition so that this definition is agreed upon across the ecosystem. transformers is the pivot across frameworks: if a model definition is supported, it will be compatible with the majority of training frameworks (Axolotl, Unsloth, DeepSpeed, FSDP, PyTorch-Lightning, ...), inference engines (vLLM, SGLang, TGI, ...), and adjacent modeling libraries (llama.cpp, mlx, ...) which leverage the model definition from transformers.

We pledge to help support new state-of-the-art models and democratize their usage by having their model definition be simple, customizable, and efficient.

There are over 1M+ Transformers model checkpoints on the Hugging Face Hub you can use.

Explore the Hub today to find a model and use Transformers to help you get started right away.

Installation

Transformers works with Python 3.11+, and PyTorch 2.6+.

Create and activate a virtual environment with venv or uv, a fast Rust-based Python package and project manager.

py
# venv
python -m venv .my-env
source .my-env/bin/activate
# uv
uv venv .my-env
source .my-env/bin/activate

Install Transformers in your virtual environment.

py
# pip
pip install "transformers[torch]"

# uv
uv pip install "transformers[torch]"

Install Transformers from source if you want the latest changes in the library or are interested in contributing. However, the *latest* version may not be stable. Feel free to open an issue if you encounter an error.

Excerpt — the full document is on GitHub.

More LLM Frameworks repositories

Catalog data refreshed . Something wrong? Report it.