@tuned-tensor/cli 0.15.1 → 0.16.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 CHANGED
@@ -1,9 +1,9 @@
1
1
  # tt - Tuned Tensor CLI
2
2
 
3
- `tt` is the local agent and CLI for Tuned Tensor. Use it to converse, run
4
- workflows on your laptop or in the cloud, inspect metrics, and check account
5
- usage. The web app is the dashboard for reviewing cloud runs and published
6
- local evidence.
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,22 @@ 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 whether a training workflow runs locally or
21
- in the cloud. Cloud account operations always require a TT access token.
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.
22
23
 
23
24
  ## Unified commands
24
25
 
25
26
  Local workflows remain the default: `tt pipeline run`, `tt runs list`,
26
- `tt models list`, and `tt serve`. Cloud workflows are explicit:
27
- `tt cloud runs start`, `tt cloud runs list`, and `tt cloud models list`.
27
+ `tt models list`, and `tt serve`. GPU processes can use an existing instance in
28
+ your AWS account through [`gpu` configuration](docs/local-runtime/aws-gpu.md).
29
+ `tt cloud runs list` and
30
+ `tt cloud models list` access existing account records.
28
31
  `tt usage` reports managed agent allowance and usage; `tt balance` reports
29
- cloud training credits. `tt publish` uploads local run evidence to the dashboard.
32
+ TT credits for hosted labeling and historical training charges, which do not
33
+ pay for your AWS instance.
34
+ `tt publish` uploads local run evidence to the dashboard. Hosted training
35
+ submission (`tt cloud runs start` and `estimate`) is retired.
30
36
 
31
37
  TT includes the former TT Local runtime. `tt local …` and `tt run` remain
32
38
  hidden compatibility aliases; new scripts should use root commands and
@@ -64,9 +70,11 @@ tt --version
64
70
  Uninstall with `npm uninstall -g @tuned-tensor/cli` (add
65
71
  `--prefix ~/.local` if the curl installer used that prefix).
66
72
 
67
- Node.js 22.19.0 or newer is required. Local training additionally needs
68
- [`uv`](https://docs.astral.sh/uv/) and a supported NVIDIA CUDA host; the locked
69
- Python runner ships with the npm package and is prepared on first use.
73
+ Node.js 22.19.0 or newer is required. Training additionally needs
74
+ [`uv`](https://docs.astral.sh/uv/) locally and a supported NVIDIA CUDA host,
75
+ either local or [in your AWS account](docs/local-runtime/aws-gpu.md). The laptop
76
+ does not need a GPU when `gpu` is configured. The locked Python runner ships
77
+ with the npm package and is prepared on first use.
70
78
 
71
79
  Run from source:
72
80
 
@@ -231,9 +239,10 @@ explicitly.
231
239
 
232
240
  ## Composable pipelines (v1)
233
241
 
234
- A pipeline is an ordered JSON recipe. This CLI executes local plans only. The
235
- portable document contract lives in `@tuned-tensor/pipeline-contract`. The CLI
236
- adds execution planning (step selection) on top of it.
242
+ A pipeline is an ordered JSON recipe. The CLI orchestrates every plan locally;
243
+ optional `gpu` configuration moves its GPU processes to your AWS instance.
244
+ The portable document contract lives in `@tuned-tensor/pipeline-contract`. The
245
+ CLI adds execution planning (step selection) on top of it.
237
246
 
238
247
  Two local engines share that document version:
239
248
 
@@ -283,8 +292,9 @@ When `--config` is omitted, `pipeline run` uses `local-runner.json` beside the
283
292
  selected spec when that file exists.
284
293
 
285
294
  `--only` and `--skip` preserve dependency safety: a selected step cannot refer
286
- to an omitted predecessor. Cloud-targeted pipeline steps can be inspected with `--dry-run`; actual
287
- cloud execution uses `tt cloud runs`, described below. Foundation documents are local-only. The TT agent may describe,
295
+ to an omitted predecessor. Keep step targets local and configure `gpu` in
296
+ `local-runner.json` to execute GPU work on your AWS instance. Adapter and
297
+ foundation workflows use the same local pipeline. The TT agent may describe,
288
298
  validate, and prepare a sealed pipeline action; only deterministic `/approve`
289
299
  handling can execute it.
290
300
 
@@ -304,8 +314,6 @@ selection continues to work while you operate cloud runs with that token.
304
314
  ```bash
305
315
  tt auth login
306
316
  tt cloud push --file tunedtensor.json
307
- tt cloud runs estimate <spec-id>
308
- tt cloud runs start <spec-id>
309
317
  tt cloud runs watch <run-id>
310
318
  tt cloud runs report <run-id>
311
319
  tt cloud runs list
@@ -314,19 +322,18 @@ tt usage
314
322
  tt balance
315
323
  ```
316
324
 
317
- Use the spec ID returned by `push`. `tt cloud specs`, `tt cloud datasets`,
325
+ `tt cloud specs`, `tt cloud datasets`,
318
326
  `tt cloud label`, and `tt cloud models` expose the corresponding account
319
- operations; each command's `--help` documents its arguments. Cloud foundation
320
- training and dispatching cloud-targeted pipeline JSON are not supported;
321
- `tt cloud runs` uses the hosted adapter workflow.
327
+ operations; each command's `--help` documents its arguments. Hosted training
328
+ submission is retired. Use [your AWS GPU](docs/local-runtime/aws-gpu.md) with
329
+ `tt pipeline run`; historical cloud reports remain accessible.
322
330
 
323
331
  With a TT token, the local agent can inspect cloud resources, run reports,
324
332
  balances, transactions, and managed usage. It can prepare cloud spec edits for
325
333
  `/approve`. Those proposals show the API origin and remain bound to the token
326
334
  and origin used during preparation. After changing either, return to the
327
- original account and origin or prepare a new proposal. Starting or cancelling
328
- cloud training remains an explicit direct
329
- CLI command. Without a TT token these account tools are unavailable, while
335
+ original account and origin or prepare a new proposal. Cancelling older
336
+ hosted runs remains an explicit CLI command. Without a TT token these account tools are unavailable, while
330
337
  local workflow commands and BYO inference continue to work.
331
338
 
332
339
  `tt usage` reports the server-configured daily managed inference allowance.
@@ -334,8 +341,9 @@ Each provider completion, including a tool follow-up, consumes one request;
334
341
  failed and cancelled requests also count. Token/cost coverage shows which
335
342
  requests have provider usage reports, so incomplete reporting is not mistaken
336
343
  for zero consumption. The displayed provider cost is informational, not a
337
- charge to cloud training credits. BYO provider usage is separate. `tt balance`
338
- shows cloud training credits and recent transactions; `tt topup` opens checkout.
344
+ charge to TT credits. BYO provider usage is separate. `tt balance` shows TT
345
+ credits for hosted labeling and historical training charges, plus recent
346
+ transactions; `tt topup` opens checkout.
339
347
 
340
348
  Publish a local report for review in the dashboard:
341
349
 
@@ -353,35 +361,60 @@ Use `--json` with reporting commands for scripts. `TUNED_TENSOR_URL` or
353
361
 
354
362
  ## Quick start
355
363
 
356
- Create a local project on an NVIDIA host:
364
+ Create a project on your development machine:
357
365
 
358
366
  ```bash
359
367
  mkdir support-adapter && cd support-adapter
360
- tt hardware
361
368
  tt init \
362
369
  --name "Support Adapter" \
363
- --model Qwen/Qwen3.5-2B \
364
- --profile spark
370
+ --model Qwen/Qwen3.5-2B
365
371
  ```
366
372
 
367
- `tt hardware` reports which certified models this GPU can train, LoRA
368
- fine-tune, or serve. The shell agent can run the same inventory via its
369
- `examine_hardware` tool. Edit the generated `tunedtensor.json`, replacing both
370
- placeholder examples, then preflight and run:
373
+ Edit the generated `tunedtensor.json`, replacing both placeholder examples.
374
+ For a local GPU, `tt hardware` reports this machine's training and serving
375
+ capacity. For an AWS GPU, save the following as `local-runner.json` beside the
376
+ spec, replacing the instance, region, profile and SSH settings with your own:
377
+
378
+ ```json
379
+ {
380
+ "gpu": {
381
+ "provider": "aws",
382
+ "profile": "research",
383
+ "region": "eu-west-1",
384
+ "instanceId": "i-0123456789abcdef0",
385
+ "user": "ubuntu",
386
+ "identityFile": "~/.ssh/research-gpu.pem"
387
+ }
388
+ }
389
+ ```
390
+
391
+ The instance must already be running and reachable over SSH. See
392
+ [AWS GPU setup](docs/local-runtime/aws-gpu.md) for prerequisites, authentication,
393
+ transfer behavior and recovery. `tt hardware` always inspects the machine
394
+ running the CLI; `tt doctor` uses `gpu` to check the remote runtime.
395
+ Then validate, prefetch the base model locally, preview, and run:
371
396
 
372
397
  ```bash
373
- tt doctor tunedtensor.json
374
398
  tt validate tunedtensor.json
375
399
  tt models prefetch tunedtensor.json
400
+ tt doctor tunedtensor.json
401
+ tt pipeline run --spec tunedtensor.json --dry-run
376
402
  tt pipeline run --spec tunedtensor.json
377
403
  ```
378
404
 
379
- Inspect, verify, and serve a completed adapter:
405
+ These commands discover the adjacent `local-runner.json`. The preview needs
406
+ no GPU or AWS connection. Results return to the local run and model stores:
380
407
 
381
408
  ```bash
382
409
  tt runs report <run-id>
383
410
  tt models verify local-<run-id>
384
- tt serve local-<run-id> --config local-runner.json
411
+ ```
412
+
413
+ Serving still runs on the machine executing `tt serve` and requires a local
414
+ Linux/CUDA GPU, even when training used AWS:
415
+
416
+ ```bash
417
+ tt serve local-<run-id>
385
418
  ```
386
419
 
387
420
  Local currently certifies text SFT with `Qwen/Qwen3.5-2B` (pinned to snapshot
@@ -393,8 +426,9 @@ checkpointing, and adapts bounded shared attention/Mamba projections rather
393
426
  than every routed expert matrix. Muse Glimmer is a vision-language checkpoint
394
427
  whose text tower is fine-tuned through the image-text-to-text loader with the
395
428
  vision tower frozen and unused. Evaluation may use CPU; packaged local
396
- serving requires Linux and NVIDIA CUDA. Training
397
- artifacts, datasets, and model weights remain on the execution host.
429
+ serving requires Linux and NVIDIA CUDA. AWS execution transfers the required
430
+ datasets and model files to your instance and returns outputs locally; normal
431
+ cleanup removes the remote staging directory.
398
432
 
399
433
  Activation is optional and requires the run to pass a configured
400
434
  `generalRegression` gate. Without that suite, `tt models activate` fails
@@ -411,6 +445,33 @@ exports isolated Pi configuration; tools no longer need to be disabled. See
411
445
  [Local serving and coding harnesses](docs/local-runtime/serving.md) for Pi/OpenCode
412
446
  setup, resource budgets, hardware limits, and the verified integration scope.
413
447
 
448
+ ### Serve a foundation checkpoint
449
+
450
+ Serve a completed pretrain, fine-tune, or RL model directory with its training tokenizer:
451
+
452
+ ```sh
453
+ tt serve foundation --checkpoint /path/to/run/pretrain/output --tokenizer /path/to/run/tokenize/output/tokenizer.json
454
+ ```
455
+
456
+ Use the model artifact directory containing `config.json` and `model.safetensors`,
457
+ not a resumable optimizer checkpoint. The API model name is `foundation`.
458
+ `--spec tunedtensor.json` applies a foundation spec's system prompt. Existing
459
+ port, authentication, sampling, streaming, and client configuration options apply.
460
+ The context limit defaults to the checkpoint's `sequence_length`; a smaller
461
+ `--context-length` is allowed. Foundation serving supports text completions and
462
+ chat with system/user/assistant messages, without tool-call parsing.
463
+
464
+ TT exports the weights and tokenizer to a temporary GPT-2 snapshot and uses the
465
+ existing pinned vLLM server on Linux/CUDA. Training artifacts are unchanged; the
466
+ temporary export is removed when the server exits. Export requires temporary
467
+ disk space for a copy of the model weights.
468
+
469
+ Export parity tests run on CPU as part of `npm test`. To run them directly:
470
+
471
+ ```sh
472
+ uv run --frozen --project training/foundation --group test python -m unittest discover -s training/foundation/tests -p test_foundation_export.py
473
+ ```
474
+
414
475
  Useful discovery commands:
415
476
 
416
477
  ```bash
@@ -436,7 +497,7 @@ npm run test:workflows # Focused product workflow regressions; no model key or
436
497
  npm run check # Typecheck, all tests, and build (the release gate)
437
498
  ```
438
499
 
439
- See [the testing proposal and workflow contracts](docs/testing.md) for what the
500
+ See [testing and workflow contracts](docs/testing.md) for what the
440
501
  suite guarantees, how to evaluate a real agent with `npm run eval:agent`, and
441
502
  the remaining steps toward the full conversational product promise.
442
503