AI product Open source

Contrastive Language Models (CLM)

CLM is an AI decision-making model and Python service that selects among candidate actions by embedding a state and each action separately, then scoring their alignment instead of generating a textual response. It is trained with bidirectional InfoNCE: matched state-action pairs are pulled together while incorrect or hard-negative actions are pushed apart. At deployment, cached state and action embeddings are scored with a projection head, enabling typed decisions such as binary judgments, choices, and ordered scores, as well as ranking candidate answers, tools, trajectories, or next moves.

View repository Mentioned in 2 videos ↓

Overview

The repository provides CLM-8B through a TypeSafe-compatible HTTP API and a local Python engine. It runs a Qwen3-8B pooling encoder through vLLM, exposes endpoints including `/v1/systemone` and `/v1/rank`, and includes a browser playground, embedding and action caches, checkpoint hot-reloading, and scripts for fine-tuning projection heads on typed decisions or agent trajectories. The reference head can run on CPU or GPU, while the encoder is served separately; states longer than 2,048 tokens are truncated by default unless the limits are raised together.

The project is released under the Apache 2.0 License, and the repository's CLM-8B weights are also released under Apache 2.0 on Hugging Face.

What Contrastive Language Models (CLM) is used for

2 uses taken from transcripts — each links to the moment in the video.

  • A contrastive language model that makes agent decisions by matching embeddings rather than generating text. It encodes state and candidate actions separately, then selects the best-matching action.

  • An open 8B contrastive language model for making fast, generalizable decisions. It scores candidate actions against a state and returns answer distributions through a TypeSafe-compatible API without generating answer text.

Videos mentioning Contrastive Language Models (CLM)

2 in the library.