返回顶部
a

api-quality-checkAPI质量检测

Check coding-model API quality, capability fit, and drift with LT-lite and B3IT-lite. Use when Codex needs to verify whether an OpenAI/OpenAI-compatible/Anthropic endpoint can support first-token detection, logprob tracking, baseline-vs-current drift checks, or headless API quality smoke tests for coding CLIs, terminal agents, and OpenClaw-style workflows.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
97
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

api-quality-check

API 质量检查

使用捆绑脚本运行无头API质量检查。将此技能视为脚本优先:除非脚本明显不足,否则不要内联重新创建LT-lite/B3IT-lite逻辑。

供应商名称如Ark/火山引擎、GLM、DeepSeek、Kimi、SiliconFlow及类似服务仅为示例。主要决策在于端点协议类型:OpenAI、OpenAI兼容或Anthropic。

快速开始

一次性设置路径:

bash
export CODEXHOME=${CODEXHOME:-$HOME/.codex}
export APIQ=$CODEXHOME/skills/api-quality-check/scripts/apiquality_check.py
export APIQBATCH=$CODEXHOME/skills/api-quality-check/scripts/runbatchchecks.sh
export APIQDAILY=$CODEXHOME/skills/api-quality-check/scripts/rundailycheck.sh

首先运行能力冒烟测试:

bash
python $APIQ smoke \
--provider OpenAI兼容 \
--base-url https://ark.cn-beijing.volces.com/api/coding/v3 \
--api-key $API_KEY \
--model-id ark-code-latest \
--html-output ./smoke.html

对于许多OpenAI兼容的端点,如果用户粘贴完整的.../chat/completions URL,同样的命令也适用。脚本会自动将其规范化为API根路径。

如果您想要一个立即可用的provider.json,请使用以下命令生成:

bash
python $APIQ init-config \
--provider OpenAI兼容 \
--base-url https://api.siliconflow.cn/v1/chat/completions \
--api-key $API_KEY \
--model-id deepseek-ai/DeepSeek-V3.2 \
--name siliconflow-v3-2 \
--config-output ./provider.json

如果端点需要特定客户端的标头,请将其作为headers对象放入配置JSON中,或使用--headers-json传递。对于Kimi编码端点,仅在地址位于https://api.kimi.com/coding下时使用{User-Agent:KimiCLI/2.0.0};对于OpenAI兼容的Kimi路径,请使用https://api.kimi.com/coding/v1。

如果您已有多个原始端点条目,请使用以下命令将其规范化为providers.json:

bash
python $APIQ init-batch-config \
--configs ./raw-providers.json \
--config-output ./providers.json

或者运行完整的批处理流水线:

bash
$APIQ_BATCH ./providers.json ./api-quality-out

该命令还会创建./api-quality-out/index.html作为所有生成报告的登录页面。

对于需要每天检查并按日期归档的单个端点:

bash
bash $APIQ_DAILY ./provider.json ./daily-out my-endpoint

工作流程

  1. 1. 在任何基线或检测运行之前先运行smoke。
  2. 如果您有多个端点,在选择哪些端点值得进行更深入的LT/B3IT工作之前,先使用配置列表运行batch-smoke。
  3. 读取结果:
- b3itsupported=true:端点在maxtokens=1时可以返回正常的首个token文本 - lt_supported=true:端点还返回logprobs,因此可以运行LT-lite - recommended_detector:脚本直接推荐的下一步操作
  1. 4. 如果lt_supported=false,不要强制使用LT-lite;转而使用B3IT-lite或报告LT不可用。
  2. 将基线保存到显式的JSON文件中,并在后续检测中重复使用。
  3. 保持输出基于文件,适用于编码CLI和OpenClaw。不要依赖GUI状态。
  4. 对于噪声较大的端点,在手动收紧或放宽阈值之前,优先使用内置的B3IT默认值。

端点类型

  • - OpenAI:用于官方OpenAI风格的端点。
  • OpenAI兼容:用于遵循OpenAI请求和响应形状的第三方端点;可能需要特定供应商的标头。
  • Anthropic:用于/v1/messages风格的端点;在此技能中为仅B3IT。

命令

能力冒烟测试

bash
python $APIQ smoke --config ./provider.json --output ./smoke.json

生成供应商配置模板

bash
python $APIQ init-config \
--provider OpenAI兼容 \
--base-url https://api.siliconflow.cn/v1/chat/completions \
--api-key $API_KEY \
--model-id deepseek-ai/DeepSeek-V3.2 \
--config-output ./provider.json

生成批处理providers.json模板

bash
python $APIQ init-batch-config \
--configs ./raw-providers.json \
--config-output ./providers.json

批处理能力冒烟测试

bash
python $APIQ batch-smoke --configs ./providers.json --output ./batch-smoke.json --html-output ./batch-smoke.html

批处理LT-lite基线

bash
python $APIQ batch-lt-baseline \
--configs ./providers.json \
--output-dir ./lt-baselines \
--output ./batch-lt-baselines.json \
--html-output ./batch-lt-baselines.html

批处理LT-lite检测

bash
python $APIQ batch-lt-detect \
--configs ./providers.json \
--baseline-manifest ./batch-lt-baselines.json \
--output ./batch-lt-report.json \
--html-output ./batch-lt-report.html

批处理B3IT-lite基线

bash
python $APIQ batch-b3it-baseline \
--configs ./providers.json \
--output-dir ./b3it-baselines \
--output ./batch-b3it-baselines.json \
--html-output ./batch-b3it-baselines.html

批处理B3IT-lite检测

bash
python $APIQ batch-b3it-detect \
--configs ./providers.json \
--baseline-manifest ./batch-b3it-baselines.json \
--output ./batch-b3it-report.json \
--html-output ./batch-b3it-report.html \
--detection-repeats 5 \
--min-stable-count 2 \
--min-stable-ratio 0.35 \
--confirm-passes 1

LT-lite基线

bash
python $APIQ lt-baseline --config ./provider.json --output ./lt-baseline.json

LT-lite检测

bash
python $APIQ lt-detect \
--config ./provider.json \
--baseline ./lt-baseline.json \
--output ./lt-report.json

B3IT-lite基线

bash
python $APIQ b3it-baseline --config ./provider.json --output ./b3it-baseline.json

B3IT-lite检测

bash
python $APIQ b3it-detect \
--config ./provider.json \
--baseline ./b3it-baseline.json \
--output ./b3it-report.json \
--detection-repeats 5 \
--min-stable-count 2 \
--min-stable-ratio 0.35 \
--confirm-passes 1

每日单端点漂移运行

bash
bash $APIQ_DAILY ./provider.json ./daily-out my-endpoint

默认值和防护措施

  • - 默认为非流式、timeout=60,温度值与检测器匹配。
  • 每个命令都可以额外使用--html-output写入人类可读的报告。
  • OpenAI/OpenAI兼容的请求可能包含自定义JSON headers,来自配置文件或--headers-json。
  • Kimi特定的{User-Agent:KimiCLI/2.0.0}标头不是通用默认值。仅用于https://api.kimi.com/coding端点;对于OpenAI兼容的Kimi路径,请使用https://api.kimi.com/coding/v1。
  • 脚本会自动禁用常见推理优先供应商(如Ark、豆包、GLM和智谱)的思考功能,除非在配置JSON中显式提供了extrabody。
  • 对于仍返回reasoningcontent但没有正常文本的OpenAI/OpenAI兼容端点,脚本将在失败前使用{thinking:{type:disabled}}重试一次。
  • OpenAI/OpenAI兼容的配置可以使用API根路径或完整的.../chat/completions URL;脚本会在内部规范化base URL。
  • init-config会显式写入规范化后的配置,包括任何自动选择的extra_body,因此保存的文件

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 api-quality-check-1776059178 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 api-quality-check-1776059178 技能

通过命令行安装

skillhub install api-quality-check-1776059178

下载

⬇ 下载 api-quality-check v1.0.0(免费)

文件大小: 34.99 KB | 发布时间: 2026-4-14 13:45

v1.0.0 最新 2026-4-14 13:45
Initial release of API Quality Check skill for verifying coding-model API fitness and drift detection.

- Provides scripts for headless API quality checks, supporting first-token detection, logprob tracking, and baseline-vs-current drift.
- Supports OpenAI, OpenAI-compatible, and Anthropic API endpoint types, with clear configuration instructions.
- Includes smoke tests, LT-lite/B3IT-lite baseline and detect checks, batch and daily workflows, and HTML reporting.
- Normalizes endpoint URLs and supports custom headers per endpoint.
- Offers config generation helpers and guides for best practices and troubleshooting.
- Designed for use in coding CLIs and agent workflows; outputs are file-based, not GUI-dependent.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部