FA
Open SourceToolkitby Meta AI (FAIR)

Fairseq

fairseq is Meta's open-source sequence-modeling toolkit. A flexible PyTorch research framework, it powers training and inference for translation, language modeling, speech and many models — including the influential wav2vec.

fairseqmachine-translationmeta-ainlpopen-source-aiseq2seq
Quick facts
LicenseMIT
TypeSequence Toolkit
FrameworkPyTorch
ByMeta AI
No ratings yet — be the first
Type
Seq modeling
toolkit
Framework
PyTorch
research
License
MIT
open source
By
Meta AI
FAIR

What is fairseq?

fairseq is Meta AI's open-source sequence-modeling toolkit, a flexible PyTorch research framework for training and running models that map sequences to sequences. It is not a single model but a library and platform used to build, train and evaluate a wide range of models across machine translation, language modeling, summarisation, and speech. Many influential models came out of fairseq — including wav2vec 2.0 for speech, and large translation and language models — making it a foundational tool in NLP and speech research.

What it provides

fairseq bundles the building blocks of sequence modeling: implementations of architectures (transformers, convolutional seq2seq, LSTMs and more), efficient distributed and mixed-precision training, flexible data pipelines, and tooling for inference, beam search and evaluation. Its modular design lets researchers swap components, register new models and tasks, and run large-scale experiments. It also ships many pretrained models (translation, language models, wav2vec and speech models) you can use directly.

What it is good at

fairseq excels at research and custom training of sequence models: building neural machine-translation systems, training language models, developing speech-recognition and speech-to-text models (it is the home of wav2vec), and experimenting with new architectures. Its efficient, scalable training makes it well suited to large experiments on multi-GPU clusters, while its pretrained models let you get started on translation or speech without training from scratch.

Licensing & access

fairseq is open source under the MIT licence, available on GitHub and installable via pip, built on PyTorch. It runs on a single GPU for inference and smaller jobs, and scales to multi-GPU and multi-node for large training runs. Its pretrained models are freely available, and the codebase integrates with the broader PyTorch ecosystem, so it fits naturally into research and production NLP/speech pipelines.

Practical considerations

fairseq is a research toolkit, not a turnkey product: it is capable and flexible but has a learning curve, and you write code and configs to use it. It is actively used but evolving (Meta has also developed newer frameworks), so check current docs and model availability. For serving optimised inference you may pair it with other tools, and for some tasks the Hugging Face ecosystem offers a simpler path — but for custom sequence-model research, fairseq remains a capable, proven framework.

How it compares

fairseq is a training/research framework, distinct from a serving tool like FastChat (which serves and evaluates chat models) or a single model like T5. Compared with the Hugging Face ecosystem, fairseq offers deep flexibility for custom architectures and large-scale training, and is the origin of models like wav2vec; Hugging Face is often easier for using pretrained models. For advanced sequence-modeling research and custom training, fairseq is a capable, proven choice.

Getting started

Install fairseq from pip or GitHub, then either use a pretrained model (e.g. a translation or wav2vec model) for inference, or set up a task and config to train your own on your data. Start from the provided examples and recipes, run on a GPU (scale to multi-GPU for big jobs), and consult the docs for the specific model or task. For straightforward use of pretrained models, the Hugging Face ports can be a simpler alternative.

Capabilities

🧱
Many architectures
Implements transformers, conv seq2seq, LSTMs and more for sequence tasks.
Scalable training
Efficient distributed and mixed-precision training for large experiments.
🎤
Speech & translation
Powers wav2vec, NMT and language models out of one framework.
🧩
Modular & extensible
Register custom models, tasks and criteria for research.

Pros & Cons

Pros6
  • Flexible PyTorch sequence-modeling toolkit
  • Covers translation, LM, speech and more
  • Efficient distributed, mixed-precision training
  • Home of wav2vec and many models
  • Many pretrained models included
  • Open source (MIT)
Cons4
  • A research toolkit, not a turnkey product
  • Learning curve; you write code/configs
  • Evolving — check current docs/models
  • Hugging Face can be simpler for pretrained use

Inspiration

Fairseq use cases & project ideas

Translation

Train NMT systems.

Language modeling

Train and evaluate LMs.

Speech models

Develop ASR (wav2vec).

Architecture research

Experiment with new models.

FAQ

Frequently asked questions

No. It is Meta's open-source PyTorch toolkit for training and running sequence models across translation, LM and speech.

More to explore

You might also like

01
W2
wav2vec 2.0
95M (base) – 1B (MMS · MIT