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.
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
Clone & open
bashgit clone https://github.com/huggingface/transformers.git cd transformers claudeLet Claude read it
Ask “/init” to generate a CLAUDE.md, then have Claude explain, run, or extend the codebase. It reads files on demand.
How to install transformers in Claude DesktopDesktop app (MCP config)
Clone the repository
bashgit clone https://github.com/huggingface/transformers.gitOpen in your AI editor
Open the folder in your assistant and ask it to index the codebase, then reference files in chat.
How to install transformers in CursorAI-first code editor
Clone & open in Cursor
bashgit clone https://github.com/huggingface/transformers.gitIndex & chat
Open the folder — Cursor indexes it automatically. Use @Codebase in chat to ask about it or scaffold from it.
How to install transformers in Codex CLIOpenAI coding agent
Clone
bashgit clone https://github.com/huggingface/transformers.gitPoint Codex at it
Run codex in the repo root; add setup notes to AGENTS.md so the agent knows how to build & test.
How to install transformers in WindsurfCodeium's agentic IDE
Clone & open
bashgit clone https://github.com/huggingface/transformers.gitUse Cascade
Windsurf indexes the workspace; ask Cascade to explain or reuse modules from the repo.
How to install transformers in ClineVS Code autonomous agent
Clone the repository
bashgit clone https://github.com/huggingface/transformers.gitOpen in your AI editor
Open the folder in your assistant and ask it to index the codebase, then reference files in chat.
How to install transformers in VS CodeCopilot / MCP support
Clone the repository
bashgit clone https://github.com/huggingface/transformers.gitOpen in your AI editor
Open the folder in your assistant and ask it to index the codebase, then reference files in chat.
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.
# venv
python -m venv .my-env
source .my-env/bin/activate
# uv
uv venv .my-env
source .my-env/bin/activateInstall Transformers in your virtual environment.
# 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
- LLM Frameworks188k
AutoGPT
AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
PythonSignificant-Gravitas/AutoGPT
- LLM Frameworks185k
ollama
Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
GoMITollama/ollama
- LLM Frameworks175k
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
HTMLf/prompts.chat
- LLM Frameworks136k
MoneyPrinterTurbo
利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
PythonMITharry0703/MoneyPrinterTurbo
- LLM Frameworks118k
TradingAgents
TradingAgents: Multi-Agents LLM Financial Trading Framework
PythonApache-2.0TauricResearch/TradingAgents
- LLM Frameworks116k
caveman
🪨 why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
GoApache-2.0JuliusBrussee/caveman
Catalog data refreshed . Something wrong? Report it.