CreateWithAIHub

Library Hugging Face

Transformers

Hugging Face's Python library of pretrained model definitions for text, vision, audio and multimodal inference and training.

Model libraryFreeOpen source
Visit website ↗
Save

What it is

Transformers is Hugging Face's model-definition framework for state-of-the-art models in text, vision, audio, video and multimodal tasks, used for both inference and training with PyTorch. Its model definitions are shared across the ecosystem, so supported models also work with many training frameworks and inference engines. It gives access to a very large number of pretrained checkpoints on the Hugging Face Hub.

What it's useful for

Loading and running a pretrained model in a few lines of Python, fine-tuning a model on your own data, or prototyping before moving to a dedicated inference engine.

Key features

  • Pipeline API for inference across many tasks
  • Trainer with mixed precision, torch.compile, FlashAttention and distributed training
  • generate() for LLM and VLM text generation with streaming
  • Large catalog of pretrained checkpoints on the Hugging Face Hub
  • Model definitions compatible with vLLM, SGLang, llama.cpp, MLX and others

How to use it

Before you start

  • Python 3.11+
  • PyTorch 2.6+
pip
pip install "transformers[torch]"
uv
uv pip install "transformers[torch]"

Commands are copied from the official documentation. Check the docs for the latest version before running them.

Limitations to know

  • Not designed as a modular toolbox of neural-network building blocks
  • Trainer is optimized for Transformers' PyTorch models, not generic training loops

MCP servers for this

MCP reference server that gives an AI client controlled read/write access to chosen local directories.

FreeOpen source

Open-source MCP server that gives coding agents simplified Figma layout and styling data to implement designs.

Free plan + paidOpen source

Community MCP server and Blender addon that let an AI agent model, light and render scenes in a running Blender.

Free plan + paidOpen source

Skills for this

Anthropic skill for generative art in p5.js with seeded randomness and an interactive viewer for exploring parameters.

FreeOpen source

Hugging Face's Agent Skills for the Hub CLI, datasets, model training, evaluation, Spaces and SageMaker deployment.

FreeOpen source

Related resources

Free desktop app for downloading and running LLMs locally, with chat, document RAG and an OpenAI-compatible local server.

Free

Meta's family of downloadable open-weight language models, including the multimodal mixture-of-experts Llama 4.

Free

Open-source Python library for building AI agents that browse and act on websites, with an optional hosted cloud.

FreeOpen source

Anthropic's family of proprietary large language models (Opus, Sonnet, Haiku tiers) for reasoning, coding and agents.

Paid

Type to search. Use ↑ ↓ and Enter.