extty 0.1.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.
extty-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eric O. Korman
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.
extty-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: extty
3
+ Version: 0.1.0
4
+ Summary: Terminal-native ML experiment tracker
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/ekorman/extty
7
+ Project-URL: Issues, https://github.com/ekorman/extty/issues
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: psutil>=5.9.0
12
+ Requires-Dist: boto3>=1.34.0
13
+ Requires-Dist: nvidia-ml-py>=12.0.0
14
+ Provides-Extra: modal
15
+ Requires-Dist: modal>=1.3.0.post1; extra == "modal"
16
+ Provides-Extra: run-analysis
17
+ Requires-Dist: pandas>=2.0.0; extra == "run-analysis"
18
+ Requires-Dist: matplotlib>=3.7.0; extra == "run-analysis"
19
+ Provides-Extra: image
20
+ Requires-Dist: pillow>=10.0.0; extra == "image"
21
+ Dynamic: license-file
22
+
23
+ # extty
24
+
25
+ Terminal-first ML experiment tracking: a Python SDK for logging runs and a
26
+ Rust TUI for browsing them.
27
+
28
+ The TUI and S3 are both optional. Runs are stored locally, and the Python SDK
29
+ alone can log and read them. Configure S3 to sync runs to a bucket.
30
+
31
+ ## Install
32
+
33
+ ### Python SDK
34
+
35
+ Requires Python 3.10+.
36
+
37
+ ```bash
38
+ pip install extty # or: uv add extty
39
+ pip install "extty[image]" # adds Image logging
40
+ ```
41
+
42
+ ### TUI
43
+
44
+ Prebuilt binaries for macOS, Linux and Windows are attached to each
45
+ [GitHub release](https://github.com/ekorman/extty/releases). On macOS or
46
+ Linux, set `target` to your platform and extract `extty` onto your `PATH`:
47
+
48
+ ```bash
49
+ # aarch64-apple-darwin, x86_64-apple-darwin,
50
+ # x86_64-unknown-linux-gnu or aarch64-unknown-linux-gnu
51
+ target=aarch64-apple-darwin
52
+ mkdir -p ~/.local/bin
53
+ curl -LsSf "https://github.com/ekorman/extty/releases/latest/download/extty-$target.tar.xz" \
54
+ | tar xJ --strip-components=1 -C ~/.local/bin "extty-$target/extty"
55
+ ```
56
+
57
+ On Windows, download `extty-x86_64-pc-windows-msvc.zip` from the release and
58
+ put `extty.exe` on your `PATH`.
59
+
60
+ To build from source instead:
61
+
62
+ ```bash
63
+ cargo install --locked --git https://github.com/ekorman/extty extty
64
+ ```
65
+
66
+ ## Logging
67
+
68
+ ```python
69
+ import extty
70
+
71
+ extty.init("my-project", name="run-1", config={"lr": 1e-3})
72
+ extty.log({"train/loss": 0.5}, step=0)
73
+ extty.finish()
74
+ ```
75
+
76
+ The value's type decides how it is stored and rendered. Use `/` in names to
77
+ group streams (`train/loss`, `val/loss`).
78
+
79
+ | Type | For | TUI |
80
+ | --- | --- | --- |
81
+ | `float` / `int` | scalar metrics | line chart |
82
+ | `Example` / `BatchExample` | prompt/response pairs, with optional rewards (float or dict of components) and groundtruth | text browser |
83
+ | `ConfusionMatrix` | N×N counts, rows = true class | matrix |
84
+ | `Chart` | `(x, y)` curves such as ROC or PR | plot; `v` toggles a table |
85
+ | `Image` | a `PIL.Image`, stored as PNG; needs `extty[image]` | inline on kitty/iTerm2/sixel; `o` opens externally |
86
+
87
+ ```python
88
+ extty.log(
89
+ {
90
+ "train/loss": loss,
91
+ "val/samples": extty.Example(
92
+ prompt="Capital of France?",
93
+ responses=["Paris", "Lyon"],
94
+ rewards=[1.0, 0.0],
95
+ groundtruth="Paris",
96
+ ),
97
+ "eval/cm": extty.ConfusionMatrix.from_array(cm, labels=["cat", "dog"]),
98
+ "eval/roc": extty.Chart.from_arrays(fpr, tpr, ("fpr", "tpr")),
99
+ "val/detections": extty.Image(frame, caption="epoch 3"),
100
+ },
101
+ step=step,
102
+ )
103
+ ```
104
+
105
+ `BatchExample` takes parallel lists, one entry per prompt. `from_array` and
106
+ `from_arrays` accept numpy or torch arrays.
107
+
108
+ In the TUI run view, focus a card with Enter and scrub through steps with
109
+ `↑↓` (Shift jumps 10).
110
+
111
+ ## Reading runs
112
+
113
+ ```python
114
+ run = extty.get_run("my-project", "run-1")
115
+ run.metric_names
116
+ run.metric("train/loss") # [MetricPoint(step, timestamp, value), ...]
117
+ run.examples("val/samples")
118
+ run.confusion_matrix("eval/cm")
119
+ run.chart("eval/roc")
120
+ run.image_bytes(run.images("val/detections")[-1])
121
+ ```
122
+
123
+ With S3 configured, `get_run` reads a run straight from S3 if it isn't local.
124
+
125
+ ## Checkpoints
126
+
127
+ ```python
128
+ extty.save_checkpoint(step, state_dict=model.state_dict(), optimizer_state_dict=opt.state_dict())
129
+ extty.save_checkpoint(step, path="ckpt.pt") # or a file written by torch.save
130
+
131
+ ckpt = extty.load_checkpoint(step) # active run
132
+ ckpt = extty.load_checkpoint_from("my-project", "run-1", step) # any run
133
+ model.load_state_dict(ckpt["model_state_dict"])
134
+ ```
135
+
136
+ Checkpoints are saved in the run directory, so they work without S3. With S3
137
+ configured they are uploaded instead, and kept locally only with
138
+ `keep_local=True` or if the upload fails. Loads use a complete local copy when
139
+ there is one and download from S3 otherwise. `extty push` does not upload
140
+ checkpoints.
141
+
142
+ `extty.delete_local_checkpoint(project, run, step)` and `extty prune local`
143
+ free disk by deleting local copies that S3 also has. Neither deletes a
144
+ checkpoint's only copy unless you pass `force=True` to
145
+ `delete_local_checkpoint`.
146
+
147
+ ## S3 sync (optional)
148
+
149
+ Configure S3 in `~/.extty/s3/config.toml`, which both the SDK and TUI read:
150
+
151
+ ```toml
152
+ bucket = "my-bucket"
153
+ prefix = "extty" # optional
154
+ region = "us-west-2" # optional
155
+ access_key_id = "..." # optional, defaults to the AWS credential chain
156
+ secret_access_key = "..."
157
+ endpoint_url = "..." # optional, for MinIO etc.
158
+ ```
159
+
160
+ The SDK also accepts `EXTTY_S3_BUCKET`, `EXTTY_S3_PREFIX`, `EXTTY_S3_REGION`,
161
+ `EXTTY_S3_ACCESS_KEY_ID`, `EXTTY_S3_SECRET_ACCESS_KEY` and
162
+ `EXTTY_S3_ENDPOINT_URL`, which take precedence over the file. Once configured,
163
+ runs sync to S3 as they log. Without it, the SDK makes no network requests.
164
+
165
+ With the TUI installed:
166
+
167
+ ```bash
168
+ extty # open the TUI
169
+ extty pull [project/[run]]
170
+ extty push [project/[run]]
171
+ extty sync project/run # pull, then push
172
+ extty prune local # delete local checkpoints/artifacts that S3 has
173
+ ```
174
+
175
+ `-n`/`--dry-run` previews, and `-f`/`--force` overwrites instead of merging.
176
+ From Python: `extty.push("my-project/", dry_run=True)`.
177
+
178
+ ## Where data is stored
179
+
180
+ Runs, checkpoints, the artifact cache and the S3 config all live under
181
+ `~/.extty`. Set `EXTTY_HOME` to move them, e.g. to scratch space on a cluster
182
+ with a small home quota. The SDK and TUI both honor it.
183
+
184
+ ```bash
185
+ export EXTTY_HOME=/scratch/$USER/extty
186
+ ```
extty-0.1.0/README.md ADDED
@@ -0,0 +1,164 @@
1
+ # extty
2
+
3
+ Terminal-first ML experiment tracking: a Python SDK for logging runs and a
4
+ Rust TUI for browsing them.
5
+
6
+ The TUI and S3 are both optional. Runs are stored locally, and the Python SDK
7
+ alone can log and read them. Configure S3 to sync runs to a bucket.
8
+
9
+ ## Install
10
+
11
+ ### Python SDK
12
+
13
+ Requires Python 3.10+.
14
+
15
+ ```bash
16
+ pip install extty # or: uv add extty
17
+ pip install "extty[image]" # adds Image logging
18
+ ```
19
+
20
+ ### TUI
21
+
22
+ Prebuilt binaries for macOS, Linux and Windows are attached to each
23
+ [GitHub release](https://github.com/ekorman/extty/releases). On macOS or
24
+ Linux, set `target` to your platform and extract `extty` onto your `PATH`:
25
+
26
+ ```bash
27
+ # aarch64-apple-darwin, x86_64-apple-darwin,
28
+ # x86_64-unknown-linux-gnu or aarch64-unknown-linux-gnu
29
+ target=aarch64-apple-darwin
30
+ mkdir -p ~/.local/bin
31
+ curl -LsSf "https://github.com/ekorman/extty/releases/latest/download/extty-$target.tar.xz" \
32
+ | tar xJ --strip-components=1 -C ~/.local/bin "extty-$target/extty"
33
+ ```
34
+
35
+ On Windows, download `extty-x86_64-pc-windows-msvc.zip` from the release and
36
+ put `extty.exe` on your `PATH`.
37
+
38
+ To build from source instead:
39
+
40
+ ```bash
41
+ cargo install --locked --git https://github.com/ekorman/extty extty
42
+ ```
43
+
44
+ ## Logging
45
+
46
+ ```python
47
+ import extty
48
+
49
+ extty.init("my-project", name="run-1", config={"lr": 1e-3})
50
+ extty.log({"train/loss": 0.5}, step=0)
51
+ extty.finish()
52
+ ```
53
+
54
+ The value's type decides how it is stored and rendered. Use `/` in names to
55
+ group streams (`train/loss`, `val/loss`).
56
+
57
+ | Type | For | TUI |
58
+ | --- | --- | --- |
59
+ | `float` / `int` | scalar metrics | line chart |
60
+ | `Example` / `BatchExample` | prompt/response pairs, with optional rewards (float or dict of components) and groundtruth | text browser |
61
+ | `ConfusionMatrix` | N×N counts, rows = true class | matrix |
62
+ | `Chart` | `(x, y)` curves such as ROC or PR | plot; `v` toggles a table |
63
+ | `Image` | a `PIL.Image`, stored as PNG; needs `extty[image]` | inline on kitty/iTerm2/sixel; `o` opens externally |
64
+
65
+ ```python
66
+ extty.log(
67
+ {
68
+ "train/loss": loss,
69
+ "val/samples": extty.Example(
70
+ prompt="Capital of France?",
71
+ responses=["Paris", "Lyon"],
72
+ rewards=[1.0, 0.0],
73
+ groundtruth="Paris",
74
+ ),
75
+ "eval/cm": extty.ConfusionMatrix.from_array(cm, labels=["cat", "dog"]),
76
+ "eval/roc": extty.Chart.from_arrays(fpr, tpr, ("fpr", "tpr")),
77
+ "val/detections": extty.Image(frame, caption="epoch 3"),
78
+ },
79
+ step=step,
80
+ )
81
+ ```
82
+
83
+ `BatchExample` takes parallel lists, one entry per prompt. `from_array` and
84
+ `from_arrays` accept numpy or torch arrays.
85
+
86
+ In the TUI run view, focus a card with Enter and scrub through steps with
87
+ `↑↓` (Shift jumps 10).
88
+
89
+ ## Reading runs
90
+
91
+ ```python
92
+ run = extty.get_run("my-project", "run-1")
93
+ run.metric_names
94
+ run.metric("train/loss") # [MetricPoint(step, timestamp, value), ...]
95
+ run.examples("val/samples")
96
+ run.confusion_matrix("eval/cm")
97
+ run.chart("eval/roc")
98
+ run.image_bytes(run.images("val/detections")[-1])
99
+ ```
100
+
101
+ With S3 configured, `get_run` reads a run straight from S3 if it isn't local.
102
+
103
+ ## Checkpoints
104
+
105
+ ```python
106
+ extty.save_checkpoint(step, state_dict=model.state_dict(), optimizer_state_dict=opt.state_dict())
107
+ extty.save_checkpoint(step, path="ckpt.pt") # or a file written by torch.save
108
+
109
+ ckpt = extty.load_checkpoint(step) # active run
110
+ ckpt = extty.load_checkpoint_from("my-project", "run-1", step) # any run
111
+ model.load_state_dict(ckpt["model_state_dict"])
112
+ ```
113
+
114
+ Checkpoints are saved in the run directory, so they work without S3. With S3
115
+ configured they are uploaded instead, and kept locally only with
116
+ `keep_local=True` or if the upload fails. Loads use a complete local copy when
117
+ there is one and download from S3 otherwise. `extty push` does not upload
118
+ checkpoints.
119
+
120
+ `extty.delete_local_checkpoint(project, run, step)` and `extty prune local`
121
+ free disk by deleting local copies that S3 also has. Neither deletes a
122
+ checkpoint's only copy unless you pass `force=True` to
123
+ `delete_local_checkpoint`.
124
+
125
+ ## S3 sync (optional)
126
+
127
+ Configure S3 in `~/.extty/s3/config.toml`, which both the SDK and TUI read:
128
+
129
+ ```toml
130
+ bucket = "my-bucket"
131
+ prefix = "extty" # optional
132
+ region = "us-west-2" # optional
133
+ access_key_id = "..." # optional, defaults to the AWS credential chain
134
+ secret_access_key = "..."
135
+ endpoint_url = "..." # optional, for MinIO etc.
136
+ ```
137
+
138
+ The SDK also accepts `EXTTY_S3_BUCKET`, `EXTTY_S3_PREFIX`, `EXTTY_S3_REGION`,
139
+ `EXTTY_S3_ACCESS_KEY_ID`, `EXTTY_S3_SECRET_ACCESS_KEY` and
140
+ `EXTTY_S3_ENDPOINT_URL`, which take precedence over the file. Once configured,
141
+ runs sync to S3 as they log. Without it, the SDK makes no network requests.
142
+
143
+ With the TUI installed:
144
+
145
+ ```bash
146
+ extty # open the TUI
147
+ extty pull [project/[run]]
148
+ extty push [project/[run]]
149
+ extty sync project/run # pull, then push
150
+ extty prune local # delete local checkpoints/artifacts that S3 has
151
+ ```
152
+
153
+ `-n`/`--dry-run` previews, and `-f`/`--force` overwrites instead of merging.
154
+ From Python: `extty.push("my-project/", dry_run=True)`.
155
+
156
+ ## Where data is stored
157
+
158
+ Runs, checkpoints, the artifact cache and the S3 config all live under
159
+ `~/.extty`. Set `EXTTY_HOME` to move them, e.g. to scratch space on a cluster
160
+ with a small home quota. The SDK and TUI both honor it.
161
+
162
+ ```bash
163
+ export EXTTY_HOME=/scratch/$USER/extty
164
+ ```