โš ๏ธ Heads up: this tool's official website appears to be unreachable right now. It may be offline, rebranded, or temporarily down.
Contrastors

Contrastors

โ˜… 3.6 ๐Ÿ”– 600 saves ๐Ÿ’ฐ Free GitHub

Contrastors is an open-source contrastive learning toolkit from Nomic AI for training and evaluating embedding models efficiently in PyTorch. It is the training framework behind the widely used Nomic Embed model family, covering text embeddings, image embeddings and multimodal retrieval models. The project is hosted on GitHub, where it has earned roughly 800 stars, and it remains in active use, with recent updates in 2025.

Overview

Good embeddings power search, RAG pipelines and recommendation systems, but training them contrastively at scale is fiddly: you need large batches, careful negative mining and memory-efficient attention. Contrastors packages the recipes Nomic uses in production, including Flash Attention for speed, GradCache for fitting large batch sizes into limited memory, and multi-GPU training support. It loads common Hugging Face model architectures such as Pythia/GPT-NeoX and BERT, supports masked language modeling pretraining, and can produce Matryoshka representations that let one model serve embeddings at several dimensions. Evaluation tooling is included so trained encoders can be benchmarked before deployment. For teams building retrieval systems, that means the same codebase takes a model from raw training data to a measured, deployable encoder.

Key Features

  • End-to-end training and evaluation of contrastive text, image and multimodal embedding models
  • Flash Attention integration for fast, memory-efficient training
  • GradCache support for large effective batch sizes on constrained hardware
  • Multi-GPU training and easy loading of Hugging Face architectures
  • Matryoshka representation learning for flexible embedding dimensions
  • The toolkit behind the production Nomic Embed model family

๐Ÿ’ณ Pricing

Contrastors is free and open source under the Apache License 2.0. There is no paid tier โ€” the same code used to train Nomic’s published embedding models is available to everyone.

Who Is It For

Contrastors is for ML engineers and researchers who need to train their own embedding models for semantic search, retrieval-augmented generation or multimodal retrieval rather than renting embeddings from an API.

๐Ÿš€ Visit Contrastors Official Site

๐Ÿšฉ Report an issue