@tuned-tensor/local 0.1.9 → 0.2.1
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.
- package/CHANGELOG.md +21 -0
- package/README.md +10 -407
- package/dist/contracts.d.ts +19 -3
- package/dist/contracts.js +9 -4
- package/dist/contracts.js.map +1 -1
- package/dist/doctor.js +41 -24
- package/dist/doctor.js.map +1 -1
- package/dist/evaluation.js +30 -16
- package/dist/evaluation.js.map +1 -1
- package/dist/orchestrator.js +1 -1
- package/dist/orchestrator.js.map +1 -1
- package/dist/process-runner.d.ts +11 -0
- package/dist/process-runner.js +22 -0
- package/dist/process-runner.js.map +1 -1
- package/dist/process-training.js +16 -15
- package/dist/process-training.js.map +1 -1
- package/dist/store.d.ts +3 -10
- package/dist/store.js +244 -33
- package/dist/store.js.map +1 -1
- package/docs/architecture.md +30 -18
- package/docs/spark.md +29 -1
- package/package.json +3 -1
package/docs/architecture.md
CHANGED
|
@@ -13,13 +13,16 @@ packaged as a standalone CLI.
|
|
|
13
13
|
compatible hosted exports.
|
|
14
14
|
- Artifact store: writes datasets, logs, model outputs, and reports beneath a
|
|
15
15
|
configured local artifact root.
|
|
16
|
-
- Local state store:
|
|
17
|
-
records
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
- Local state store: keeps a SQLite metadata index for specs, runs, progress
|
|
17
|
+
events, and model records while preserving JSON/JSONL files under a
|
|
18
|
+
configured `storeRoot` for portable artifacts, recovery, and inspection.
|
|
19
|
+
- Training adapter: launches either a uv-managed Python process or an arbitrary
|
|
20
|
+
command with local input, model cache, and output directories passed through
|
|
21
|
+
environment variables.
|
|
22
|
+
- Evaluation adapter: runs local Hugging Face/PEFT inference, an arbitrary
|
|
23
|
+
batch command, or per-example commands for baseline and candidate evaluation.
|
|
24
|
+
Evaluation can also use an OpenRouter LLM judge to score locally generated
|
|
25
|
+
outputs.
|
|
23
26
|
- Report writer: emits structured JSON reports that are portable across local
|
|
24
27
|
and hosted environments.
|
|
25
28
|
- Dashboard/API server: serves local run/model/spec metadata from the local
|
|
@@ -43,11 +46,12 @@ The first runnable milestone should support:
|
|
|
43
46
|
- one local run at a time;
|
|
44
47
|
- one GPU device;
|
|
45
48
|
- local filesystem artifacts;
|
|
46
|
-
-
|
|
49
|
+
- SQLite-backed run/model/spec tracking with recoverable JSON files;
|
|
47
50
|
- standalone `tt-local init`, `validate`, `run`, `serve`, and inspection
|
|
48
51
|
commands;
|
|
49
|
-
- uv-based training;
|
|
50
|
-
- native Transformers/PEFT
|
|
52
|
+
- uv-based or command-based training;
|
|
53
|
+
- native Transformers/PEFT, batch-command, or per-example command evaluation
|
|
54
|
+
with optional OpenRouter judge scoring;
|
|
51
55
|
- local dashboard and CLI inspection commands;
|
|
52
56
|
- a tiny smoke-run fixture that finishes quickly.
|
|
53
57
|
|
|
@@ -56,12 +60,12 @@ The first runnable milestone should support:
|
|
|
56
60
|
The public runner should accept a plain JSON run request and a local runner
|
|
57
61
|
configuration. The run request describes the behavior spec, base model,
|
|
58
62
|
examples, and hyperparameters. The local runner configuration describes artifact
|
|
59
|
-
paths, store paths, uv entrypoint settings, model cache paths,
|
|
60
|
-
settings, and timeout limits.
|
|
63
|
+
paths, store paths, uv or command entrypoint settings, model cache paths,
|
|
64
|
+
OpenRouter judge settings, and timeout limits.
|
|
61
65
|
|
|
62
66
|
## Evaluation Loop
|
|
63
67
|
|
|
64
|
-
The
|
|
68
|
+
The default Transformers loop intentionally compares like-for-like model artifacts:
|
|
65
69
|
|
|
66
70
|
- baseline loads the original Hugging Face base model from the behavior spec;
|
|
67
71
|
- training writes a Hugging Face/PEFT artifact under the run directory;
|
|
@@ -72,25 +76,33 @@ The first native backend is `transformers`. `llama.cpp`/GGUF conversion is not
|
|
|
72
76
|
part of the default path because conversion would make the baseline/candidate
|
|
73
77
|
comparison less direct.
|
|
74
78
|
|
|
79
|
+
Custom model families can use `training.backend: "command"` and
|
|
80
|
+
`evaluation.inference.provider: "batch_command"`. Batch evaluators receive the
|
|
81
|
+
same `--input`/`--output` JSON files as the bundled Transformers evaluator, so a
|
|
82
|
+
custom workflow can load any artifact format as long as it writes compatible
|
|
83
|
+
evaluation results.
|
|
84
|
+
|
|
75
85
|
## Local State Layout
|
|
76
86
|
|
|
77
87
|
The local store is intentionally transparent and easy to back up:
|
|
78
88
|
|
|
89
|
+
- `metadata.sqlite`
|
|
79
90
|
- `specs/<spec-id>/spec.json`
|
|
80
91
|
- `runs/<run-id>/request.json`
|
|
81
92
|
- `runs/<run-id>/state.json`
|
|
82
93
|
- `runs/<run-id>/progress.jsonl`
|
|
83
94
|
- `runs/<run-id>/run-report.json`
|
|
84
95
|
- `models/<model-id>/model.json`
|
|
85
|
-
- `catalog/*.jsonl`
|
|
86
96
|
|
|
87
|
-
|
|
88
|
-
|
|
97
|
+
SQLite is the primary metadata index for CLI and dashboard listings. The
|
|
98
|
+
per-object JSON files remain the recoverable source for artifacts and
|
|
99
|
+
human-readable inspection. `tt-local store rebuild-index` can reconstruct the
|
|
100
|
+
SQLite index from the canonical per-object files.
|
|
89
101
|
|
|
90
102
|
## Dashboard API
|
|
91
103
|
|
|
92
|
-
The local server is a lightweight Node HTTP server
|
|
93
|
-
Current endpoints include:
|
|
104
|
+
The local server is a lightweight Node HTTP server backed by the local state
|
|
105
|
+
store. Current endpoints include:
|
|
94
106
|
|
|
95
107
|
- `GET /api/health`
|
|
96
108
|
- `GET /api/runs`, `GET /api/runs/:id`, `GET /api/runs/:id/events`
|
package/docs/spark.md
CHANGED
|
@@ -41,7 +41,8 @@ tt-local run examples/smoke-run-request.json --config examples/local-runner.json
|
|
|
41
41
|
|
|
42
42
|
## Real Training
|
|
43
43
|
|
|
44
|
-
For real training, set `dryRun: false` and
|
|
44
|
+
For real training with the bundled SFT workflow, set `dryRun: false` and
|
|
45
|
+
configure the uv training entrypoint:
|
|
45
46
|
|
|
46
47
|
```json
|
|
47
48
|
{
|
|
@@ -73,6 +74,33 @@ that same base model plus the fine-tuned artifact from the run directory. Set
|
|
|
73
74
|
`paths.modelCache` to a persistent Spark-local cache so training and evaluation
|
|
74
75
|
reuse downloads.
|
|
75
76
|
|
|
77
|
+
Custom workflows such as a from-scratch nanoGPT trainer can use command
|
|
78
|
+
entrypoints instead:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"artifactRoot": "/home/eve/tt-local-artifacts",
|
|
83
|
+
"dryRun": false,
|
|
84
|
+
"training": {
|
|
85
|
+
"backend": "command",
|
|
86
|
+
"command": ["python", "nanogpt/train.py"]
|
|
87
|
+
},
|
|
88
|
+
"evaluation": {
|
|
89
|
+
"inference": {
|
|
90
|
+
"provider": "batch_command",
|
|
91
|
+
"command": ["python", "nanogpt/evaluate.py"]
|
|
92
|
+
},
|
|
93
|
+
"scoring": {
|
|
94
|
+
"mode": "exact_match"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The training command receives the same environment variables listed above. The
|
|
101
|
+
batch evaluator is called with `--input <path> --output <path>` and should write
|
|
102
|
+
the same results JSON shape as the bundled evaluator.
|
|
103
|
+
|
|
76
104
|
The included first-pass SFT script can be run by the local runner through uv:
|
|
77
105
|
|
|
78
106
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuned-tensor/local",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TT Local: tuning tensors locally on hardware you control.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -34,11 +34,13 @@
|
|
|
34
34
|
"node": ">=22"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
37
38
|
"@types/node": "^25.0.0",
|
|
38
39
|
"tsx": "^4.22.4",
|
|
39
40
|
"typescript": "^6.0.0"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
43
|
+
"better-sqlite3": "^12.11.1",
|
|
42
44
|
"zod": "^4.4.3"
|
|
43
45
|
}
|
|
44
46
|
}
|