tinker-inspect 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ .venv/
6
+ dist/
7
+ build/
8
+ *.egg-info/
9
+ .DS_Store
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bruno Stefoni
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.5
2
+ Name: tinker-inspect
3
+ Version: 0.4.0
4
+ Summary: Zero-dependency CLI and single-file HTML diagnostics viewer for Tinker RL runs and evaluation diffs.
5
+ Project-URL: Homepage, https://github.com/BrunoSE/tinker-inspect
6
+ Project-URL: Repository, https://github.com/BrunoSE/tinker-inspect
7
+ Project-URL: Documentation, https://brunose.github.io/tinker-inspect/
8
+ Author: Bruno Stefoni
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: diagnostics,llm,observability,rl,tinker,verifiers
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+
23
+ # tinker-inspect
24
+
25
+ [![CI](https://github.com/BrunoSE/tinker-inspect/actions/workflows/ci.yml/badge.svg)](https://github.com/BrunoSE/tinker-inspect/actions/workflows/ci.yml)
26
+
27
+ Zero-dependency CLI and single-file HTML diagnostics viewer for **Tinker RL** (`tinker-cookbook`) runs, live monitoring (`watch`), paired eval diffs (`diff`), run comparisons (`compare`), and multi-checkpoint progressions (`series`).
28
+
29
+ Point it at any Tinker `log_path` directory (`metrics.jsonl`, `config.json`, `timing_spans.jsonl`, `checkpoints.jsonl`, `iteration_*/train_rollout_summaries.jsonl`) for an instant terminal health check and self-contained, zero-CDN `.html` report.
30
+
31
+ ## Live Demos
32
+
33
+ Browse all interactive reports at **[brunose.github.io/tinker-inspect](https://brunose.github.io/tinker-inspect/)**:
34
+
35
+ | Demo | What it shows |
36
+ |---|---|
37
+ | [8-Arm Zero-Shot AIME 2024+2025 (`series`)](https://brunose.github.io/tinker-inspect/series_aime2425_ladder.html) | Complete 60/60 ladder @ `4,096` tok: `Qwen3-4B` BF16 Think ON `2.5%` & Think OFF `20.8%` → Inkling Base CoT `59.2%` → Base TIR `69.2%` → **Step-16 TIR v1 `80.8%` (`1,639` tok)** → Step-16 TIR v2 `76.7%`. |
38
+ | [Multi-Turn TIR RL + 3 Eval Tabs (`inspect`)](https://brunose.github.io/tinker-inspect/demo_inkling2_polaris_tir_rl_ood18.html) | One report with 3 paired eval tabs (**AIME 24+25 `+11.7 pp`**, **Polaris 1/8 OOD `+15.6 pp`**, **Held-Out `+10.9 pp`**), pre-filter reward (`0.527 → 0.703`), `1.86×` prefill, and `50%` sampling idle wait. |
39
+ | [OOD Olympiad `1/8` Progression (`series`)](https://brunose.github.io/tinker-inspect/series_polaris18_ladder.html) | 6-arm 48-task paired progression from `25.0%` → **`50.0%` (`+25.0 pp [+14.6, +36.5]`, `2.0×` Base CoT, strict `4096`-to-`4096`)**. |
40
+ | [TIR RL v1 vs v2 (`compare`)](https://brunose.github.io/tinker-inspect/compare_tir_v1_vs_v2.html) | Side-by-side `3072` sync vs `4096` `stream_minibatch` showing `+43%` length drift, `53%` cross-step idle wait, and an upstream post-filter summary bug. |
41
+ | [Run #1 vs Run #2 (`compare`)](https://brunose.github.io/tinker-inspect/compare_polaris_v1_vs_v2.html) | Acting on truncation alerts cut `max_tokens` cutoffs `61.3% → 19.8%` and turned a flat run into `+10.9 pp`. |
42
+ | [Qwen3.5-4B Git Tool RL (`inspect`)](https://brunose.github.io/tinker-inspect/demo_full25.html) | `3.45×` multi-turn prefill amplification (`~76%` cacheable), `71%` constant-reward drop rate, and timing Gantt. |
43
+
44
+ ## What It Catches
45
+
46
+ - **Hidden constant-reward drop rates:** Reconciles pre-filter `train_rollout_summaries.jsonl` against post-filter `metrics.jsonl` to surface true reward progression and `mixed` / `all_good` / `all_bad` group drop rates.
47
+ - **Multi-turn prefill & cost:** Reads native `tokens/*` and `cost/*` from `tinker-cookbook`, falling back to exact turn-by-turn reconstruction (`sum(ob_len)` vs `final_ob_len`, cache-hit split). Pass `--rates` or `--fetch-pricing` for offline/live cost estimates.
48
+ - **KL0 drift, truncation & stragglers:** Checks `kl_sample_train_v1`/`_v2`, flags `max_tokens`/`max_turns`/timeouts, and maps `timing_spans.jsonl` (with `group_idx` links) into an interactive per-step Gantt.
49
+ - **Paired evals & multi-arm series:** Supports JSONL and `.jsonl.zst` (including Prime hosted traces), deterministic paired/clustered 95% bootstrap CIs, `Ended How` decomposition, and side-by-side transcripts.
50
+
51
+ ## Quick Start
52
+
53
+ Python 3.11+ stdlib only (zero runtime dependencies):
54
+
55
+ ```bash
56
+ # Run directly with uvx
57
+ uvx --from git+https://github.com/BrunoSE/tinker-inspect tinker-inspect /path/to/log_dir
58
+
59
+ # Attach multiple before/after eval pairs as interactive tabs (.jsonl or .jsonl.zst)
60
+ tinker-inspect /path/to/log_dir \
61
+ --eval-before base_heldout.jsonl --eval-after final_heldout.jsonl \
62
+ --base-label "Base Held-Out" --final-label "Final Held-Out" \
63
+ --eval-before base_ood.jsonl --eval-after final_ood.jsonl \
64
+ --base-label "Base OOD" --final-label "Final OOD" \
65
+ --sanitize-paths --out report.html --open
66
+
67
+ # Default HTML outputs refuse silent overwrite; pass --force (or --out / --no-html)
68
+ tinker-inspect /path/to/log_dir --force
69
+
70
+ # JSON output or CI health gate (exits 2 on FAIL)
71
+ tinker-inspect /path/to/log_dir --json --no-html
72
+ tinker-inspect /path/to/log_dir --strict --no-html
73
+
74
+ # Standalone paired eval diff (with cluster bootstrap + regression gate)
75
+ tinker-inspect diff base.jsonl.zst final.jsonl.zst --cluster-by family --fail-if-regression success
76
+
77
+ # Overlay two runs side-by-side
78
+ tinker-inspect compare run_a/ run_b/ --out compare.html
79
+
80
+ # Multi-checkpoint / multi-method progression report
81
+ tinker-inspect series "Base=base.jsonl" "Step 16=s16.jsonl" "TIR RL=tir.jsonl" --out series.html
82
+
83
+ # Live-monitor an active run (exits 2 immediately on KL0 drift or health failure)
84
+ tinker-inspect watch /path/to/active/log_dir --interval 5 --fail-fast
85
+ ```
86
+
87
+ ## Development
88
+
89
+ ```bash
90
+ uv run ruff check src tests
91
+ uv run ruff format --check src tests
92
+ uv run pytest -v
93
+ ```
94
+
95
+ ## License
96
+
97
+ MIT
@@ -0,0 +1,75 @@
1
+ # tinker-inspect
2
+
3
+ [![CI](https://github.com/BrunoSE/tinker-inspect/actions/workflows/ci.yml/badge.svg)](https://github.com/BrunoSE/tinker-inspect/actions/workflows/ci.yml)
4
+
5
+ Zero-dependency CLI and single-file HTML diagnostics viewer for **Tinker RL** (`tinker-cookbook`) runs, live monitoring (`watch`), paired eval diffs (`diff`), run comparisons (`compare`), and multi-checkpoint progressions (`series`).
6
+
7
+ Point it at any Tinker `log_path` directory (`metrics.jsonl`, `config.json`, `timing_spans.jsonl`, `checkpoints.jsonl`, `iteration_*/train_rollout_summaries.jsonl`) for an instant terminal health check and self-contained, zero-CDN `.html` report.
8
+
9
+ ## Live Demos
10
+
11
+ Browse all interactive reports at **[brunose.github.io/tinker-inspect](https://brunose.github.io/tinker-inspect/)**:
12
+
13
+ | Demo | What it shows |
14
+ |---|---|
15
+ | [8-Arm Zero-Shot AIME 2024+2025 (`series`)](https://brunose.github.io/tinker-inspect/series_aime2425_ladder.html) | Complete 60/60 ladder @ `4,096` tok: `Qwen3-4B` BF16 Think ON `2.5%` & Think OFF `20.8%` → Inkling Base CoT `59.2%` → Base TIR `69.2%` → **Step-16 TIR v1 `80.8%` (`1,639` tok)** → Step-16 TIR v2 `76.7%`. |
16
+ | [Multi-Turn TIR RL + 3 Eval Tabs (`inspect`)](https://brunose.github.io/tinker-inspect/demo_inkling2_polaris_tir_rl_ood18.html) | One report with 3 paired eval tabs (**AIME 24+25 `+11.7 pp`**, **Polaris 1/8 OOD `+15.6 pp`**, **Held-Out `+10.9 pp`**), pre-filter reward (`0.527 → 0.703`), `1.86×` prefill, and `50%` sampling idle wait. |
17
+ | [OOD Olympiad `1/8` Progression (`series`)](https://brunose.github.io/tinker-inspect/series_polaris18_ladder.html) | 6-arm 48-task paired progression from `25.0%` → **`50.0%` (`+25.0 pp [+14.6, +36.5]`, `2.0×` Base CoT, strict `4096`-to-`4096`)**. |
18
+ | [TIR RL v1 vs v2 (`compare`)](https://brunose.github.io/tinker-inspect/compare_tir_v1_vs_v2.html) | Side-by-side `3072` sync vs `4096` `stream_minibatch` showing `+43%` length drift, `53%` cross-step idle wait, and an upstream post-filter summary bug. |
19
+ | [Run #1 vs Run #2 (`compare`)](https://brunose.github.io/tinker-inspect/compare_polaris_v1_vs_v2.html) | Acting on truncation alerts cut `max_tokens` cutoffs `61.3% → 19.8%` and turned a flat run into `+10.9 pp`. |
20
+ | [Qwen3.5-4B Git Tool RL (`inspect`)](https://brunose.github.io/tinker-inspect/demo_full25.html) | `3.45×` multi-turn prefill amplification (`~76%` cacheable), `71%` constant-reward drop rate, and timing Gantt. |
21
+
22
+ ## What It Catches
23
+
24
+ - **Hidden constant-reward drop rates:** Reconciles pre-filter `train_rollout_summaries.jsonl` against post-filter `metrics.jsonl` to surface true reward progression and `mixed` / `all_good` / `all_bad` group drop rates.
25
+ - **Multi-turn prefill & cost:** Reads native `tokens/*` and `cost/*` from `tinker-cookbook`, falling back to exact turn-by-turn reconstruction (`sum(ob_len)` vs `final_ob_len`, cache-hit split). Pass `--rates` or `--fetch-pricing` for offline/live cost estimates.
26
+ - **KL0 drift, truncation & stragglers:** Checks `kl_sample_train_v1`/`_v2`, flags `max_tokens`/`max_turns`/timeouts, and maps `timing_spans.jsonl` (with `group_idx` links) into an interactive per-step Gantt.
27
+ - **Paired evals & multi-arm series:** Supports JSONL and `.jsonl.zst` (including Prime hosted traces), deterministic paired/clustered 95% bootstrap CIs, `Ended How` decomposition, and side-by-side transcripts.
28
+
29
+ ## Quick Start
30
+
31
+ Python 3.11+ stdlib only (zero runtime dependencies):
32
+
33
+ ```bash
34
+ # Run directly with uvx
35
+ uvx --from git+https://github.com/BrunoSE/tinker-inspect tinker-inspect /path/to/log_dir
36
+
37
+ # Attach multiple before/after eval pairs as interactive tabs (.jsonl or .jsonl.zst)
38
+ tinker-inspect /path/to/log_dir \
39
+ --eval-before base_heldout.jsonl --eval-after final_heldout.jsonl \
40
+ --base-label "Base Held-Out" --final-label "Final Held-Out" \
41
+ --eval-before base_ood.jsonl --eval-after final_ood.jsonl \
42
+ --base-label "Base OOD" --final-label "Final OOD" \
43
+ --sanitize-paths --out report.html --open
44
+
45
+ # Default HTML outputs refuse silent overwrite; pass --force (or --out / --no-html)
46
+ tinker-inspect /path/to/log_dir --force
47
+
48
+ # JSON output or CI health gate (exits 2 on FAIL)
49
+ tinker-inspect /path/to/log_dir --json --no-html
50
+ tinker-inspect /path/to/log_dir --strict --no-html
51
+
52
+ # Standalone paired eval diff (with cluster bootstrap + regression gate)
53
+ tinker-inspect diff base.jsonl.zst final.jsonl.zst --cluster-by family --fail-if-regression success
54
+
55
+ # Overlay two runs side-by-side
56
+ tinker-inspect compare run_a/ run_b/ --out compare.html
57
+
58
+ # Multi-checkpoint / multi-method progression report
59
+ tinker-inspect series "Base=base.jsonl" "Step 16=s16.jsonl" "TIR RL=tir.jsonl" --out series.html
60
+
61
+ # Live-monitor an active run (exits 2 immediately on KL0 drift or health failure)
62
+ tinker-inspect watch /path/to/active/log_dir --interval 5 --fail-fast
63
+ ```
64
+
65
+ ## Development
66
+
67
+ ```bash
68
+ uv run ruff check src tests
69
+ uv run ruff format --check src tests
70
+ uv run pytest -v
71
+ ```
72
+
73
+ ## License
74
+
75
+ MIT
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "tinker-inspect"
7
+ version = "0.4.0"
8
+ description = "Zero-dependency CLI and single-file HTML diagnostics viewer for Tinker RL runs and evaluation diffs."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.11"
12
+ authors = [{ name = "Bruno Stefoni" }]
13
+ keywords = ["tinker", "rl", "llm", "verifiers", "diagnostics", "observability"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: Science/Research",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ ]
24
+ dependencies = []
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/BrunoSE/tinker-inspect"
28
+ Repository = "https://github.com/BrunoSE/tinker-inspect"
29
+ Documentation = "https://brunose.github.io/tinker-inspect/"
30
+
31
+ [project.scripts]
32
+ tinker-inspect = "tinker_inspect.cli:main"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=8.0",
37
+ "ruff>=0.8",
38
+ ]
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["src/tinker_inspect"]
42
+
43
+ [tool.hatch.build.targets.sdist]
44
+ include = [
45
+ "src/tinker_inspect/**",
46
+ "tests/**",
47
+ "README.md",
48
+ "LICENSE",
49
+ "pyproject.toml",
50
+ ]
51
+
52
+ [tool.ruff]
53
+ line-length = 100
54
+ target-version = "py311"
55
+
56
+ [tool.ruff.lint]
57
+ select = ["E", "F", "I", "UP", "B", "SIM"]
58
+
59
+ [tool.pytest.ini_options]
60
+ testpaths = ["tests"]
@@ -0,0 +1,7 @@
1
+ """tinker-inspect: Diagnostics CLI and single-file HTML viewer for Tinker RL runs."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __version__ = "0.4.0"
6
+
7
+ __all__ = ["__version__"]
@@ -0,0 +1 @@
1
+ """Static HTML report templates bundled with tinker-inspect."""