Skip to main content Switch to mobile version runlab-client 0.4.0 Did my change actually help? Verdicts over seeds with confidence intervals, for AI researchers, ML engineers and their coding agents. Python client and CLI for RunLab; standard library only.
pip install runlab-client==0.4.0 Copy PIP instructions
Did my change actually help?
RunLab compares a change (a new augmentation, loss or learning rate) with its baseline across random seeds and tells you whether it really improved your metric. For AI researchers and ML engineers, and coding agents working with them.
Your training stays where it runs today. You record each seed's metric for both arms from Python or the runlab command, and RunLab gives back a verdict you can quote, built from:
a pre-registered plan;
a paired test across seeds, with a 95 % confidence interval;
checks that refuse a comparison that would mislead, e.g. arms tuned with unequal budgets.
Status: public preview (0.x). Method names, response fields and the CLI may still change before 1.0; every change is in CHANGELOG.md, breaking ones first. The statistics are not a preview: each test is checked by simulation, and where one is known to be weak it is listed under Known limits, with numbers.
Examples: Python and curl
pip install runlab-client # Python 3.10+, no dependencies runlab demo # sign in with GitHub, then a first verdict on simulated numbers The first time, a browser opens to sign in with GitHub. Then the demo plans, records 10 seeds per arm, compares and reports, in seconds:
treatment vs baseline on acc (higher is better): treatment is better paired_t: diff +0.01868 [95% CI +0.01371, +0.02365], p=1.37e-05, n=10 (A 10, B 10) ... quotable: treatment − baseline on acc = +0.01868 (95 % CI [+0.01371, +0.02365]; ...) The verdict page: https://runlab.tools/v/... Next, your own runs: the Quickstart below, with your training run in place of the simulated one.
from runlab_client import RunLab rl = RunLab() # the key `runlab demo` / `login` saved # 1. Pre-register, before any seed runs. rl.plan("resnet-aug", "mixup", "baseline", "acc", hypothesis="mixup raises top-1 accuracy", n_max=10, stopping="fixed") # 2. Record each seed's metric for both arms (use the same seeds for both). for seed in range(10): rl.result("resnet-aug", "mixup", acc=train("mixup", seed), seed=seed) rl.result("resnet-aug", "baseline", acc=train("baseline", seed), seed=seed) # 3. Compare once, after the planned seeds ran. v = rl.compare("resnet-aug", "mixup", "baseline", "acc") print(v["verdict"], v["prereg"]["status"]) # a_better ok print(v["text"]) # mixup vs baseline on acc (higher is better): mixup is better # paired_t: diff +0.0178 [95% CI +0.0094, +0.0262], p=0.00098, n=10 (A 10, B 10) # ... (relative effect, rank test, seed stability, fragility, plan, equal budget) # 4. May a write-up quote it? for c in rl.report("resnet-aug")["claims"]: print(c["status"], c["quote"]) # quotable mixup − baseline on acc = ... train is your training run. examples/quickstart.py runs as is, with a simulated train; examples/curl.sh is the same loop over plain HTTP.
RunLab stores each result as one line:
RESULT:
Names use letters, digits, _, . and -; arm names start with a letter.
Lines that do not start with RESULT: are ignored, so a whole training log can go to record() as is.
If one RESULT line is malformed, or there is none, the call stores nothing and fails with a 400.
Project names are case-insensitive and may not contain ~.
Params are optional; keep an arm's params the same on every seed. Each distinct set of params counts as one tuned configuration. A compare whose arms differ by more than 1.25x in configurations is refused (refused_by: equal_budget).
a is the treatment, b the baseline; diff is the mean of a − b, so it is positive when a scored higher. Lower is better for metric names containing loss, error, err, perplexity, ppl, wer, cer, mse, mae, rmse, nll, latency, fid (also fid50k, fid10k), kid, regret, bpb, bpc, bpd, bits_per_byte, bits_per_char, bits_per_dim, cross_entropy, xent, kl, ece, fpr, fnr or eer as a whole word (between _, ., / or -), higher otherwise; better="higher" or better="lower" overrides. Pass better whenever your metric's name is not in this list.
Next to verdict, read prereg.status: ok; deviation, with issues (e.g. compared before n_max seeds, or planned after more than 3 seeds were seen); missing (no plan); or tampered. Then read warnings, e.g. peeking.
What keeps a verdict honest
Every test is checked by simulation: 10,000 synthetic data sets per case, at 3, 5, 10 and 30 seeds; a case counts as failing only when it fails again on a second, independent run. These cases fail, and RunLab does not warn about them in the verdict (a skewness warning was tried and dropped: it missed most of the false wins):
Studies: let RunLab run the seeds
RunLab runs both arms one seed pair at a time and stops as soon as an always-valid sequential test (mSPRT) decides. It also stops at n_max, or at your dollar cap, whichever comes first.
rl.plan("resnet-aug", "mixup", "baseline", "acc", hypothesis="mixup raises top-1 accuracy", n_max=20) # stopping="msprt", the default s = rl.start_study("resnet-aug", command="train", a="mixup", b="baseline", metric="acc", max_usd=5, arm_params={"mixup": {"alpha": "0.2"}}) s = rl.wait_study(s["id"]) print(s["state"], s["winner"], s["pairs"], s["usd"]) # e.g. decided mixup 6 0.84 command names the training command to run. params and arm_params fill its placeholders, using values of letters, digits and _.:+=- only.
Every check runs before anything starts. A refusal raises RunLabError with status 400 and costs nothing, e.g. an unknown command, no msprt plan, or a cap that is too high.
Run the seeds on your own machine
Your GPU box, laptop or cluster node can run the seeds instead: RunLab hands out seed pairs, decides with the same sequential test, and stops at n_max or before the next pair would pass your dollar cap. Your training command prints
runlab worker --project resnet-aug --a mixup --b baseline --metric acc \ --max-usd 5 --usd-per-hour 0.8 --param epochs=10 \ --cmd "python train.py --arm {arm} --seed {seed} --epochs {epochs}" # seed 0: mixup acc=0.853, baseline acc=0.801 (412.3 s) # ... # study st_...: decided (A, winner mixup) after 6 pairs, $0.5496 --usd-per-hour is what an hour of your machine costs; each pair's run time is charged at it, so --max-usd caps your own spend.
Start more workers with --study st_... (another terminal or machine): each gets its own seeds. Give each a --worker name to get its open pair back after a restart.
A run that exits non-zero, prints no value or passes --timeout seconds counts as failed; the pair is skipped, as when RunLab runs the seeds.
Each run's time is recorded next to its metric, as wall_s and usd of its arm and seed.
From Python: s = rl.start_worker_study(...), then rl.run_worker(s["id"], cmd).
Pull-request check: runlab verdict
runlab verdict turns a comparison into a check on each pull request: the difference, its 95 % CI and the verdict, passing or failing on what you expected of the change. On GitHub the runlab-action runs it in about 5 lines of workflow YAML.
Commit the spec to your default branch as .runlab/verdict.yml:
paths: ["train/**", "configs/**"] # other changes need no verdict project: my-model checks: - a: "pr-{pr}-{sha7}" # this pull request's seeds b: "base-{pr}-{sha7}" # the base branch's seeds, from the same job metric: val_acc expect: better
In the job, train both arms' seeds (each prints RESULT: lines with seed=), then:
pip install "runlab-client[yaml]" runlab verdict --post \ --results "out/pr/*.txt --arm pr-{pr}-{sha7}" \ --results "out/base/*.txt --arm base-{pr}-{sha7}"
Keyless: give the job permissions: id-token: write and set no RUNLAB_TOKEN. The client then signs in with the short-lived OIDC token GitHub gives the job, minted for your RunLab URL only, and RunLab accepts it as the RunLab user bound to the repository owner's GitHub account (the one runlab login signed in), for the calls runlab verdict makes only, at most at role agent. Nothing to store, leak or rotate. An organization's repository sets RUNLAB_TOKEN from a secret instead.
It records the RESULT: lines of each file (other lines are skipped; --arm renames their experiment, --project picks the project when the spec has several), compares each row and writes the table to the job summary; --post also writes a check run named runlab verdict and one pull-request comment, updated on each push. {pr}, {sha}, {sha7} and {branch} are filled in: with {sha7} every push gets its own arms, so each pair is compared once (a second look at a pair warns peeking).
What keeps the check honest:
The spec is read from the pull request's base commit, so a pull request cannot loosen the test it is judged by. One that adds or changes the spec is judged by the old one, or gets a neutral check when there was none.
refused always fails, naming the check that refused and why; insufficient (fewer than 2 seeds in an arm) fails too, whatever the row expects.
An unknown key in the spec is an error, so a typo never turns a check off.
Limits: the pull request's own job runs the seeds, so the check is only as trustworthy as that job. Pull requests from forks get no token or secrets in GitHub Actions, so they get no verdict.
Without --post it only prints the table and writes the job summary. --spec-from head reads the checked-out spec instead, to try one out. The spec may be JSON when PyYAML is not installed.
Every failure raises RunLabError with:
.status: the HTTP status, or 0 when RunLab cannot be reached;
.message: RunLab's error text;
.request_id: quote it when reporting a problem.
The client retries 3 times on connection errors and on 429, 502, 503 and 504, waiting what the Retry-After header asks (at most 60 s), else 0.5, 1 and 2 s. It retries reads and the writes RunLab stores only once (plan, record / result, compare, work), so a dropped connection at the end of a training job does not lose its results. Starting a study is never retried: a repeat would start a second one.
RunLab(url=None, token=None, *, timeout=30, retries=3, backoff_s=0.5). Every method returns the decoded JSON of one operation in openapi.json. With no arguments it uses your sign-in; in CI, set RUNLAB_TOKEN instead, or, in a GitHub Actions job with id-token: write, nothing (keyless, for runlab verdict).
AGENTS.md is the short version for Claude Code, Codex and other agents. llms.txt indexes this repo for LLM tools.
Semantic versioning. In 0.x a minor version (0.3 → 0.4) may break something, and CHANGELOG.md says what and how to move; a patch (0.3.2 → 0.3.3) never does. Pin runlab-client~=0.4.0 to take fixes only. 1.0 comes once all of these hold:
From 1.0 on, a breaking change needs a new major version and the old behaviour keeps working, with a deprecation warning, for at least 3 months.
Questions and bug reports: GitHub Issues.
Released: Nov 28, 2026
Author: omer-nachman
Both files in this release have provenance metadata.
View provenance details
MIT View SPDX License List
Development Status 4 - Beta
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Topic Scientific/Engineering :: Artificial Intelligence
Release files for runlab-client 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 79.7 kB
Release files / runlab_client-0.4.0.tar.gz
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 Nov 28, 2026.
Release files / runlab_client-0.4.0-py3-none-any.whl
Security for runlab-client 0.4.0
Both files in this release have been uploaded with provenance metadata.
With provenance runlab_client-0.4.0.tar.gz Nov 28, 2026
With provenance runlab_client-0.4.0-py3-none-any.whl Nov 28, 2026
Attestation for runlab_client-0.4.0.tar.gz
Attestation for runlab_client-0.4.0-py3-none-any.whl
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.
Release history Release notifications | RSS feed
Nov 28, 2026 2 release files Full provenance
Nov 25, 2026 2 release files Full provenance
Nov 21, 2026 2 release files Full provenance
Nov 20, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from fc0d8e6











