continuity-bench
收藏资源简介:
ContinuityBench是由Metriqual研究团队创建的开源评估框架,旨在系统评估多提供商大语言模型路由中的状态保持故障转移能力。该数据集包含750个故障转移事件,通过自动化LLM判断机制生成多轮对话并嵌入可验证的事实锚点,以量化上下文保留率。其创建过程涉及可控的故障注入和高并发压力测试,模拟真实生产环境中的提供商中断场景。该数据集主要应用于分布式系统可靠性和对话连续性研究,旨在解决传统无状态故障转移机制中对话历史静默丢失的关键问题,为构建健壮的多模型推理系统提供基准。
ContinuityBench is an open-source evaluation framework created by the Metriqual research team, which aims to systematically evaluate the state-preserving failover capability in multi-provider large language model (LLM) routing. This dataset contains 750 failover events, where multi-turn dialogues are generated via automated LLM judgment mechanisms and embedded with verifiable factual anchors to quantify the context retention rate. Its creation process involves controllable fault injection and high-concurrency stress tests, simulating provider outage scenarios in real production environments. This dataset is mainly applied to the research of distributed system reliability and dialogue continuity, aiming to solve the key problem of silent loss of dialogue history in traditional stateless failover mechanisms, and provide a benchmark for building robust multi-model inference systems.
Continuity Bench 数据集总结
Continuity Bench 是一个用于评估 AI 网关和应用程序级故障转移策略在 LLM 提供商发生中断或降级时的弹性和延迟开销的框架。
核心动机
在生产环境中,LLM API 中断是不可避免的。标准缓解策略是部署路由网关,在主提供商中断时自动故障转移到备用提供商(例如,从 OpenAI 切换到 Anthropic)。然而,存在一个关键问题:备用提供商是否拥有对话的上下文?如果在第五轮对话中发生故障,一个简单的故障转移(仅将最终用户提示转发到备用提供商)将导致上下文完全丢失。为了保持连续性,网关必须转发整个对话历史,但这会引入 Token 膨胀和延迟开销。Continuity Bench 旨在精确测量这种权衡。
评估指标
- 连续性保持率 (CPR):故障转移事件中,备用提供商成功维持对话上下文并确认会话中先前建立的核心事实的百分比。
- 连续性延迟开销 (CLO):在故障转移事件期间,将完整上下文历史传输到备用提供商所产生的额外延迟,相对于主提供商的基准延迟进行测量。
使用方式
- 安装:克隆仓库
git clone https://github.com/your-username/continuity-bench.git并安装依赖pip install -r requirements.txt。 - 环境配置:在
.env文件中设置 API 密钥。 - 运行评估:使用脚本
./run_eval.sh(Linux/macOS) 或. un_evals.ps1(Windows) 运行自动化评估套件,该套件会启动代理、生成模拟流量、注入合成错误并使用 LLM 作为评判者进行评分。结果保存至results/phase2_summary.md和results/breakdown.md。
已知局限性
- 合成测试数据:依赖合成对话图,可能无法完全捕捉真实用户交互的复杂性。
- LLM 评判者评分:上下文保持性由 LLM 评判者(
gpt-4o)评估,存在非确定性和模型特定偏差的可能性。 - 仅文本模态:目前仅评估基于文本的对话连续性,不涵盖视觉、音频或多模态会话。
- 代理负载测试上限:内置的
ThreadingHTTPServer在高并发下可能拒绝连接或达到提供商 Token 限制,导致评估失败。
许可协议
MIT 许可证。

- 1ContinuityBench: A Benchmark and Systems Study of Stateful Failover in Multi-Provider LLM RoutingMetriqual · 2026年




