agenticml-lite 1.0.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.
- agenticml_lite-1.0.0/LICENSE +21 -0
- agenticml_lite-1.0.0/PKG-INFO +283 -0
- agenticml_lite-1.0.0/README.md +243 -0
- agenticml_lite-1.0.0/pyproject.toml +68 -0
- agenticml_lite-1.0.0/setup.cfg +4 -0
- agenticml_lite-1.0.0/src/agenticml/__init__.py +63 -0
- agenticml_lite-1.0.0/src/agenticml/__main__.py +5 -0
- agenticml_lite-1.0.0/src/agenticml/_frame_inspect.py +499 -0
- agenticml_lite-1.0.0/src/agenticml/_globals.py +308 -0
- agenticml_lite-1.0.0/src/agenticml/_import_hooks.py +127 -0
- agenticml_lite-1.0.0/src/agenticml/_source_inspect.py +253 -0
- agenticml_lite-1.0.0/src/agenticml/auth.py +314 -0
- agenticml_lite-1.0.0/src/agenticml/auto_metrics.py +160 -0
- agenticml_lite-1.0.0/src/agenticml/auto_tracking.py +998 -0
- agenticml_lite-1.0.0/src/agenticml/cli.py +611 -0
- agenticml_lite-1.0.0/src/agenticml/client.py +382 -0
- agenticml_lite-1.0.0/src/agenticml/code_tracking.py +614 -0
- agenticml_lite-1.0.0/src/agenticml/component_tracking.py +640 -0
- agenticml_lite-1.0.0/src/agenticml/distributed.py +35 -0
- agenticml_lite-1.0.0/src/agenticml/env.py +51 -0
- agenticml_lite-1.0.0/src/agenticml/ignore.py +118 -0
- agenticml_lite-1.0.0/src/agenticml/integrations/__init__.py +1 -0
- agenticml_lite-1.0.0/src/agenticml/integrations/hyperparams.py +265 -0
- agenticml_lite-1.0.0/src/agenticml/integrations/tensorboard.py +245 -0
- agenticml_lite-1.0.0/src/agenticml/launch.py +343 -0
- agenticml_lite-1.0.0/src/agenticml/lineage.py +522 -0
- agenticml_lite-1.0.0/src/agenticml/media.py +141 -0
- agenticml_lite-1.0.0/src/agenticml/model_tracking.py +245 -0
- agenticml_lite-1.0.0/src/agenticml/run.py +1386 -0
- agenticml_lite-1.0.0/src/agenticml/store/__init__.py +54 -0
- agenticml_lite-1.0.0/src/agenticml/store/gc.py +648 -0
- agenticml_lite-1.0.0/src/agenticml/store/layout.py +463 -0
- agenticml_lite-1.0.0/src/agenticml/store/notes.py +700 -0
- agenticml_lite-1.0.0/src/agenticml/store/objects.py +115 -0
- agenticml_lite-1.0.0/src/agenticml/store/overview.py +440 -0
- agenticml_lite-1.0.0/src/agenticml/store/reader.py +882 -0
- agenticml_lite-1.0.0/src/agenticml/store/writer.py +1203 -0
- agenticml_lite-1.0.0/src/agenticml/sync.py +1113 -0
- agenticml_lite-1.0.0/src/agenticml/system_metrics.py +151 -0
- agenticml_lite-1.0.0/src/agenticml/ui/__init__.py +7 -0
- agenticml_lite-1.0.0/src/agenticml/ui/server.py +1739 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/InstrumentSans.OFL.txt +93 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/InstrumentSans.woff2 +0 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/JetBrainsMono.OFL.txt +93 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/JetBrainsMono.woff2 +0 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/app.css +3109 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/app.js +3570 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/charts.js +427 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/code.js +777 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/codediff.js +471 -0
- agenticml_lite-1.0.0/src/agenticml/ui/static/index.html +29 -0
- agenticml_lite-1.0.0/src/agenticml_lite.egg-info/PKG-INFO +283 -0
- agenticml_lite-1.0.0/src/agenticml_lite.egg-info/SOURCES.txt +80 -0
- agenticml_lite-1.0.0/src/agenticml_lite.egg-info/dependency_links.txt +1 -0
- agenticml_lite-1.0.0/src/agenticml_lite.egg-info/entry_points.txt +2 -0
- agenticml_lite-1.0.0/src/agenticml_lite.egg-info/requires.txt +18 -0
- agenticml_lite-1.0.0/src/agenticml_lite.egg-info/top_level.txt +1 -0
- agenticml_lite-1.0.0/tests/test_auth.py +421 -0
- agenticml_lite-1.0.0/tests/test_auto_metrics.py +213 -0
- agenticml_lite-1.0.0/tests/test_auto_tracking.py +359 -0
- agenticml_lite-1.0.0/tests/test_client.py +448 -0
- agenticml_lite-1.0.0/tests/test_code_tracking.py +337 -0
- agenticml_lite-1.0.0/tests/test_component_tracking.py +458 -0
- agenticml_lite-1.0.0/tests/test_frame_inspect.py +129 -0
- agenticml_lite-1.0.0/tests/test_gc.py +607 -0
- agenticml_lite-1.0.0/tests/test_hyperparams.py +151 -0
- agenticml_lite-1.0.0/tests/test_import_hooks.py +59 -0
- agenticml_lite-1.0.0/tests/test_launch.py +1074 -0
- agenticml_lite-1.0.0/tests/test_lineage.py +1036 -0
- agenticml_lite-1.0.0/tests/test_local_cli.py +255 -0
- agenticml_lite-1.0.0/tests/test_model_tracking.py +315 -0
- agenticml_lite-1.0.0/tests/test_notes.py +987 -0
- agenticml_lite-1.0.0/tests/test_review_fixes.py +410 -0
- agenticml_lite-1.0.0/tests/test_run_invariants.py +1211 -0
- agenticml_lite-1.0.0/tests/test_run_storage.py +432 -0
- agenticml_lite-1.0.0/tests/test_smoke.py +183 -0
- agenticml_lite-1.0.0/tests/test_store.py +2210 -0
- agenticml_lite-1.0.0/tests/test_store_overview.py +229 -0
- agenticml_lite-1.0.0/tests/test_sync.py +1436 -0
- agenticml_lite-1.0.0/tests/test_tensorboard_sync.py +205 -0
- agenticml_lite-1.0.0/tests/test_ui.py +2972 -0
- agenticml_lite-1.0.0/tests/test_ui_limits.py +574 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgenticML
|
|
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,283 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agenticml-lite
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Lean, local-first experiment tracker for AgenticML. Installs as `agenticml-lite`, imports as `agenticml`.
|
|
5
|
+
Author-email: Gaurav Singh <gaurav.singh@agenticml.xyz>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://agenticml.xyz
|
|
8
|
+
Project-URL: Documentation, https://agenticml.github.io/agenticml-lite/
|
|
9
|
+
Project-URL: Source, https://github.com/agenticML/agenticml-lite
|
|
10
|
+
Project-URL: Issues, https://github.com/agenticML/agenticml-lite/issues
|
|
11
|
+
Keywords: mlops,experiment-tracking,machine-learning,agentic
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: requests>=2.31
|
|
26
|
+
Provides-Extra: system
|
|
27
|
+
Requires-Dist: psutil>=5.9; extra == "system"
|
|
28
|
+
Provides-Extra: gpu
|
|
29
|
+
Requires-Dist: nvidia-ml-py>=12; extra == "gpu"
|
|
30
|
+
Provides-Extra: media
|
|
31
|
+
Requires-Dist: Pillow>=10.0; extra == "media"
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
34
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
35
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
36
|
+
Requires-Dist: psutil>=5.9; extra == "dev"
|
|
37
|
+
Requires-Dist: Pillow>=10.0; extra == "dev"
|
|
38
|
+
Requires-Dist: responses>=0.24; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# agenticml-lite
|
|
42
|
+
|
|
43
|
+
agenticml-lite is a local-first experiment tracker. Training writes metrics, config, code, and media to files on disk, and `agenticml ui` serves a TensorBoard-style dashboard from those files. There is no server, database, or Docker image to run. Upload to [AgenticML](https://agenticml.xyz) is optional, with `agenticml login` and `agenticml sync`. Install the package as `agenticml-lite` and import it as `agenticml`. The API is pre-alpha (`0.1.0.dev0`).
|
|
44
|
+
|
|
45
|
+
Documentation: <https://agenticml.github.io/agenticml-lite/>
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install agenticml-lite
|
|
51
|
+
|
|
52
|
+
pip install "agenticml-lite[system]" # psutil: CPU, memory, disk
|
|
53
|
+
pip install "agenticml-lite[gpu]" # NVIDIA GPU metrics via pynvml
|
|
54
|
+
pip install "agenticml-lite[media]" # Pillow, for numpy and PIL images
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quickstart
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import agenticml
|
|
61
|
+
|
|
62
|
+
agenticml.init(
|
|
63
|
+
project="demo",
|
|
64
|
+
name="exp1",
|
|
65
|
+
config={"learning_rate": 0.01, "epochs": 10},
|
|
66
|
+
tags=["baseline"],
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
for step in range(10):
|
|
70
|
+
agenticml.log({"loss": 1 / (step + 1), "accuracy": step / 10}, step=step)
|
|
71
|
+
|
|
72
|
+
agenticml.summary["best_loss"] = 0.1
|
|
73
|
+
agenticml.finish()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`init(project, name, ...)` starts the one active run. Omit `project` and it defaults to the repository or directory name (`AGENTICML_PROJECT` overrides that; an explicit project wins). Omit `name` and it defaults to the main script's path relative to the repo root (e.g. `scripts/train.py`), or its absolute path outside a repo (empty without a main file). `log` advances the step when `step` is omitted; `commit=False` merges later metrics into the same step. `config` and `summary` are dicts on the active run. `init(verbose=True)` prints the run id, the run directory, and the `agenticml ui` command.
|
|
77
|
+
|
|
78
|
+
`init` also turns on runtime code snapshots and PyTorch component detection (`auto_track=True`). Automatic loss / learning-rate / epoch metrics and TensorBoard mirroring stay off until you pass `auto_metrics=True` and `sync_tensorboard=True`. System metrics are on (every 10 seconds) when `psutil` is installed; `system_metrics=False` disables them.
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
agenticml.log({"pred": agenticml.Image("pred.png", caption="val")})
|
|
82
|
+
agenticml.log_artifact("model.pt", name="checkpoint") # reference
|
|
83
|
+
agenticml.log_artifact("model.pt", name="checkpoint", copy=True) # snapshot bytes
|
|
84
|
+
agenticml.track_model(model) # after the object exists
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`Image` accepts a path, bytes, a file object, a PIL image, or a numpy array. Numpy arrays and PIL images need the `media` extra. `track_optimizer`, `track_loss`, and `track_dataloader` work the same way as `track_model`.
|
|
88
|
+
|
|
89
|
+
## Zero-code
|
|
90
|
+
|
|
91
|
+
`agenticml run` executes a script inside a run. The script can omit `import agenticml`.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
agenticml run --project demo -- python train.py --lr 1e-3
|
|
95
|
+
agenticml python train.py --lr 1e-3 # same interpreter, or re-exec
|
|
96
|
+
agenticml run -m mypkg.train --epochs 3
|
|
97
|
+
agenticml run -- python examples/train_toy.py --lr 0.05 --epochs 5
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Command forms
|
|
101
|
+
|
|
102
|
+
There are several ways to write the same launch. All of them run the target in-process as `__main__` inside one tracked run. The `run` forms take agenticml options; the bare `agenticml python` form does not, so set `AGENTICML_*` environment variables there. They differ in how you name the interpreter and the target, so pick the one that matches how you already start training.
|
|
103
|
+
|
|
104
|
+
| Form | Use it when | Equivalent to |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| `agenticml run train.py [args]` | You just want to track a script with the current interpreter. Shortest form. | `agenticml run -- python train.py [args]` |
|
|
107
|
+
| `agenticml run -m pkg.train [args]` | Your entry point is a module (`python -m pkg.train`), so relative imports and package layout keep working. | `agenticml run -- python -m pkg.train [args]` |
|
|
108
|
+
| `agenticml run -- python train.py [args]` | You are wrapping an existing command line, for example from a Makefile, a shell script or a README. Swap `python` for `agenticml run --` and nothing else changes. | `agenticml python train.py [args]` |
|
|
109
|
+
| `agenticml python train.py [args]` | You want the least typing and no `run` or `--`. It reads as "python, but tracked". Options come from `AGENTICML_*` variables. | `agenticml run -- python train.py [args]` |
|
|
110
|
+
| `agenticml run --project demo -- python -u train.py` | You need Python flags (`-u`, `-X`, `-W`, ...) or a specific interpreter such as `python3.11` or a venv's `python`. Agenticml re-launches itself under that interpreter, so `agenticml-lite` must be installed there. | `agenticml python -u train.py` (options via env vars) |
|
|
111
|
+
| `python -m agenticml run train.py` | `agenticml` is not on `PATH` (for example inside `torchrun`, `accelerate launch`, or a scheduler that takes a Python command). | `agenticml run train.py` |
|
|
112
|
+
|
|
113
|
+
Rules that apply to every form:
|
|
114
|
+
|
|
115
|
+
- Agenticml options (`--project`, `--name`, ...) must come before the script or module. Everything after the target is the script's own argv, passed through untouched.
|
|
116
|
+
- With `run`, the `--` separator is optional when the target is a bare script or `-m` module. It is needed in front of `python ...` so that the options before it are not read as Python flags.
|
|
117
|
+
- The default run name is the script's repo-relative path (e.g. `scripts/train.py`), or the module's file path for `-m`, unless `--name` is given.
|
|
118
|
+
- `python -c "..."` and reading the script from stdin are not supported. Put the code in a file.
|
|
119
|
+
- Only Python targets are supported. To track a shell script, call `agenticml run -- python ...` from inside it.
|
|
120
|
+
- Multi-GPU: launch as `torchrun ... -m agenticml run -- train.py`. Only rank 0 logs.
|
|
121
|
+
|
|
122
|
+
Options go before the script; everything after it is the script's own argv. See `agenticml run -h`. `--project`, `--name`, `--tags`, `--notes`, `--group`, `--job-type`, `--mode`, `--dir`, and `--log-every` read `AGENTICML_PROJECT`, `AGENTICML_NAME`, `AGENTICML_TAGS`, `AGENTICML_NOTES`, `AGENTICML_GROUP`, `AGENTICML_JOB_TYPE`, `AGENTICML_MODE`, `AGENTICML_DIR`, and `AGENTICML_LOG_EVERY`. The off switches are in the table. `--verbose` has no variable.
|
|
123
|
+
|
|
124
|
+
`--task` sets the run's task and overrides `AGENTICML_TASK`, the parent's task, an `agenticml.toml` `task`, and the entry script's folder (see [docs/SDK.md](docs/SDK.md)). With an explicit parent that is readable, in the same project, and has a task, a differing `--task` or valid `AGENTICML_TASK` logs a warning that the lineage link crosses tasks. `--allow-cross-task` or `AGENTICML_ALLOW_CROSS_TASK=1` silences it.
|
|
125
|
+
|
|
126
|
+
`--parent RUN_ID` (env `AGENTICML_PARENT`) selects an explicit lineage parent. New runs inherit the parent's task unless `--task` or a valid `AGENTICML_TASK` supplies one. A parent in another project is recorded, but its task is not inherited. An invalid `--parent` / `AGENTICML_PARENT` is a usage error (exit 2). `--parent` only applies to new runs: a resumed run keeps its stored parent, with a warning if it differs.
|
|
127
|
+
|
|
128
|
+
| What | Where it comes from | Turn off |
|
|
129
|
+
| --- | --- | --- |
|
|
130
|
+
| Config | `argparse` parses of `sys.argv`, and `@hydra.main` | `--no-capture-args` (`AGENTICML_CAPTURE_ARGS=0`) |
|
|
131
|
+
| Code snapshot | imported project modules and files opened for reading | always on under `agenticml run` (`track_source=False` on `Run`) |
|
|
132
|
+
| Model, optimizer, loss, dataloader | PyTorch construction hooks | `--no-auto-track` (`AGENTICML_AUTO_TRACK=0`) |
|
|
133
|
+
| `auto/loss`, `auto/lr`, `auto/epoch` | `backward()` and `optimizer.step()` | `--no-auto-metrics` (`AGENTICML_AUTO_METRICS=0`); `--log-every N` |
|
|
134
|
+
| TensorBoard | `SummaryWriter` / `tensorboardX` (scalars, images, figures, hparams) | `--no-tensorboard` (`AGENTICML_SYNC_TENSORBOARD=0`) |
|
|
135
|
+
| System metrics | psutil, plus pynvml when installed | always requested under `agenticml run` (needs the `system` extra) |
|
|
136
|
+
|
|
137
|
+
Loss is unscaled under `GradScaler` and averaged over gradient-accumulation steps. Several optimizers are prefixed (`auto/<name>/loss`, `auto/<name>/lr`); `auto/epoch` stays unprefixed. TensorBoard event files are still written. Keys passed to `init(config=...)` win over captured hyperparameters.
|
|
138
|
+
|
|
139
|
+
A script that calls `agenticml.init()` joins the launcher's run. Exit 0 finishes as `finished`; any other exit finishes as `crashed`, with `_exit_code` and `_exception` in the summary. The script's exit code is preserved. SIGTERM finishes the run and exits 143.
|
|
140
|
+
|
|
141
|
+
The zero-code toy example captures config, code and system information, but no training metrics: its pure-Python loop has no framework hooks. `examples/train_toy.py --explicit` is the same loop calling the Python API itself to log metrics. See [examples/README.md](examples/README.md).
|
|
142
|
+
|
|
143
|
+
## Viewing
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
agenticml ui # http://127.0.0.1:6006
|
|
147
|
+
agenticml ls # newest first
|
|
148
|
+
agenticml ui --open --port 6006 --host 127.0.0.1
|
|
149
|
+
agenticml ui --read-only
|
|
150
|
+
agenticml ls --project demo --json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`agenticml ui` binds to `127.0.0.1` and port 6006. On loopback it answers only loopback `Host` headers. `--dir` selects the store (else `AGENTICML_DIR`, else `~/.agenticml`). `ls` prints run id, project, name, status, created time, and last step. A run stays `running` while its lifetime lock is held, even when it logs infrequently. If the lock is free, it is shown as `crashed`; sync finalizes it with `_exit_reason: "process died"`. On filesystems without locking, mtimes older than 120 seconds are the fallback for `stale` status.
|
|
154
|
+
|
|
155
|
+
The dashboard pages do not show run notes. Launch notes (`--notes` / `init(notes=)`) are still stored with the run, and the server keeps the `/api/runs/<id>/notes` endpoint, which is the only write it accepts; `--read-only` disables it (recommended when exposing a non-loopback `--host`).
|
|
156
|
+
|
|
157
|
+
## Where data lives
|
|
158
|
+
|
|
159
|
+
The store root is `init(dir=...)`, else `AGENTICML_DIR`, else `~/.agenticml`. Layout (details in [docs/FORMAT.md](docs/FORMAT.md)):
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
<root>/
|
|
163
|
+
objects/<hh>/<sha256> content-addressed bytes, shared by every run
|
|
164
|
+
runs/<run_id>/
|
|
165
|
+
meta.json project, config, status, summary, env, git
|
|
166
|
+
events.jsonl config updates, code, artifacts, finish
|
|
167
|
+
notes.md run note (Markdown, up to 256 KiB)
|
|
168
|
+
sync.json per-host upload cursor, after a sync
|
|
169
|
+
scalars/<id>.bin 8 bytes per point: uint32 step, float32 value
|
|
170
|
+
scalars/<id>.ovw overview, at finish, if the series has > 65536 points
|
|
171
|
+
scalars/_time.bin one record per scalar flush
|
|
172
|
+
scalars/index.json
|
|
173
|
+
media/index.json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
New run ids look like `20261027T021500-ab12cd34` (UTC). Each scalar point is 8 bytes in `<id>.bin`. An overview is written at finish only when a series has more than 65,536 points, and it is at most 40 + 36×2048 = 73,768 bytes. Worst-case overview overhead is about 14% of the raw series (the 73,768-byte cap next to a 65,537-point `<id>.bin`); the share falls as the series grows, to about 0.6 B/pt past ~120,000 points. At or below 65,536 points the reader builds the overview from `<id>.bin` on demand. TensorBoard tfevents are ~51 B/pt, and the old JSONL journal was ~57 B/pt.
|
|
177
|
+
|
|
178
|
+
Code snapshots and media are stored once, keyed by SHA-256. The same bytes logged again share one object. Default snapshot caps are 10 MB per file and 100 MB total. Media indexes retain at most 64 rows per key by default, thinning older rows as new media arrives (`AGENTICML_MEDIA_MAX_PER_KEY` overrides the cap). Artifacts are a path, size, and mtime unless `copy=True`, which hashes the bytes into `objects/`.
|
|
179
|
+
|
|
180
|
+
## Disk
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
agenticml du
|
|
184
|
+
agenticml gc --dry-run
|
|
185
|
+
agenticml gc --older-than DAYS --keep-last N
|
|
186
|
+
agenticml gc --include-unsynced
|
|
187
|
+
agenticml sync --all --prune
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`agenticml du` reports how much space the local store uses. `agenticml gc` removes runs. Only synced runs are eligible unless you pass `--include-unsynced`. `--older-than` and `--keep-last` narrow the set. `--dry-run` prints the plan and deletes nothing. `agenticml sync --prune` drops raw `<id>.bin` files for series that already have an overview; series of 65,536 points or fewer keep their `.bin` (≤ 512 KB each). A pruned run cannot be resumed or synced to another host, or uploaded again after `sync --reset`. Unreferenced objects have a one-hour grace period before gc removes them. Agenticml warns when the store exceeds `AGENTICML_MAX_BYTES` (default 5 GiB).
|
|
191
|
+
|
|
192
|
+
## Upload
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
agenticml login --host https://api.agenticml.xyz
|
|
196
|
+
agenticml whoami
|
|
197
|
+
agenticml logout
|
|
198
|
+
agenticml sync RUN_ID [RUN_ID ...]
|
|
199
|
+
agenticml sync --all
|
|
200
|
+
agenticml sync --all --watch 30 --dry-run
|
|
201
|
+
agenticml sync RUN_ID --reset
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
`login` checks the key (skip with `--no-verify`) and writes `~/.config/agenticml/credentials.json` at mode `0600`. The directory is `AGENTICML_CONFIG_DIR`, else `$XDG_CONFIG_HOME/agenticml`, else `~/.config/agenticml`. The default host is `https://api.agenticml.xyz`. Use the `agenticml login` prompt to enter the key, or `AGENTICML_API_KEY` for sync. Avoid command-line `--key` / `--api-key`: their values are visible in `ps`. `login` also accepts stdin. `sync` takes the key from `--api-key`, then `AGENTICML_API_KEY`, then the file. `whoami` uses `AGENTICML_API_KEY`, then the file. `whoami --offline` skips the server check. `logout` removes the saved key for one host. On `login`, `whoami`, and `sync`, `--insecure` allows `http://` to a non-local host; localhost does not need it.
|
|
205
|
+
|
|
206
|
+
Sync is incremental and resumable. A cursor in `runs/<id>/sync.json` stores scalar byte offsets and which code, media, and artifacts were sent. An interrupted sync retries at most the in-flight batch. `--all` selects runs that are incomplete or changed. `--watch N` repeats every N seconds until every selected run has synced, failed permanently, or gone stale. `--dry-run` prints counts without sending or saving state. `--reset` clears the saved remote id for explicit run ids on this host, and it rejects `--all`.
|
|
207
|
+
|
|
208
|
+
Uploaded: project, name, config, tags, notes, group, job type, env, git, the parent's remote id, finite scalar points, code files, media, artifacts, and the summary plus status at finalize. `copy=True` artifacts come from the object store. By-reference artifacts are read from the logged path when it is still a regular file with the same size and mtime.
|
|
209
|
+
|
|
210
|
+
Server-side gaps: `created_at` and `finished_at` are stamped by the server at sync time. Config keys cannot be deleted remotely, and `group` / `job_type` cannot be cleared (a null is omitted and the stored value stays).
|
|
211
|
+
|
|
212
|
+
## Configuration
|
|
213
|
+
|
|
214
|
+
| Variable | Default | Purpose |
|
|
215
|
+
| --- | --- | --- |
|
|
216
|
+
| `AGENTICML_DIR` | `~/.agenticml` | Store root. `init(dir=)` and `--dir` win. |
|
|
217
|
+
| `AGENTICML_MODE` | `local` | `local`, `offline` (alias of `local`), or `disabled`. Other values warn and use `local`. |
|
|
218
|
+
| `AGENTICML_HOST` | `https://api.agenticml.xyz` | Server for `login`, `whoami`, and `sync`. |
|
|
219
|
+
| `AGENTICML_API_KEY` | unset | Key for `sync` and `whoami`. `login` ignores it. |
|
|
220
|
+
| `AGENTICML_CONFIG_DIR` | `~/.config/agenticml` | Credential directory. Wins over `XDG_CONFIG_HOME`. |
|
|
221
|
+
| `AGENTICML_MAX_BYTES` | 5 GiB | Warn when the local store is larger than this. Nothing is deleted automatically. |
|
|
222
|
+
| `AGENTICML_MEDIA_MAX_PER_KEY` | `64` | Media index rows kept per key. Further rows are thinned by step. |
|
|
223
|
+
| `AGENTICML_MEDIA_MAX_PX` | `1024` | Longest side of a logged image, when Pillow is installed. |
|
|
224
|
+
|
|
225
|
+
`agenticml run` settings use the variables listed under [Zero-code](#zero-code). Boolean switches treat `0`, `false`, `no`, and `off` as off.
|
|
226
|
+
|
|
227
|
+
## Performance
|
|
228
|
+
|
|
229
|
+
From `python scripts/bench.py --quick` on one machine. Timings and bytes/point move with CPU, disk, and Python.
|
|
230
|
+
|
|
231
|
+
| Metric | This run | Target |
|
|
232
|
+
| --- | --- | --- |
|
|
233
|
+
| `import agenticml` (median of 5) | 39.4 ms | < 100 ms |
|
|
234
|
+
| `log()` ×10 scalars, median (10,000 calls) | 2.70 µs | < 10 µs |
|
|
235
|
+
| `log()` ×10 scalars, p99 | 8.91 µs | |
|
|
236
|
+
| disk, whole `scalars/` dir (100,000 points) | 8.01 B/pt | ≤ 9.0 B/pt (8 B raw + overview) |
|
|
237
|
+
| UI cold start, `/api/runs` (101 runs) | 8 ms | < 1 s |
|
|
238
|
+
| scalar request, 100,000-point series (median of 20) | 14.16 ms | < 20 ms |
|
|
239
|
+
| TensorBoard tfevents | not installed | |
|
|
240
|
+
|
|
241
|
+
The disk row is ten series of 10,000 points. Each series is under 65,536 points, so finish writes no overview and the directory stays at 8.01 B/pt, inside the 9.0 B/pt check. A series past 65,536 points adds one overview of at most 73,768 bytes. `python scripts/bench.py` without `--quick` uses 100,000 log calls, a 1,000,000-point run, and 1,000 small runs.
|
|
242
|
+
|
|
243
|
+
## Distributed, resume, disabled
|
|
244
|
+
|
|
245
|
+
Rank 0 logs. `init(only_main_process=True)` (the default) gives every other rank a no-op run, using `RANK`, `PMI_RANK`, `OMPI_COMM_WORLD_RANK`, `SLURM_PROCID`, then `LOCAL_RANK`. Put the tracker inside the launcher so every rank runs the script:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
torchrun --nproc_per_node 4 -m agenticml run -- train.py
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Resume with the same id. `resume="must"` errors if it is missing; `resume="allow"` opens it or creates it. The default `resume="never"` rejects an `id`. A pruned run (overview present, raw series file gone) cannot be resumed.
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
agenticml.init(project="demo", name="exp1", id=run_id, resume="allow")
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
`mode="disabled"` or `AGENTICML_MODE=disabled` makes `log`, `finish`, artifacts, and the `track_*` helpers no-ops. With `verbose=True`, init prints `agenticml: tracking disabled`.
|
|
258
|
+
|
|
259
|
+
## Development
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
pip install -e ".[dev]"
|
|
263
|
+
pytest
|
|
264
|
+
python scripts/bench.py --quick
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Releasing
|
|
268
|
+
|
|
269
|
+
GitHub Actions publishes to PyPI with Trusted Publishing (no API tokens).
|
|
270
|
+
|
|
271
|
+
- **TestPyPI dry run:** run the "Publish to TestPyPI" workflow by hand from the Actions tab. Re-running with a version that is already there is a no-op.
|
|
272
|
+
- **PyPI:** push a `v*` tag. The workflow fails if the tag does not match the version in `pyproject.toml` and `src/agenticml/__init__.py`.
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# bump version in pyproject.toml and src/agenticml/__init__.py
|
|
276
|
+
git commit -am "release: v0.1.0"
|
|
277
|
+
git tag v0.1.0
|
|
278
|
+
git push origin v0.1.0
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## License
|
|
282
|
+
|
|
283
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# agenticml-lite
|
|
2
|
+
|
|
3
|
+
agenticml-lite is a local-first experiment tracker. Training writes metrics, config, code, and media to files on disk, and `agenticml ui` serves a TensorBoard-style dashboard from those files. There is no server, database, or Docker image to run. Upload to [AgenticML](https://agenticml.xyz) is optional, with `agenticml login` and `agenticml sync`. Install the package as `agenticml-lite` and import it as `agenticml`. The API is pre-alpha (`0.1.0.dev0`).
|
|
4
|
+
|
|
5
|
+
Documentation: <https://agenticml.github.io/agenticml-lite/>
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install agenticml-lite
|
|
11
|
+
|
|
12
|
+
pip install "agenticml-lite[system]" # psutil: CPU, memory, disk
|
|
13
|
+
pip install "agenticml-lite[gpu]" # NVIDIA GPU metrics via pynvml
|
|
14
|
+
pip install "agenticml-lite[media]" # Pillow, for numpy and PIL images
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
import agenticml
|
|
21
|
+
|
|
22
|
+
agenticml.init(
|
|
23
|
+
project="demo",
|
|
24
|
+
name="exp1",
|
|
25
|
+
config={"learning_rate": 0.01, "epochs": 10},
|
|
26
|
+
tags=["baseline"],
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
for step in range(10):
|
|
30
|
+
agenticml.log({"loss": 1 / (step + 1), "accuracy": step / 10}, step=step)
|
|
31
|
+
|
|
32
|
+
agenticml.summary["best_loss"] = 0.1
|
|
33
|
+
agenticml.finish()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`init(project, name, ...)` starts the one active run. Omit `project` and it defaults to the repository or directory name (`AGENTICML_PROJECT` overrides that; an explicit project wins). Omit `name` and it defaults to the main script's path relative to the repo root (e.g. `scripts/train.py`), or its absolute path outside a repo (empty without a main file). `log` advances the step when `step` is omitted; `commit=False` merges later metrics into the same step. `config` and `summary` are dicts on the active run. `init(verbose=True)` prints the run id, the run directory, and the `agenticml ui` command.
|
|
37
|
+
|
|
38
|
+
`init` also turns on runtime code snapshots and PyTorch component detection (`auto_track=True`). Automatic loss / learning-rate / epoch metrics and TensorBoard mirroring stay off until you pass `auto_metrics=True` and `sync_tensorboard=True`. System metrics are on (every 10 seconds) when `psutil` is installed; `system_metrics=False` disables them.
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
agenticml.log({"pred": agenticml.Image("pred.png", caption="val")})
|
|
42
|
+
agenticml.log_artifact("model.pt", name="checkpoint") # reference
|
|
43
|
+
agenticml.log_artifact("model.pt", name="checkpoint", copy=True) # snapshot bytes
|
|
44
|
+
agenticml.track_model(model) # after the object exists
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`Image` accepts a path, bytes, a file object, a PIL image, or a numpy array. Numpy arrays and PIL images need the `media` extra. `track_optimizer`, `track_loss`, and `track_dataloader` work the same way as `track_model`.
|
|
48
|
+
|
|
49
|
+
## Zero-code
|
|
50
|
+
|
|
51
|
+
`agenticml run` executes a script inside a run. The script can omit `import agenticml`.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
agenticml run --project demo -- python train.py --lr 1e-3
|
|
55
|
+
agenticml python train.py --lr 1e-3 # same interpreter, or re-exec
|
|
56
|
+
agenticml run -m mypkg.train --epochs 3
|
|
57
|
+
agenticml run -- python examples/train_toy.py --lr 0.05 --epochs 5
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Command forms
|
|
61
|
+
|
|
62
|
+
There are several ways to write the same launch. All of them run the target in-process as `__main__` inside one tracked run. The `run` forms take agenticml options; the bare `agenticml python` form does not, so set `AGENTICML_*` environment variables there. They differ in how you name the interpreter and the target, so pick the one that matches how you already start training.
|
|
63
|
+
|
|
64
|
+
| Form | Use it when | Equivalent to |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `agenticml run train.py [args]` | You just want to track a script with the current interpreter. Shortest form. | `agenticml run -- python train.py [args]` |
|
|
67
|
+
| `agenticml run -m pkg.train [args]` | Your entry point is a module (`python -m pkg.train`), so relative imports and package layout keep working. | `agenticml run -- python -m pkg.train [args]` |
|
|
68
|
+
| `agenticml run -- python train.py [args]` | You are wrapping an existing command line, for example from a Makefile, a shell script or a README. Swap `python` for `agenticml run --` and nothing else changes. | `agenticml python train.py [args]` |
|
|
69
|
+
| `agenticml python train.py [args]` | You want the least typing and no `run` or `--`. It reads as "python, but tracked". Options come from `AGENTICML_*` variables. | `agenticml run -- python train.py [args]` |
|
|
70
|
+
| `agenticml run --project demo -- python -u train.py` | You need Python flags (`-u`, `-X`, `-W`, ...) or a specific interpreter such as `python3.11` or a venv's `python`. Agenticml re-launches itself under that interpreter, so `agenticml-lite` must be installed there. | `agenticml python -u train.py` (options via env vars) |
|
|
71
|
+
| `python -m agenticml run train.py` | `agenticml` is not on `PATH` (for example inside `torchrun`, `accelerate launch`, or a scheduler that takes a Python command). | `agenticml run train.py` |
|
|
72
|
+
|
|
73
|
+
Rules that apply to every form:
|
|
74
|
+
|
|
75
|
+
- Agenticml options (`--project`, `--name`, ...) must come before the script or module. Everything after the target is the script's own argv, passed through untouched.
|
|
76
|
+
- With `run`, the `--` separator is optional when the target is a bare script or `-m` module. It is needed in front of `python ...` so that the options before it are not read as Python flags.
|
|
77
|
+
- The default run name is the script's repo-relative path (e.g. `scripts/train.py`), or the module's file path for `-m`, unless `--name` is given.
|
|
78
|
+
- `python -c "..."` and reading the script from stdin are not supported. Put the code in a file.
|
|
79
|
+
- Only Python targets are supported. To track a shell script, call `agenticml run -- python ...` from inside it.
|
|
80
|
+
- Multi-GPU: launch as `torchrun ... -m agenticml run -- train.py`. Only rank 0 logs.
|
|
81
|
+
|
|
82
|
+
Options go before the script; everything after it is the script's own argv. See `agenticml run -h`. `--project`, `--name`, `--tags`, `--notes`, `--group`, `--job-type`, `--mode`, `--dir`, and `--log-every` read `AGENTICML_PROJECT`, `AGENTICML_NAME`, `AGENTICML_TAGS`, `AGENTICML_NOTES`, `AGENTICML_GROUP`, `AGENTICML_JOB_TYPE`, `AGENTICML_MODE`, `AGENTICML_DIR`, and `AGENTICML_LOG_EVERY`. The off switches are in the table. `--verbose` has no variable.
|
|
83
|
+
|
|
84
|
+
`--task` sets the run's task and overrides `AGENTICML_TASK`, the parent's task, an `agenticml.toml` `task`, and the entry script's folder (see [docs/SDK.md](docs/SDK.md)). With an explicit parent that is readable, in the same project, and has a task, a differing `--task` or valid `AGENTICML_TASK` logs a warning that the lineage link crosses tasks. `--allow-cross-task` or `AGENTICML_ALLOW_CROSS_TASK=1` silences it.
|
|
85
|
+
|
|
86
|
+
`--parent RUN_ID` (env `AGENTICML_PARENT`) selects an explicit lineage parent. New runs inherit the parent's task unless `--task` or a valid `AGENTICML_TASK` supplies one. A parent in another project is recorded, but its task is not inherited. An invalid `--parent` / `AGENTICML_PARENT` is a usage error (exit 2). `--parent` only applies to new runs: a resumed run keeps its stored parent, with a warning if it differs.
|
|
87
|
+
|
|
88
|
+
| What | Where it comes from | Turn off |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| Config | `argparse` parses of `sys.argv`, and `@hydra.main` | `--no-capture-args` (`AGENTICML_CAPTURE_ARGS=0`) |
|
|
91
|
+
| Code snapshot | imported project modules and files opened for reading | always on under `agenticml run` (`track_source=False` on `Run`) |
|
|
92
|
+
| Model, optimizer, loss, dataloader | PyTorch construction hooks | `--no-auto-track` (`AGENTICML_AUTO_TRACK=0`) |
|
|
93
|
+
| `auto/loss`, `auto/lr`, `auto/epoch` | `backward()` and `optimizer.step()` | `--no-auto-metrics` (`AGENTICML_AUTO_METRICS=0`); `--log-every N` |
|
|
94
|
+
| TensorBoard | `SummaryWriter` / `tensorboardX` (scalars, images, figures, hparams) | `--no-tensorboard` (`AGENTICML_SYNC_TENSORBOARD=0`) |
|
|
95
|
+
| System metrics | psutil, plus pynvml when installed | always requested under `agenticml run` (needs the `system` extra) |
|
|
96
|
+
|
|
97
|
+
Loss is unscaled under `GradScaler` and averaged over gradient-accumulation steps. Several optimizers are prefixed (`auto/<name>/loss`, `auto/<name>/lr`); `auto/epoch` stays unprefixed. TensorBoard event files are still written. Keys passed to `init(config=...)` win over captured hyperparameters.
|
|
98
|
+
|
|
99
|
+
A script that calls `agenticml.init()` joins the launcher's run. Exit 0 finishes as `finished`; any other exit finishes as `crashed`, with `_exit_code` and `_exception` in the summary. The script's exit code is preserved. SIGTERM finishes the run and exits 143.
|
|
100
|
+
|
|
101
|
+
The zero-code toy example captures config, code and system information, but no training metrics: its pure-Python loop has no framework hooks. `examples/train_toy.py --explicit` is the same loop calling the Python API itself to log metrics. See [examples/README.md](examples/README.md).
|
|
102
|
+
|
|
103
|
+
## Viewing
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
agenticml ui # http://127.0.0.1:6006
|
|
107
|
+
agenticml ls # newest first
|
|
108
|
+
agenticml ui --open --port 6006 --host 127.0.0.1
|
|
109
|
+
agenticml ui --read-only
|
|
110
|
+
agenticml ls --project demo --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`agenticml ui` binds to `127.0.0.1` and port 6006. On loopback it answers only loopback `Host` headers. `--dir` selects the store (else `AGENTICML_DIR`, else `~/.agenticml`). `ls` prints run id, project, name, status, created time, and last step. A run stays `running` while its lifetime lock is held, even when it logs infrequently. If the lock is free, it is shown as `crashed`; sync finalizes it with `_exit_reason: "process died"`. On filesystems without locking, mtimes older than 120 seconds are the fallback for `stale` status.
|
|
114
|
+
|
|
115
|
+
The dashboard pages do not show run notes. Launch notes (`--notes` / `init(notes=)`) are still stored with the run, and the server keeps the `/api/runs/<id>/notes` endpoint, which is the only write it accepts; `--read-only` disables it (recommended when exposing a non-loopback `--host`).
|
|
116
|
+
|
|
117
|
+
## Where data lives
|
|
118
|
+
|
|
119
|
+
The store root is `init(dir=...)`, else `AGENTICML_DIR`, else `~/.agenticml`. Layout (details in [docs/FORMAT.md](docs/FORMAT.md)):
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
<root>/
|
|
123
|
+
objects/<hh>/<sha256> content-addressed bytes, shared by every run
|
|
124
|
+
runs/<run_id>/
|
|
125
|
+
meta.json project, config, status, summary, env, git
|
|
126
|
+
events.jsonl config updates, code, artifacts, finish
|
|
127
|
+
notes.md run note (Markdown, up to 256 KiB)
|
|
128
|
+
sync.json per-host upload cursor, after a sync
|
|
129
|
+
scalars/<id>.bin 8 bytes per point: uint32 step, float32 value
|
|
130
|
+
scalars/<id>.ovw overview, at finish, if the series has > 65536 points
|
|
131
|
+
scalars/_time.bin one record per scalar flush
|
|
132
|
+
scalars/index.json
|
|
133
|
+
media/index.json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
New run ids look like `20261027T021500-ab12cd34` (UTC). Each scalar point is 8 bytes in `<id>.bin`. An overview is written at finish only when a series has more than 65,536 points, and it is at most 40 + 36×2048 = 73,768 bytes. Worst-case overview overhead is about 14% of the raw series (the 73,768-byte cap next to a 65,537-point `<id>.bin`); the share falls as the series grows, to about 0.6 B/pt past ~120,000 points. At or below 65,536 points the reader builds the overview from `<id>.bin` on demand. TensorBoard tfevents are ~51 B/pt, and the old JSONL journal was ~57 B/pt.
|
|
137
|
+
|
|
138
|
+
Code snapshots and media are stored once, keyed by SHA-256. The same bytes logged again share one object. Default snapshot caps are 10 MB per file and 100 MB total. Media indexes retain at most 64 rows per key by default, thinning older rows as new media arrives (`AGENTICML_MEDIA_MAX_PER_KEY` overrides the cap). Artifacts are a path, size, and mtime unless `copy=True`, which hashes the bytes into `objects/`.
|
|
139
|
+
|
|
140
|
+
## Disk
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
agenticml du
|
|
144
|
+
agenticml gc --dry-run
|
|
145
|
+
agenticml gc --older-than DAYS --keep-last N
|
|
146
|
+
agenticml gc --include-unsynced
|
|
147
|
+
agenticml sync --all --prune
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`agenticml du` reports how much space the local store uses. `agenticml gc` removes runs. Only synced runs are eligible unless you pass `--include-unsynced`. `--older-than` and `--keep-last` narrow the set. `--dry-run` prints the plan and deletes nothing. `agenticml sync --prune` drops raw `<id>.bin` files for series that already have an overview; series of 65,536 points or fewer keep their `.bin` (≤ 512 KB each). A pruned run cannot be resumed or synced to another host, or uploaded again after `sync --reset`. Unreferenced objects have a one-hour grace period before gc removes them. Agenticml warns when the store exceeds `AGENTICML_MAX_BYTES` (default 5 GiB).
|
|
151
|
+
|
|
152
|
+
## Upload
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
agenticml login --host https://api.agenticml.xyz
|
|
156
|
+
agenticml whoami
|
|
157
|
+
agenticml logout
|
|
158
|
+
agenticml sync RUN_ID [RUN_ID ...]
|
|
159
|
+
agenticml sync --all
|
|
160
|
+
agenticml sync --all --watch 30 --dry-run
|
|
161
|
+
agenticml sync RUN_ID --reset
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`login` checks the key (skip with `--no-verify`) and writes `~/.config/agenticml/credentials.json` at mode `0600`. The directory is `AGENTICML_CONFIG_DIR`, else `$XDG_CONFIG_HOME/agenticml`, else `~/.config/agenticml`. The default host is `https://api.agenticml.xyz`. Use the `agenticml login` prompt to enter the key, or `AGENTICML_API_KEY` for sync. Avoid command-line `--key` / `--api-key`: their values are visible in `ps`. `login` also accepts stdin. `sync` takes the key from `--api-key`, then `AGENTICML_API_KEY`, then the file. `whoami` uses `AGENTICML_API_KEY`, then the file. `whoami --offline` skips the server check. `logout` removes the saved key for one host. On `login`, `whoami`, and `sync`, `--insecure` allows `http://` to a non-local host; localhost does not need it.
|
|
165
|
+
|
|
166
|
+
Sync is incremental and resumable. A cursor in `runs/<id>/sync.json` stores scalar byte offsets and which code, media, and artifacts were sent. An interrupted sync retries at most the in-flight batch. `--all` selects runs that are incomplete or changed. `--watch N` repeats every N seconds until every selected run has synced, failed permanently, or gone stale. `--dry-run` prints counts without sending or saving state. `--reset` clears the saved remote id for explicit run ids on this host, and it rejects `--all`.
|
|
167
|
+
|
|
168
|
+
Uploaded: project, name, config, tags, notes, group, job type, env, git, the parent's remote id, finite scalar points, code files, media, artifacts, and the summary plus status at finalize. `copy=True` artifacts come from the object store. By-reference artifacts are read from the logged path when it is still a regular file with the same size and mtime.
|
|
169
|
+
|
|
170
|
+
Server-side gaps: `created_at` and `finished_at` are stamped by the server at sync time. Config keys cannot be deleted remotely, and `group` / `job_type` cannot be cleared (a null is omitted and the stored value stays).
|
|
171
|
+
|
|
172
|
+
## Configuration
|
|
173
|
+
|
|
174
|
+
| Variable | Default | Purpose |
|
|
175
|
+
| --- | --- | --- |
|
|
176
|
+
| `AGENTICML_DIR` | `~/.agenticml` | Store root. `init(dir=)` and `--dir` win. |
|
|
177
|
+
| `AGENTICML_MODE` | `local` | `local`, `offline` (alias of `local`), or `disabled`. Other values warn and use `local`. |
|
|
178
|
+
| `AGENTICML_HOST` | `https://api.agenticml.xyz` | Server for `login`, `whoami`, and `sync`. |
|
|
179
|
+
| `AGENTICML_API_KEY` | unset | Key for `sync` and `whoami`. `login` ignores it. |
|
|
180
|
+
| `AGENTICML_CONFIG_DIR` | `~/.config/agenticml` | Credential directory. Wins over `XDG_CONFIG_HOME`. |
|
|
181
|
+
| `AGENTICML_MAX_BYTES` | 5 GiB | Warn when the local store is larger than this. Nothing is deleted automatically. |
|
|
182
|
+
| `AGENTICML_MEDIA_MAX_PER_KEY` | `64` | Media index rows kept per key. Further rows are thinned by step. |
|
|
183
|
+
| `AGENTICML_MEDIA_MAX_PX` | `1024` | Longest side of a logged image, when Pillow is installed. |
|
|
184
|
+
|
|
185
|
+
`agenticml run` settings use the variables listed under [Zero-code](#zero-code). Boolean switches treat `0`, `false`, `no`, and `off` as off.
|
|
186
|
+
|
|
187
|
+
## Performance
|
|
188
|
+
|
|
189
|
+
From `python scripts/bench.py --quick` on one machine. Timings and bytes/point move with CPU, disk, and Python.
|
|
190
|
+
|
|
191
|
+
| Metric | This run | Target |
|
|
192
|
+
| --- | --- | --- |
|
|
193
|
+
| `import agenticml` (median of 5) | 39.4 ms | < 100 ms |
|
|
194
|
+
| `log()` ×10 scalars, median (10,000 calls) | 2.70 µs | < 10 µs |
|
|
195
|
+
| `log()` ×10 scalars, p99 | 8.91 µs | |
|
|
196
|
+
| disk, whole `scalars/` dir (100,000 points) | 8.01 B/pt | ≤ 9.0 B/pt (8 B raw + overview) |
|
|
197
|
+
| UI cold start, `/api/runs` (101 runs) | 8 ms | < 1 s |
|
|
198
|
+
| scalar request, 100,000-point series (median of 20) | 14.16 ms | < 20 ms |
|
|
199
|
+
| TensorBoard tfevents | not installed | |
|
|
200
|
+
|
|
201
|
+
The disk row is ten series of 10,000 points. Each series is under 65,536 points, so finish writes no overview and the directory stays at 8.01 B/pt, inside the 9.0 B/pt check. A series past 65,536 points adds one overview of at most 73,768 bytes. `python scripts/bench.py` without `--quick` uses 100,000 log calls, a 1,000,000-point run, and 1,000 small runs.
|
|
202
|
+
|
|
203
|
+
## Distributed, resume, disabled
|
|
204
|
+
|
|
205
|
+
Rank 0 logs. `init(only_main_process=True)` (the default) gives every other rank a no-op run, using `RANK`, `PMI_RANK`, `OMPI_COMM_WORLD_RANK`, `SLURM_PROCID`, then `LOCAL_RANK`. Put the tracker inside the launcher so every rank runs the script:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
torchrun --nproc_per_node 4 -m agenticml run -- train.py
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Resume with the same id. `resume="must"` errors if it is missing; `resume="allow"` opens it or creates it. The default `resume="never"` rejects an `id`. A pruned run (overview present, raw series file gone) cannot be resumed.
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
agenticml.init(project="demo", name="exp1", id=run_id, resume="allow")
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`mode="disabled"` or `AGENTICML_MODE=disabled` makes `log`, `finish`, artifacts, and the `track_*` helpers no-ops. With `verbose=True`, init prints `agenticml: tracking disabled`.
|
|
218
|
+
|
|
219
|
+
## Development
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
pip install -e ".[dev]"
|
|
223
|
+
pytest
|
|
224
|
+
python scripts/bench.py --quick
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Releasing
|
|
228
|
+
|
|
229
|
+
GitHub Actions publishes to PyPI with Trusted Publishing (no API tokens).
|
|
230
|
+
|
|
231
|
+
- **TestPyPI dry run:** run the "Publish to TestPyPI" workflow by hand from the Actions tab. Re-running with a version that is already there is a no-op.
|
|
232
|
+
- **PyPI:** push a `v*` tag. The workflow fails if the tag does not match the version in `pyproject.toml` and `src/agenticml/__init__.py`.
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# bump version in pyproject.toml and src/agenticml/__init__.py
|
|
236
|
+
git commit -am "release: v0.1.0"
|
|
237
|
+
git tag v0.1.0
|
|
238
|
+
git push origin v0.1.0
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## License
|
|
242
|
+
|
|
243
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agenticml-lite"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Lean, local-first experiment tracker for AgenticML. Installs as `agenticml-lite`, imports as `agenticml`."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [{ name = "Gaurav Singh", email = "gaurav.singh@agenticml.xyz" }]
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
keywords = ["mlops", "experiment-tracking", "machine-learning", "agentic"]
|
|
14
|
+
dependencies = [
|
|
15
|
+
"requests>=2.31",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
# System metrics sampler
|
|
32
|
+
system = [
|
|
33
|
+
"psutil>=5.9",
|
|
34
|
+
]
|
|
35
|
+
# GPU metrics (NVIDIA only)
|
|
36
|
+
gpu = [
|
|
37
|
+
"nvidia-ml-py>=12",
|
|
38
|
+
]
|
|
39
|
+
# Image media (numpy/PIL pathways)
|
|
40
|
+
media = [
|
|
41
|
+
"Pillow>=10.0",
|
|
42
|
+
]
|
|
43
|
+
dev = [
|
|
44
|
+
"pytest>=7",
|
|
45
|
+
"build>=1.0",
|
|
46
|
+
"twine>=5.0",
|
|
47
|
+
"psutil>=5.9",
|
|
48
|
+
"Pillow>=10.0",
|
|
49
|
+
"responses>=0.24",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.scripts]
|
|
53
|
+
agenticml = "agenticml.cli:main"
|
|
54
|
+
|
|
55
|
+
[project.urls]
|
|
56
|
+
Homepage = "https://agenticml.xyz"
|
|
57
|
+
Documentation = "https://agenticml.github.io/agenticml-lite/"
|
|
58
|
+
Source = "https://github.com/agenticML/agenticml-lite"
|
|
59
|
+
Issues = "https://github.com/agenticML/agenticml-lite/issues"
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.packages.find]
|
|
62
|
+
where = ["src"]
|
|
63
|
+
|
|
64
|
+
[tool.pytest.ini_options]
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
|
|
67
|
+
[tool.setuptools.package-data]
|
|
68
|
+
"agenticml.ui" = ["static/*"]
|