poolprobe
Probe first. Classify before pruning.
Inspect OpenAI-compatible model pools, classify failures and produce terminal, JSON or HTML reports. Keep transient and credential failures separate from permanent-model prune candidates.
Install · Quickstart · Commands · Prune guards · Contributing
Scope: Live sweeps and benchmarks send model requests and may incur provider charges. Pruning requires all five guards; config writes require --apply. Offline selfcheck does not establish live gateway availability.
Checks: run python -m poolprobe selfcheck before pushing.
This is the repository's offline contract; it needs no live service or credentials.
Why it exists
A pool of routed models rots quietly. An upstream drops a model, a key hits an account tier, a reasoning model starts spending its whole token budget on thinking, a gateway route begins answering SSE to a non-streaming request. None of that raises an exception anywhere. The agent just gets an empty reply, or a slower one, or falls through to a worse model — and nobody notices for a week.
poolprobe looks at every model in the pool, tells you why each one is
failing, and refuses to delete anything until five separate guards agree it is
dead. It grew out of running a live cliproxy pool on a schedule and learning,
the hard way, how many "dead model" verdicts were really weather.
The three rules
Everything in the tool obeys these. They are the reason it exists.
-
A verdict is not a death sentence. Every failure is classified into a kind —
ALIVE,ALIVE-STARVED,PERMANENT,TRANSIENT,CREDENTIAL,MODALITY,UNKNOWN. OnlyPERMANENT(the upstream genuinely does not know this model) is ever a prune candidate. A 401 is a dead key, not a dead model; pruning on it deletes a good alias because a credential ran dry. -
One observation is not a verdict. A measured pool produced 544 scheduled liveness runs over six weeks; 39% went red, and every single red was transient.
poolprobeburst-confirms by default — five attempts in one run, best answer wins — before it will call anything dead. -
A number without evidence is not reported. Throughput comes from the gateway's own
usageblock, or it is marked as a lower bound (>=), or it renders as-. Never estimated from SSE chunk counts and dressed up as a measurement.
Install
Use Python 3.10+. For a first run from a checkout, use a virtual environment (the activation command below is for a POSIX shell):
git clone https://gitlab.com/ameobius-ai/poolprobe.git
cd poolprobe
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
poolprobe --version
Expected version output: poolprobe 1.2.0 with exit code 0. Installation may
fetch the build tooling declared in pyproject.toml; installing
is not the offline check below. No gateway credentials or real config are needed.
When a release is available on PyPI, the package-install alternatives are:
pip install poolprobe # stdlib engine, generic gateway lane
pip install 'poolprobe[cliproxy]' # + PyYAML, to read a cliproxy-style config
The engine has zero runtime dependencies. PyYAML is optional and only needed
to attribute models to providers and to plan config edits from a gateway YAML.
For that existing adapter, install python -m pip install '.[cliproxy]' from the
checkout; it may fetch PyYAML. It is not needed for the offline first run.
CLIProxyAPI config attribution
The adapter reads the legacy openai-compatibility / claude-api-key lists
and CLIProxyAPI v8 api-keys.openai-compatibility / api-keys.claude groups.
For each family, a present v8 list replaces the legacy one, including [].
Claude key entries inherit group fields and may override models/prefixes.
The read contract follows CLIProxyAPI v8.0.45;
it is not a claim about every installed gateway version or provider family.
Configured model IDs use the normalized one-segment prefix: normally both
alias and prefix/alias, or only the prefixed ID with force-model-prefix.
As upstream specifies, the unprefixed ID is also retained when it equals the
prefix. A present routing.force-model-prefix overrides the legacy flag,
including false. The catalog remains the union of declared IDs and /models;
a declaration is not proof that the running gateway publishes or can serve it.
Reading is not editing permission. v8/mixed, prefixed, empty or ambiguous
layouts are read-only; the existing text-edit path remains limited to recognized,
unambiguous, unprefixed legacy declarations. Layouts with no supported section,
or malformed supported sections, raise an error with --adapter cliproxy;
auto falls back to the generic read-only adapter. Other v8 provider families
are not attributed here. No live
gateway, removal plan or config-write safety is established by the offline checks.
Quickstart
First run without a gateway
With the virtual environment above active, run the installed entry point:
poolprobe selfcheck
Expected output:
poolprobe selfcheck ok
A pass exits 0; a failed selfcheck exits 1. Keep Python assertions enabled
(do not use python -O). The equivalent checkout command is
python -m poolprobe selfcheck.
This runs built-in synthetic checks for chain rules, prune guards, argv
redaction, terminal/JSON/HTML rendering and atomic writes. It needs no API key,
gateway, user config or saved state. The atomic-write check creates and cleans
its own temporary directory; no report or config file should be kept from this
run. A pass does not establish live gateway/model availability or validate a
real YAML config. No cliproxy extra is needed for these checks.
Next safe step: poolprobe --help lists commands without sending requests.
See the existing contribution checks
for the module/installed-entry and optional-adapter check sequence.
Live gateway examples — not offline checks
The examples below are a separate operational path, not the first-run check.
ping contacts the gateway even though it sends no chat request; sweeps,
benchmarks and pruning without --apply can send model requests and incur
charges. --apply guards config changes, not network access. Review
commands and all five prune guards before
using an authorized gateway. Do not run these examples as an offline test.
# 1. Is the gateway even up, and what does it publish? (no chat request sent)
poolprobe ping -u http://127.0.0.1:8317/v1 -k "$KEY"
# 2. Probe the whole pool, burst-confirmed, and keep a self-contained HTML report
poolprobe sweep -u http://127.0.0.1:8317/v1 -k "$KEY" --html out.html
# 3. Give it memory: fail streaks across runs are what make `prune` safe
poolprobe sweep -u ... -k "$KEY" --state ~/.cache/poolprobe.json
# 4. Probe and plan candidates; only config writes require --apply
poolprobe prune -u ... -k "$KEY" --state ~/.cache/poolprobe.json \
--adapter cliproxy --config ~/.config/gateway.yaml
# 5. Validate agent fallback chains against the lane rules that actually read them
poolprobe chains ~/.hermes/config.yaml --cross-check -u ... -k "$KEY"
-u also reads POOLPROBE_BASE_URL; -k reads POOLPROBE_API_KEY then
OPENAI_API_KEY; --state reads POOLPROBE_STATE. The bearer key is masked in
every argv echo — reports are meant to be pasted into issues.
What a sweep looks like
poolprobe 1.2.0 · sweep
http://127.0.0.1:8317/v1 · generic adapter (read-only)
5 models · 4 alive · 0 starved · 1 dead · 0 prunable · median 5.43s · run #1
VERDICT MODEL PROVIDER LAT BURST STREAK KIND NOTE
------------ ------------------- --------- ------- ----- ------ ---------- --------------------
OK gpt-5.4 - 2.74s ✓ ok1 - alive
OK gemini-3.8-flash - 6.12s ✓ ok1 - alive
OK grok-4.6 - 27.3s ✓ ok1 - alive
ERR suno-music - 0.13s ✗ x1 CREDENTIAL {"error":{"message"…
OK deepseek-v4-flash - 4.73s ✓ ok1 - alive
prunable: none — nothing met all five guards (dead, PERMANENT, streak, unprotected, chat modality)
what to do
CREDENTIAL (1): credential or account level: rotate/top up the key, never prune the model
grok-4.6 answering OK here is the whole point: a prior single-shot check had
written it off as dead. The burst said otherwise.
Commands
| Command | What it does | Sends a chat request? |
|---|---|---|
ping |
Reach the gateway, list the published catalog, break it down by provider. | no |
sweep [models…] |
Burst-confirmed liveness probe; one verdict + kind per model. | yes |
bench [models…] |
Latency and throughput; --repeat N reports the median, --stream measures time-to-first-token. |
yes |
prune [models…] |
List models that passed all five guards and plan the config edit. --apply writes it (previous copy kept as .bak). |
yes |
chains PATH |
Validate agent fallback chains against the lane rules that read them. --cross-check diffs rungs against the live catalog. |
no |
selfcheck |
Offline assert suite — taxonomy, burst logic, prune guards, argv redaction, all three renderers. This is what CI runs. | no |
Common options: --adapter {auto,cliproxy,generic}, --config PATH,
--threads N, --timeout S, --max-tokens N, --prompt TEXT, --state PATH,
--streak-min N, --protect MODEL (repeatable), --json PATH, --html PATH,
--color {auto,always,never}, -q/--quiet.
--max-tokens is a floor, not a cap: a reasoning model spends it on thinking
and answers EMPTY-LENGTH, which poolprobe reads as alive but starved, never
as dead.
Exit codes
A cron contract. Red is a finding, not noise.
| Code | Meaning |
|---|---|
0 |
Nothing dead — or nothing that met every guard. |
1 |
Something dead (burst-confirmed), or a fallback chain is broken. |
2 |
Usage error, unreadable config, or PyYAML missing for a config read. |
3 |
The gateway could not be reached, or published an empty catalog. |
130 |
Interrupted. |
The five prune guards
prune will not name a model unless all five agree. A report that says
"prunable" while the prune cycle deletes something else is the worst outcome for
a tool like this, so the guards live in one function, checked in one place:
- dead verdict —
EMPTY,ERR, orTIMEOUT(OK/EMPTY-LENGTHnever qualify); - kind
PERMANENT— the upstream does not know this model; - fail streak — dead for at least
--streak-minconsecutive runs (needs--state) and for at least--min-dead-forseconds of wall time (default 1800), so a burst of runs during one outage counts as one observation (--min-interval SECONDSis the matching probe budget: models probed that recently are skipped, not re-asked); - not protected — absent from
--protect(a namespaced alias's base name matches too); - not a generation modality — image/video/tts/music models legitimately fail a chat probe.
Without --state there is no memory, every streak reads 0, and guard 3 can
never pass — so prune lists candidates but changes nothing. That is the safe
default.
Reading a report
Verdict — what the probe saw:
OK · EMPTY (200, empty body) · EMPTY-LENGTH (empty because the token budget
ran out — alive) · ERR (non-2xx) · TIMEOUT.
Kind — what it means:
| Kind | Reading | Prunable? |
|---|---|---|
ALIVE |
Answered. | no |
ALIVE-STARVED |
Answered EMPTY-LENGTH — raise --max-tokens. |
no |
PERMANENT |
Explicit model-error evidence, such as structured model_not_found; a bare/route 404 is not enough. |
yes |
TRANSIENT |
Timeout, 429, 5xx — weather. Burst-confirm before believing it. |
no |
CREDENTIAL |
401/403, "invalid api key" — rotate the key, never the model. |
no |
MODALITY |
Model lives on another endpoint (/v1/images/…), not chat. |
no |
UNKNOWN |
None of the above; reported, never acted on. | no |
Structured model-error codes are classified before the display note is truncated
to 160 characters. An ambiguous 404 stays UNKNOWN; a permanent classification
alone never bypasses the five prune guards or makes an adapter editable.
Three renderers, one report: the terminal table (ANSI, honours NO_COLOR /
FORCE_COLOR / TERM=dumb / isatty), a machine-readable --json, and a
self-contained --html you can attach to a post. They cannot disagree about
what a run recorded.
Library use
from poolprobe import Gateway, sweep, taxonomy
gw = Gateway("http://127.0.0.1:8317/v1", api_key="local")
for result in sweep(gw, ["gpt-5.4", "glm-5.3-flash"], attempts=5):
print(result.model, result.verdict, result.kind, result.advice)
Development
python -m poolprobe selfcheck # the whole offline contract; CI runs exactly this
selfcheck needs no gateway, no network and no secrets. If it passes, the
taxonomy, the burst "best truth wins" logic, the five prune guards, the argv
redaction and all three renderers are behaving.
License
MIT — see LICENSE.
Metadata
Release files for poolprobe 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| poolprobe-1.2.0.tar.gz | 72.4 kB | Without provenance | Details for poolprobe-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| poolprobe-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for poolprobe-1.2.0-py3-none-any.whl |
Total release size: 145.3 kB
Release files / poolprobe-1.2.0.tar.gz
| Download URL | poolprobe-1.2.0.tar.gz |
|---|---|
| Size | 72.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
895018afb323eed41f9a090adab6ea825fbe71eb8cebd918dfad588941ea1fc6
|
|
BLAKE2b-256 checksum How to use checksums |
119f6988305b7ec912488af4bc16d8ce10766562d4220e6056f3d60c415cc942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / poolprobe-1.2.0-py3-none-any.whl
| Download URL | poolprobe-1.2.0-py3-none-any.whl |
|---|---|
| Size | 72.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a22828d6065f8b31a2e48bafae62e16cdb3487bcf3dce0e9957af8c07480f9ab
|
|
BLAKE2b-256 checksum How to use checksums |
39e63bd6d8b731bcf69bc364e61708cd13d5d7f028bc663b372a22f4c6ba75a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for poolprobe 1.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.