LM Evaluation Harness
EleutherAI / lm-evaluation-harness
标准 LLM 评测框架,覆盖数百任务、few-shot、loglikelihood 与生成式指标,支持 HF、vLLM 和 API 后端。A standard LLM evaluation harness covering hundreds of tasks, few-shot settings, log-likelihood and generative metrics, with HF, vLLM and API backends.
为什么选Why choose it
- 论文里的 MMLU、HellaSwag、GSM8K 数字大多能用它复现,统一 prompt 与 metric 减少口径漂移。A shared harness makes scores comparable across models.
- 支持本地模型和 OpenAI 兼容端点,适合做同一套题跨模型对比。Task definitions and prompts are explicit and versioned.
- 任务配置可复现,适合把评测纳入模型发布流程。Supports local and API backends.
不适合Not for
需要 agent 多轮交互、工具调用或私有业务打分;harness 更偏静态基准。You need a business-specific evaluation that the public tasks do not cover.
只想知道“哪个模型更强”的消费者,单看总分容易误读。You cannot control prompt templates and scoring settings.
最小上手Minimum setup
- pip install lm-eval,确认模型后端依赖。Run one small task on a local model with a fixed few-shot count.
- 用一个小模型跑 mmlu 的 100 条子集,检查 few-shot 设置。Record the task version, prompt template and scoring script.
- 固定版本与 prompt,横向跑 2–3 个模型并保存原始样本结果。Re-run with a different backend and compare the delta.
依赖与成本Dependencies and cost
Python;模型后端(HF/vLLM/API);部分任务需要数据集下载。Check runtime, model weights and external service dependencies in the README.
许可与使用边界License and usage boundaries
代码 MIT;数据集与模型各自条款。Code is MIT; model weights, training data and generated content may have separate terms — check each before commercial use.
开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.
替代与相邻Alternatives and neighbors
- Inspect AI — 特定场景Niche,英国 AI 安全研究院的评测框架,适合做严谨、可复现的任务评测。An evaluation framework from the UK AI Safety Institute for rigorous, reproducible task evaluation.
- Ragas — 先试这个Start here,RAG 评测库:检索相关性、答案忠实度、上下文召回等指标。A RAG evaluation library covering retrieval relevance, answer faithfulness and context recall.
- Arize Phoenix — 生产可用Production,开源 LLM 追踪与评测平台,基于 OpenTelemetry,带可视化与数据集管理。Open-source LLM tracing and evaluation on OpenTelemetry, with visual exploration and dataset management.
下一步Next steps
- 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
- 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
- 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.
GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare