Skip to main content
PyPI 版本 测试状态 项目文档

ChatLabel

ChatLabel 是一个任务中立、可审计的结构化标注运行器。任务 manifest 定义输入字段、允许标签、适配器和完成闸门;首个内置任务用于完成印尼线路产品工作簿的解析、模型建议、人工校对、校验和 Excel 导出闭环。

0.2 开发线优先完善分类内核:从人工确认表构建可追溯 ground truth、提取 WPS 图片证据、通过 gpt-5.6-sol / xhigh 调用流式 Responses API,并运行无产品组泄漏的交叉验证和固定留出验收。

自动输出是建议结果。完成图片逐项复核、高风险审计和一致性校验前,不应作为最终业务分类。

文档入口:https://arch.gh.wzhecnu.cn/ChatLabel/

安装与运行

pip install ChatLabel
chatlabel --version
chatlabel --tree
chatlabel serve

默认页面:http://127.0.0.1:8765/

配置

ChatLabel 从 ChatEnv 读取名为 apple 的既有 OpenAI profile,也可通过环境变量调整:

变量 默认值 作用
CHATLABEL_DATA_DIR .chatlabel-data SQLite、上传文件、图片证据与导出产物目录
CHATLABEL_CLASSIFIER rules rules 或 openai-responses
CHATLABEL_OPENAI_PROFILE apple 要读取的 OpenAI profile
CHATLABEL_OPENAI_MODEL gpt-5.6-sol Responses API 模型
CHATLABEL_REASONING_EFFORT xhigh 推理强度
CHATLABEL_MAX_OUTPUT_TOKENS 2400 单条 proposal 最大输出 token
CHATLABEL_MAX_UPLOAD_BYTES 134217728 单个上传文件大小上限
CHATLABEL_MAX_UNCOMPRESSED_BYTES 536870912 XLSX 解压后大小上限
CHATLABEL_PROPOSAL_WORKERS 2 单实例 proposal 并发数

进程级 OPENAI_* 会覆盖 profile 值。模型请求只接受 API Key,不把 key 写入任务或评测结果。网页配置接口只显示模型、API 地址和“是否有 API Key”,不会返回凭据内容。

数据与评测

chatlabel dataset-build \
  --data-root /path/to/data \
  --fixtures /path/to/example-cases.json \
  --output-dir /path/to/ground-truth

chatlabel cross-validate \
  --dataset-dir /path/to/ground-truth \
  --output-dir /path/to/cv-results \
  --folds 5 --limit-per-fold 8 --concurrency 2

chatlabel evaluate \
  --dataset-dir /path/to/ground-truth \
  --output-dir /path/to/validation-results \
  --split validation --concurrency 2

ground truth 同时保存来源工作簿、sheet、行号、文件哈希、原始标签、规范化标签、图片哈希和 policy override。旧式 慢线、无当前依据的历史拒收、缺图、条件性结论和冲突记录进入 review queue,不进入准确率 gold。

HTTP API

  • GET /healthz:进程健康检查。
  • GET /readyz:SQLite、task registry、运行目录和模型配置就绪检查。
  • GET /api/v1/model:模型、推理强度、prompt 版本和 API Key 可用状态。
  • POST /api/v1/proposals:按文本与可选 base64 图片生成单条 proposal。
  • GET /api/v1/task-types:读取版本化任务定义。
  • POST /api/v1/jobs:multipart 上传任务类型与 Excel。
  • GET /api/v1/jobs/{job_id}/records:分页读取规范化记录、proposal 和 review。
  • POST /api/v1/jobs/{job_id}/proposals:运行该工作簿的 proposal 阶段。
  • PATCH /api/v1/jobs/{job_id}/records/{record_id}/review:接受、纠正或 unresolved。
  • POST /api/v1/jobs/{job_id}/validate:运行覆盖率、备注、冲突、源文件和 WPS 闸门。
  • POST /api/v1/jobs/{job_id}/export:仅在闸门通过后生成 Excel、JSONL 和报告。
  • GET /api/v1/jobs/{job_id}/artifacts/{artifact_id}:下载持久化产物。

proposal 响应保留模型、状态、延迟与 token 用量,并始终返回 final=false。SQLite 使用 WAL;服务重启后仍可读取 job、record、proposal、review、validation、artifact 和审计事件。

开发验证

python -m pip install -e ".[dev,docs]"
python -m pytest -q
chatlabel --help
chatlabel --tree
python -m build
mkdocs build --strict

进一步查看:CLI 树、能力地图、Python 接口树。

Metadata

Release files for ChatLabel 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ChatLabel 0.1.1
File Size Uploaded
chatlabel-0.1.1.tar.gz 60.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ChatLabel 0.1.1
File Interpreter ABI Platform
chatlabel-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 121.3 kB

Release files / chatlabel-0.1.1.tar.gz

Download URL chatlabel-0.1.1.tar.gz
Size 60.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4e9b40852e711b5aaebdcb9d34cd1fd1c5736645775f6add5fe4295083538e92
BLAKE2b-256 checksum
How to use checksums
b9a49fb0899f8672bec304597916ba227fa328230da5e7954bdaebda498ef731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / chatlabel-0.1.1-py3-none-any.whl

Download URL chatlabel-0.1.1-py3-none-any.whl
Size 60.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fc3de8f351f9964aea65f53e4f8f0d9be38971cb6e45d5fbef9945bbb200780
BLAKE2b-256 checksum
How to use checksums
02c6f3dea32d015a15ee08a414b437e06f56c1937992c376745711620f734973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page