Skip to content

Add cacheverifier healthcheck -- offline stock-vs-fine-tuned evaluation - #1

Merged
imxinchengyou merged 1 commit into
mainfrom
healthcheck-cli
Sep 2, 2026
Merged

Add cacheverifier healthcheck -- offline stock-vs-fine-tuned evaluation#1
imxinchengyou merged 1 commit into
mainfrom
healthcheck-cli

Conversation

@imxinchengyou

Copy link
Copy Markdown
Owner

Wraps cacheverifier-service's scripts/local_health_check.py as a first-class command in this package.

What

cacheverifier healthcheck traffic.jsonl runs the same stock-vs-fine-tuned held-out AUC evaluation as the hosted Health Check Report (POST /v1/finetune/dry-run), but entirely offline — for teams who can't upload real traffic to evaluate whether the product fits. Queries and answers never leave the machine; --emit-summary writes an aggregate-only JSON file (AUCs, counts, rates — no text) that's safe to share for a human read.

pip install "cacheverifier[healthcheck]"
cacheverifier healthcheck traffic.jsonl --emit-summary summary.json

Input: a JSON array or JSONL of {query, candidate_answer, was_correct} rows in arrival order (optional stale: true per row). The train/calibrate/test split is chronological, matching the hosted service so the numbers are comparable.

How it's packaged

  • New cacheverifier console script (cacheverifier.__main__:main) — a small argparse dispatcher. --version / --help work on the base install.
  • New healthcheck extra (numpy<2, torch>=2.2, sentence-transformers<4). The base client stays httpx-only, py3.9+. Running cacheverifier healthcheck without the extra prints the pip install line and exits 2.
  • cacheverifier/_healthcheck/_finetune.py is a trimmed, self-contained port of the service's verifier_core.finetune — chronological split, rank-based AUC, Youden's-J threshold, label-noise + ceiling diagnostics. Drops the server-only machinery (Conformal Risk Control certification, cost-ratio threshold grids, drift monitoring).
  • numpy<2: the torch builds these versions resolve are compiled against the numpy 1.x ABI (Failed to initialize NumPy: _ARRAY_API not found on numpy 2). Same pin the hosted service uses.

CI

  • The base test matrix (py3.9–3.13, .[dev]) exercises CLI dispatch, parsing, and the missing-extra path.
  • A new healthcheck job installs .[healthcheck,dev] with CPU-only torch (--index-url https://download.pytorch.org/whl/cpu — the default wheel drags in ~3 GB of unused CUDA libs) and runs the real fine-tune end to end.

Testing

Local, both environments:

  • with the extra: ruff ✓, mypy ✓, pytest 18 passed / 1 skipped (e2e training ran), python -m build + twine check
  • without the extra (base CI shape): ruff ✓, mypy ✓, pytest 18 passed / 1 skipped (e2e skipped, missing-extra path ran)

Version bumped 0.1.0 → 0.2.0; README + CHANGELOG updated. publish.yml is release-triggered and version-agnostic — no change.

…tion

`cacheverifier healthcheck traffic.jsonl` runs the same held-out AUC
evaluation as the hosted Health Check Report (POST /v1/finetune/dry-run),
but entirely on the user's machine -- for teams that can't upload real
traffic to evaluate fit. Nothing is sent; `--emit-summary` writes an
aggregate-only JSON file (AUCs, counts, rates -- no query/answer text).

- New `cacheverifier` console script (`cacheverifier.__main__:main`), an
  argparse dispatcher. `--version` / `--help` work on the base install.
- New `healthcheck` extra (numpy<2, torch, sentence-transformers<4); the
  base client stays httpx-only. Running the subcommand without the extra
  prints the pip install line and exits 2.
- `cacheverifier/_healthcheck/_finetune.py`: a trimmed, self-contained
  port of the service's verifier_core.finetune -- chronological
  train/calibrate/test split, rank-based AUC, Youden's-J threshold,
  label-noise and ceiling diagnostics. Drops CRC certification,
  cost-ratio grids, and drift monitoring (server-only concerns).
- CI: base `test` matrix covers dispatch + the missing-extra path; a new
  `healthcheck` job installs the extra (CPU-only torch) and runs the real
  fine-tune end to end.
- Version 0.1.0 -> 0.2.0; README + CHANGELOG.
@imxinchengyou
imxinchengyou merged commit 33b1d06 into main Sep 2, 2026
7 checks passed
@imxinchengyou
imxinchengyou deleted the healthcheck-cli branch September 2, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant