跳到正文

正在自动登录…

← 返回项目列表

Contrastive-LM/CLM

模型服务接入

Contrastive Language Models (CLMs) 是一类通过对比学习目标连接状态和动作的 System One 模型,本仓库提供 CLM-8B 模型,并通过 TypeSafe 兼容 API 提供服务。

AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/14 18:41:04 · 查看原文

值得看Python应用与服务
累计 Stars
3,101
当前热度
7~30 天 · 热门
仓库创建时间
打开 GitHub ↗

选用指南

AI 根据 README 整理 · 2026/10/14 18:41:04

使用方式

通过 pip 安装后,使用命令行启动服务,并通过 Python 客户端或 HTTP API 进行调用。

查看 README 依据
We invite the community to plug it into their own agents and benchmarks! --- ## Installation ```bash pip install contrastive-lm ``` To install the latest from a clone: ```bash pip install -e . ``` --- ## Quickstart ### Serve ```bash # 1. encoder (Qwen3-8B embeddings) vllm serve Qwen/Qwen3-8B --served-model-name qwen3-8b --runner pooling --max-model-len 2048 --port 8090 & # 2. CLM API on :8700 (downloads the 75 MB reference head on first run) clm-serve ``` States longer than 2048 tokens are truncated. For longer states, raise both limits
together, e.g. `--max-model-len 8192` on `vllm serve` and `clm-serve --max-tokens 8192` (needs more GPU memory). ### Ask typed questions about a state ```python from clm import CLMClient, Choice, Noul, Score client = CLMClient() # CLM_BASE_URL (default http://127.0.0.1:8700), CLM_API_KEY r = client.system_one( state="Customer: my invoice was charged twice and nobody answers the phone!", questions={ "urgency": Noul(instructions="Is this urgent?"), "department": Choice(instructions="Which team should handle this?",
部署要求

需要 GPU 运行 vLLM 编码器(如 Qwen3-8B),并安装相关依赖。

查看 README 依据
We invite the community to plug it into their own agents and benchmarks! --- ## Installation ```bash pip install contrastive-lm ``` To install the latest from a clone: ```bash pip install -e . ``` --- ## Quickstart ### Serve ```bash # 1. encoder (Qwen3-8B embeddings) vllm serve Qwen/Qwen3-8B --served-model-name qwen3-8b --runner pooling --max-model-len 2048 --port 8090 & # 2. CLM API on :8700 (downloads the 75 MB reference head on first run) clm-serve ``` States longer than 2048 tokens are truncated. For longer states, raise both limits
├── evaluation/bon_eval.py # unified best-of-N evaluation ├── preprocessing/hf_embeddings.py # embedding dir <-> Hugging Face dataset ├── requirements.txt # pip install -r requirements.txt (clm + torch + vLLM + example deps) ├── examples/ # CLM vs Jev on the T-Rex runner (examples/t_rex/README.md) │ ├── common.py # one client for both endpoints: retries, latency, cache │ └── t_rex/ # Chrome dinosaur game in real time (run.py --model clm|jev) └── docs/FINETUNING.md # the fine-tuning guide ```
已知限制

状态超过 2048 tokens 会被截断,需提高限制并占用更多 GPU 内存。

查看 README 依据
We invite the community to plug it into their own agents and benchmarks! --- ## Installation ```bash pip install contrastive-lm ``` To install the latest from a clone: ```bash pip install -e . ``` --- ## Quickstart ### Serve ```bash # 1. encoder (Qwen3-8B embeddings) vllm serve Qwen/Qwen3-8B --served-model-name qwen3-8b --runner pooling --max-model-len 2048 --port 8090 & # 2. CLM API on :8700 (downloads the 75 MB reference head on first run) clm-serve ``` States longer than 2048 tokens are truncated. For longer states, raise both limits
together, e.g. `--max-model-len 8192` on `vllm serve` and `clm-serve --max-tokens 8192` (needs more GPU memory). ### Ask typed questions about a state ```python from clm import CLMClient, Choice, Noul, Score client = CLMClient() # CLM_BASE_URL (default http://127.0.0.1:8700), CLM_API_KEY r = client.system_one( state="Customer: my invoice was charged twice and nobody answers the phone!", questions={ "urgency": Noul(instructions="Is this urgent?"), "department": Choice(instructions="Which team should handle this?",

README

正在加载 README…

收录信息

仓库创建时间
2026/9/24 03:29:56
首次达标收录
2026/10/9 11:44:24
统计更新时间
2026/10/22 19:20:31

按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。

模型评估

值得看加权总分 3.9 / 5

新颖度
4.0
实用价值
4.2
成熟度
4.2
实质含量
3.5

由 Jev 模型根据仓库描述与 README 评估,2026/10/10 13:53:52 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。

仓库信息

最近推送
2026/10/6 05:13:17
许可证标识
Apache-2.0
Fork 数
268
当前状态
未归档

收录记录

按创建时长与累计 Stars 首次收录:小火
首次发现项目