huggingface/transformers
Hugging Face Transformers serves as a central model-definition framework for state-of-the-art machine learning, supporting inference and model training across text, computer vision, audio, video, and multimodal modalities. By establishing standardized architectural representations, the library acts as an ecosystem bridge connecting model checkpoints on the Hugging Face Hub with training frameworks such as Axolotl, Unsloth, DeepSpeed, FSDP, and PyTorch-Lightning, as well as specialized inference runtimes like vLLM, SGLang, TGI, llama.cpp, and mlx. Developers interact with pretrained architectures through high-level abstractions like the Pipeline API for tasks ranging from speech recognition to visual question answering, or initiate terminal-based model conversations using the transformers chat command backed by transformers serve.
The software is built for machine learning researchers, data scientists, and deployment engineers. The installation documentation reports testing with Python 3.11 or greater and PyTorch 2.6 or higher within virtual environments managed via standard venv or uv. Standard installation is performed by running pip install "transformers[torch]" or uv pip install "transformers[torch]". For bleeding-edge source builds, users can clone the repository with git clone https://github.com/huggingface/transformers.git, navigate into the directory, and execute pip install '.[torch]' or uv pip install '.[torch]'. The repository is officially distributed under the Apache-2.0 license. For a model-inference comparison, see llama.cpp; its scope differs from the training and inference library Transformers.
Data as of : 168473 stars · 35093 forks.