@tuned-tensor/cli 0.15.1 → 0.17.0
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/README.md +124 -46
- package/dist/{chunk-VVKC563R.js → chunk-KRKISPHG.js} +420 -98
- package/dist/chunk-KRKISPHG.js.map +1 -0
- package/dist/index.js +1070 -706
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +147 -32
- package/dist/local-runtime.js.map +1 -1
- package/docs/local-runtime/architecture.md +17 -6
- package/docs/local-runtime/aws-gpu.md +248 -0
- package/docs/local-runtime/foundation-long-runs.md +21 -5
- package/docs/local-runtime/serving.md +11 -1
- package/docs/spec-architecture.html +573 -0
- package/docs/spec-workflow.md +110 -0
- package/examples/local-runtime/aws-runner.json +13 -0
- package/package.json +6 -4
- package/training/adapter/src/foundation_export.py +81 -0
- package/training/adapter/src/serve.py +12 -5
- package/training/adapter/src/train.py +4 -0
- package/training/foundation/pyproject.toml +4 -0
- package/training/foundation/src/model.py +2 -0
- package/training/foundation/uv.lock +225 -0
- package/dist/chunk-VVKC563R.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# tt - Tuned Tensor CLI
|
|
2
2
|
|
|
3
|
-
`tt` is the local agent and CLI for Tuned Tensor.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
`tt` is the local agent and CLI for Tuned Tensor. Develop and orchestrate one
|
|
4
|
+
training workflow locally, using a local NVIDIA GPU or an existing GPU instance
|
|
5
|
+
in your AWS account. Inspect the resulting artifacts and metrics locally, and
|
|
6
|
+
optionally publish run evidence to the web dashboard.
|
|
7
7
|
|
|
8
8
|
Local training, evaluation, inspection, and serving need no TT access token.
|
|
9
9
|
Agent inference is a separate choice:
|
|
@@ -17,16 +17,27 @@ Agent inference is a separate choice:
|
|
|
17
17
|
|
|
18
18
|
A saved BYO selection stays selected after TT login. Switch back with
|
|
19
19
|
`tt agent configure --provider tunedtensor` or `/model tunedtensor/managed`.
|
|
20
|
-
Inference choice is independent of
|
|
21
|
-
|
|
20
|
+
Inference choice is independent of where training uses a GPU. Your AWS GPU
|
|
21
|
+
needs AWS credentials and SSH access; TT account operations under `tt cloud`
|
|
22
|
+
require a TT access token.
|
|
23
|
+
|
|
24
|
+
New to cloud GPU training? Follow [your first AWS run](docs/local-runtime/aws-gpu.md)
|
|
25
|
+
for project creation, AWS quota and SSH setup, a preview, training, result
|
|
26
|
+
verification, and shutdown. You still run `tt pipeline run` on your laptop;
|
|
27
|
+
`tt cloud` is for TT account records, not user-owned GPU execution.
|
|
22
28
|
|
|
23
29
|
## Unified commands
|
|
24
30
|
|
|
25
31
|
Local workflows remain the default: `tt pipeline run`, `tt runs list`,
|
|
26
|
-
`tt models list`, and `tt serve`.
|
|
27
|
-
|
|
32
|
+
`tt models list`, and `tt serve`. GPU processes can use an existing instance in
|
|
33
|
+
your AWS account through [`gpu` configuration](docs/local-runtime/aws-gpu.md).
|
|
34
|
+
`tt cloud runs list` and
|
|
35
|
+
`tt cloud models list` access existing account records.
|
|
28
36
|
`tt usage` reports managed agent allowance and usage; `tt balance` reports
|
|
29
|
-
|
|
37
|
+
TT credits for hosted labeling and historical training charges, which do not
|
|
38
|
+
pay for your AWS instance.
|
|
39
|
+
`tt publish` uploads local run evidence to the dashboard. Hosted training
|
|
40
|
+
submission (`tt cloud runs start` and `estimate`) is retired.
|
|
30
41
|
|
|
31
42
|
TT includes the former TT Local runtime. `tt local …` and `tt run` remain
|
|
32
43
|
hidden compatibility aliases; new scripts should use root commands and
|
|
@@ -64,9 +75,11 @@ tt --version
|
|
|
64
75
|
Uninstall with `npm uninstall -g @tuned-tensor/cli` (add
|
|
65
76
|
`--prefix ~/.local` if the curl installer used that prefix).
|
|
66
77
|
|
|
67
|
-
Node.js 22.19.0 or newer is required.
|
|
68
|
-
[`uv`](https://docs.astral.sh/uv/) and a supported NVIDIA CUDA host
|
|
69
|
-
|
|
78
|
+
Node.js 22.19.0 or newer is required. Training additionally needs
|
|
79
|
+
[`uv`](https://docs.astral.sh/uv/) locally and a supported NVIDIA CUDA host,
|
|
80
|
+
either local or [in your AWS account](docs/local-runtime/aws-gpu.md). The laptop
|
|
81
|
+
does not need a GPU when `gpu` is configured. The locked Python runner ships
|
|
82
|
+
with the npm package and is prepared on first use.
|
|
70
83
|
|
|
71
84
|
Run from source:
|
|
72
85
|
|
|
@@ -78,6 +91,14 @@ npm run build
|
|
|
78
91
|
npm link
|
|
79
92
|
```
|
|
80
93
|
|
|
94
|
+
## Behavior spec workflow
|
|
95
|
+
|
|
96
|
+
`tunedtensor.json` is the source of truth for behavior and training settings.
|
|
97
|
+
Use `/spec`, `/spec diff`, `/spec validate`, and `/spec history` in the shell to
|
|
98
|
+
review it without a model call. Ask the agent for changes, inspect its proposed
|
|
99
|
+
diff, then `/approve` to save a validated edit with revision history. Pipeline
|
|
100
|
+
runs use the saved spec. See [the spec workflow](docs/spec-workflow.md).
|
|
101
|
+
|
|
81
102
|
## Conversational terminal
|
|
82
103
|
|
|
83
104
|
The interactive agent harness and conversation state run on your laptop.
|
|
@@ -149,11 +170,11 @@ Ask TT anything. Known commands run directly.
|
|
|
149
170
|
```
|
|
150
171
|
|
|
151
172
|
Ordinary sentences go through the locally orchestrated model session. The
|
|
152
|
-
model has no shell or general filesystem tool. It can
|
|
153
|
-
directly beneath the shell's current working directory with a validated
|
|
173
|
+
model has no shell or general filesystem tool. It can read and propose reviewed
|
|
174
|
+
edits to an existing spec, or prepare one new folder directly beneath the shell's current working directory with a validated
|
|
154
175
|
`tunedtensor.json`, or prepare a local pipeline dry-run sealed to the reviewed
|
|
155
|
-
workspace and spec contents.
|
|
156
|
-
traversal, symlinked workspace roots,
|
|
176
|
+
workspace and spec contents. Writes and pipeline previews wait for `/approve`. The tools refuse path
|
|
177
|
+
traversal, symlinked workspace roots, overwriting a new-project target, unsupported spec
|
|
157
178
|
fields, cloud pipeline targets, and spec changes after review. Known CLI
|
|
158
179
|
commands such as `runs list`, `doctor`, and `models list` still execute directly.
|
|
159
180
|
Prefix a command with `:` when you want to make that intent explicit.
|
|
@@ -231,9 +252,10 @@ explicitly.
|
|
|
231
252
|
|
|
232
253
|
## Composable pipelines (v1)
|
|
233
254
|
|
|
234
|
-
A pipeline is an ordered JSON recipe.
|
|
235
|
-
|
|
236
|
-
|
|
255
|
+
A pipeline is an ordered JSON recipe. The CLI orchestrates every plan locally;
|
|
256
|
+
optional `gpu` configuration moves its GPU processes to your AWS instance.
|
|
257
|
+
The portable document contract lives in `@tuned-tensor/pipeline-contract`. The
|
|
258
|
+
CLI adds execution planning (step selection) on top of it.
|
|
237
259
|
|
|
238
260
|
Two local engines share that document version:
|
|
239
261
|
|
|
@@ -266,6 +288,10 @@ expected output for every example. Treat those metrics as an end-to-end
|
|
|
266
288
|
execution and overfit check—not held-out capability or multi-GPU evidence when
|
|
267
289
|
no validation corpus is configured.
|
|
268
290
|
|
|
291
|
+
Without `--file`, pipeline plan/run/validate derive the recipe from the behavior
|
|
292
|
+
spec. Adjacent recipe files are no longer loaded implicitly. Explicit foundation
|
|
293
|
+
recipes must agree with the spec’s training settings.
|
|
294
|
+
|
|
269
295
|
```bash
|
|
270
296
|
tt pipeline init --file pipeline.json
|
|
271
297
|
tt pipeline init --engine foundation --file foundation.pipeline.json
|
|
@@ -283,8 +309,9 @@ When `--config` is omitted, `pipeline run` uses `local-runner.json` beside the
|
|
|
283
309
|
selected spec when that file exists.
|
|
284
310
|
|
|
285
311
|
`--only` and `--skip` preserve dependency safety: a selected step cannot refer
|
|
286
|
-
to an omitted predecessor.
|
|
287
|
-
|
|
312
|
+
to an omitted predecessor. Keep step targets local and configure `gpu` in
|
|
313
|
+
`local-runner.json` to execute GPU work on your AWS instance. Adapter and
|
|
314
|
+
foundation workflows use the same local pipeline. The TT agent may describe,
|
|
288
315
|
validate, and prepare a sealed pipeline action; only deterministic `/approve`
|
|
289
316
|
handling can execute it.
|
|
290
317
|
|
|
@@ -304,8 +331,6 @@ selection continues to work while you operate cloud runs with that token.
|
|
|
304
331
|
```bash
|
|
305
332
|
tt auth login
|
|
306
333
|
tt cloud push --file tunedtensor.json
|
|
307
|
-
tt cloud runs estimate <spec-id>
|
|
308
|
-
tt cloud runs start <spec-id>
|
|
309
334
|
tt cloud runs watch <run-id>
|
|
310
335
|
tt cloud runs report <run-id>
|
|
311
336
|
tt cloud runs list
|
|
@@ -314,19 +339,18 @@ tt usage
|
|
|
314
339
|
tt balance
|
|
315
340
|
```
|
|
316
341
|
|
|
317
|
-
|
|
342
|
+
`tt cloud specs`, `tt cloud datasets`,
|
|
318
343
|
`tt cloud label`, and `tt cloud models` expose the corresponding account
|
|
319
|
-
operations; each command's `--help` documents its arguments.
|
|
320
|
-
|
|
321
|
-
`tt
|
|
344
|
+
operations; each command's `--help` documents its arguments. Hosted training
|
|
345
|
+
submission is retired. Use [your AWS GPU](docs/local-runtime/aws-gpu.md) with
|
|
346
|
+
`tt pipeline run`; historical cloud reports remain accessible.
|
|
322
347
|
|
|
323
348
|
With a TT token, the local agent can inspect cloud resources, run reports,
|
|
324
349
|
balances, transactions, and managed usage. It can prepare cloud spec edits for
|
|
325
350
|
`/approve`. Those proposals show the API origin and remain bound to the token
|
|
326
351
|
and origin used during preparation. After changing either, return to the
|
|
327
|
-
original account and origin or prepare a new proposal.
|
|
328
|
-
|
|
329
|
-
CLI command. Without a TT token these account tools are unavailable, while
|
|
352
|
+
original account and origin or prepare a new proposal. Cancelling older
|
|
353
|
+
hosted runs remains an explicit CLI command. Without a TT token these account tools are unavailable, while
|
|
330
354
|
local workflow commands and BYO inference continue to work.
|
|
331
355
|
|
|
332
356
|
`tt usage` reports the server-configured daily managed inference allowance.
|
|
@@ -334,8 +358,9 @@ Each provider completion, including a tool follow-up, consumes one request;
|
|
|
334
358
|
failed and cancelled requests also count. Token/cost coverage shows which
|
|
335
359
|
requests have provider usage reports, so incomplete reporting is not mistaken
|
|
336
360
|
for zero consumption. The displayed provider cost is informational, not a
|
|
337
|
-
charge to
|
|
338
|
-
|
|
361
|
+
charge to TT credits. BYO provider usage is separate. `tt balance` shows TT
|
|
362
|
+
credits for hosted labeling and historical training charges, plus recent
|
|
363
|
+
transactions; `tt topup` opens checkout.
|
|
339
364
|
|
|
340
365
|
Publish a local report for review in the dashboard:
|
|
341
366
|
|
|
@@ -353,35 +378,60 @@ Use `--json` with reporting commands for scripts. `TUNED_TENSOR_URL` or
|
|
|
353
378
|
|
|
354
379
|
## Quick start
|
|
355
380
|
|
|
356
|
-
Create a
|
|
381
|
+
Create a project on your development machine:
|
|
357
382
|
|
|
358
383
|
```bash
|
|
359
384
|
mkdir support-adapter && cd support-adapter
|
|
360
|
-
tt hardware
|
|
361
385
|
tt init \
|
|
362
386
|
--name "Support Adapter" \
|
|
363
|
-
--model Qwen/Qwen3.5-2B
|
|
364
|
-
|
|
387
|
+
--model Qwen/Qwen3.5-2B
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Edit the generated `tunedtensor.json`, replacing the placeholder system prompt and both placeholder examples.
|
|
391
|
+
For a local GPU, `tt hardware` reports this machine's training and serving
|
|
392
|
+
capacity. For an AWS GPU, save the following as `local-runner.json` beside the
|
|
393
|
+
spec, replacing the instance, region, profile and SSH settings with your own:
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"gpu": {
|
|
398
|
+
"provider": "aws",
|
|
399
|
+
"profile": "research",
|
|
400
|
+
"region": "eu-west-1",
|
|
401
|
+
"instanceId": "i-0123456789abcdef0",
|
|
402
|
+
"user": "ubuntu",
|
|
403
|
+
"identityFile": "~/.ssh/research-gpu.pem"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
365
406
|
```
|
|
366
407
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
408
|
+
The instance must already be running and reachable over SSH. See
|
|
409
|
+
[AWS GPU setup](docs/local-runtime/aws-gpu.md) for prerequisites, authentication,
|
|
410
|
+
transfer behavior and recovery. `tt hardware` always inspects the machine
|
|
411
|
+
running the CLI; `tt doctor` uses `gpu` to check the remote runtime.
|
|
412
|
+
Then validate, prefetch the base model locally, preview, and run:
|
|
371
413
|
|
|
372
414
|
```bash
|
|
373
|
-
tt doctor tunedtensor.json
|
|
374
415
|
tt validate tunedtensor.json
|
|
375
416
|
tt models prefetch tunedtensor.json
|
|
417
|
+
tt doctor tunedtensor.json
|
|
418
|
+
tt pipeline run --spec tunedtensor.json --dry-run
|
|
376
419
|
tt pipeline run --spec tunedtensor.json
|
|
377
420
|
```
|
|
378
421
|
|
|
379
|
-
|
|
422
|
+
These commands discover the adjacent `local-runner.json`. The preview needs
|
|
423
|
+
no GPU or AWS connection. Results return to the local run and model stores:
|
|
380
424
|
|
|
381
425
|
```bash
|
|
382
426
|
tt runs report <run-id>
|
|
383
427
|
tt models verify local-<run-id>
|
|
384
|
-
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Serving still runs on the machine executing `tt serve` and requires a local
|
|
431
|
+
Linux/CUDA GPU, even when training used AWS:
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
tt serve local-<run-id>
|
|
385
435
|
```
|
|
386
436
|
|
|
387
437
|
Local currently certifies text SFT with `Qwen/Qwen3.5-2B` (pinned to snapshot
|
|
@@ -393,8 +443,9 @@ checkpointing, and adapts bounded shared attention/Mamba projections rather
|
|
|
393
443
|
than every routed expert matrix. Muse Glimmer is a vision-language checkpoint
|
|
394
444
|
whose text tower is fine-tuned through the image-text-to-text loader with the
|
|
395
445
|
vision tower frozen and unused. Evaluation may use CPU; packaged local
|
|
396
|
-
serving requires Linux and NVIDIA CUDA.
|
|
397
|
-
|
|
446
|
+
serving requires Linux and NVIDIA CUDA. AWS execution transfers the required
|
|
447
|
+
datasets and model files to your instance and returns outputs locally; normal
|
|
448
|
+
cleanup removes the remote staging directory.
|
|
398
449
|
|
|
399
450
|
Activation is optional and requires the run to pass a configured
|
|
400
451
|
`generalRegression` gate. Without that suite, `tt models activate` fails
|
|
@@ -411,6 +462,33 @@ exports isolated Pi configuration; tools no longer need to be disabled. See
|
|
|
411
462
|
[Local serving and coding harnesses](docs/local-runtime/serving.md) for Pi/OpenCode
|
|
412
463
|
setup, resource budgets, hardware limits, and the verified integration scope.
|
|
413
464
|
|
|
465
|
+
### Serve a foundation checkpoint
|
|
466
|
+
|
|
467
|
+
Serve a completed pretrain, fine-tune, or RL model directory with its training tokenizer:
|
|
468
|
+
|
|
469
|
+
```sh
|
|
470
|
+
tt serve foundation --checkpoint /path/to/run/pretrain/output --tokenizer /path/to/run/tokenize/output/tokenizer.json
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Use the model artifact directory containing `config.json` and `model.safetensors`,
|
|
474
|
+
not a resumable optimizer checkpoint. The API model name is `foundation`.
|
|
475
|
+
`--spec tunedtensor.json` applies a foundation spec's system prompt. Existing
|
|
476
|
+
port, authentication, sampling, streaming, and client configuration options apply.
|
|
477
|
+
The context limit defaults to the checkpoint's `sequence_length`; a smaller
|
|
478
|
+
`--context-length` is allowed. Foundation serving supports text completions and
|
|
479
|
+
chat with system/user/assistant messages, without tool-call parsing.
|
|
480
|
+
|
|
481
|
+
TT exports the weights and tokenizer to a temporary GPT-2 snapshot and uses the
|
|
482
|
+
existing pinned vLLM server on Linux/CUDA. Training artifacts are unchanged; the
|
|
483
|
+
temporary export is removed when the server exits. Export requires temporary
|
|
484
|
+
disk space for a copy of the model weights.
|
|
485
|
+
|
|
486
|
+
Export parity tests run on CPU as part of `npm test`. To run them directly:
|
|
487
|
+
|
|
488
|
+
```sh
|
|
489
|
+
uv run --frozen --project training/foundation --group test python -m unittest discover -s training/foundation/tests -p test_foundation_export.py
|
|
490
|
+
```
|
|
491
|
+
|
|
414
492
|
Useful discovery commands:
|
|
415
493
|
|
|
416
494
|
```bash
|
|
@@ -436,7 +514,7 @@ npm run test:workflows # Focused product workflow regressions; no model key or
|
|
|
436
514
|
npm run check # Typecheck, all tests, and build (the release gate)
|
|
437
515
|
```
|
|
438
516
|
|
|
439
|
-
See [
|
|
517
|
+
See [testing and workflow contracts](docs/testing.md) for what the
|
|
440
518
|
suite guarantees, how to evaluate a real agent with `npm run eval:agent`, and
|
|
441
519
|
the remaining steps toward the full conversational product promise.
|
|
442
520
|
|