← All projects
Developer building blocks

x-transformers

A compact Python library for building transformer AI models, with many experimental ideas from research papers.

New this week

What it does

x-transformers is a code library for building transformers, the type of AI model behind most modern chatbots and image tools.

It can build GPT-style text generators, BERT-style text readers, image classifiers and models that describe pictures in words. Many optional features from recent research papers can be switched on with a setting.

Who it's for

AI researchers and developers who want to build and experiment with transformer models in PyTorch.

Can I use it without coding?

Developers only. It is a Python library for people who write AI code. New to this? Start here.

Can I run it?

Cost
FreeNothing to pay or sign up for.
Computer
Works best on a powerful computer or one with a graphics card (GPU)
Privacy
Runs on your own device: your data stays with you
API key
Not needed

Try it

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • License (MIT): Very permissive: free to use, change and share, including for business.
  • More on staying safe

Where people are talking about it