@tuned-tensor/cli 0.14.0 → 0.15.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/README.md CHANGED
@@ -1,35 +1,38 @@
1
1
  # tt - Tuned Tensor CLI
2
2
 
3
- `tt` is one terminal for local Tuned Tensor workflows:
4
-
5
- - a laptop-local conversational agent;
6
- - CUDA fine-tuning, held-out evaluation, artifact verification, model
7
- activation, and OpenAI-compatible serving on hardware you control.
8
-
9
- ## Cloud sunset
10
-
11
- This release unregisters the hosted API commands (`tt auth`, `tt publish`,
12
- `tt push`, `tt balance`, `tt topup`, `tt cloud`, and the rest of the managed
13
- tree). The modules remain in the repository so they can be restored later.
14
- `tt local …` is kept as a hidden alias. `tt run` is also retained as a hidden
15
- compatibility alias for the canonical adapter pipeline; new scripts should use
16
- `tt pipeline run --spec tunedtensor.json`.
17
-
18
- ## Migrating from 0.11
19
-
20
- `0.13` is the local-only CLI. If you are coming from `0.11.0`:
21
-
22
- - Run `tt` for the conversational workflow, `tt pipeline run` for explicit or
23
- automated execution, and `tt serve` for the serving lifecycle. `tt run` and
24
- `tt local …` remain hidden compatibility aliases.
25
- - Hosted account commands (`tt auth`, `tt publish`, `tt push`, and the rest)
26
- are unregistered.
27
- - `Qwen/Qwen3.5-2B` is pinned to Hugging Face snapshot
28
- `15852e8c16360a2fea060d615a32b45270f8a8fc`. Prefetch, train, eval, and serve
29
- reject any other revision.
30
- - `tt serve active` fails unless an adapter is activated. Activation requires
31
- a `generalRegression` suite in `local-runner.json`.
32
- - `tt info` reports `status: local`.
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.
7
+
8
+ Local training, evaluation, inspection, and serving need no TT access token.
9
+ Agent inference is a separate choice:
10
+
11
+ - **Managed:** sign in once with `tt auth login`. TT reuses your access token
12
+ through the Tuned Tensor model proxy. The server selects the model; no
13
+ OpenRouter key or model selection is needed.
14
+ - **Bring your own:** use your own OpenRouter or other provider credentials
15
+ and choose the model. Your requests go directly to that provider. TT does
16
+ not apply its managed model policy to BYO requests.
17
+
18
+ A saved BYO selection stays selected after TT login. Switch back with
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.
22
+
23
+ ## Unified commands
24
+
25
+ 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`.
28
+ `tt usage` reports managed agent allowance and usage; `tt balance` reports
29
+ cloud training credits. `tt publish` uploads local run evidence to the dashboard.
30
+
31
+ TT includes the former TT Local runtime. `tt local …` and `tt run` remain
32
+ hidden compatibility aliases; new scripts should use root commands and
33
+ `tt pipeline run --spec tunedtensor.json`. Existing token-free local projects
34
+ and saved BYO provider settings continue to work. Cloud operations previously
35
+ hidden in the local-only release are available under `tt cloud`.
33
36
 
34
37
  ## Install
35
38
 
@@ -78,35 +81,54 @@ npm link
78
81
  ## Conversational terminal
79
82
 
80
83
  The interactive agent harness and conversation state run on your laptop.
81
- Inference runs through the provider/model you select, which may be a
82
- local endpoint or a remote provider.
84
+ Inference uses the TT managed model or a BYO provider you select. A BYO
85
+ provider may be a local endpoint or a remote service.
83
86
 
84
87
  Run `tt` to open the primary conversational workflow. The agent can inspect the
85
88
  project, derive the canonical pipeline from `tunedtensor.json`, present the
86
- resolved plan, and prepare a sealed dry-run for `/approve`. Workflow commands such
87
- as `runs list` and `doctor` also work immediately. Chat waits until you choose a
88
- provider and model from inside the shell:
89
+ resolved plan, and prepare a sealed dry-run for `/approve`. Workflow commands
90
+ such as `runs list` and `doctor` work immediately without any credentials.
89
91
 
90
- ```text
91
- tt v0.13.1-beta.2
92
- agent not configured · workflow model base
93
- ctrl+c stop/clear · ctrl+d exit · /help commands · tab complete
92
+ For managed inference, save your TT access token with hidden input:
94
93
 
95
- Use /model to choose a provider and model. Workflow commands work now.
96
- › /model
97
- › /login openai
98
- › /model openai
99
- › /model openai/gpt-5.6-sol
94
+ ```bash
95
+ tt auth login
96
+ tt
100
97
  ```
101
98
 
102
- Use `/login` to save a provider API key. The shell asks which provider, then
103
- prompts for the key with hidden input and stores it under TT's local agent
104
- config. `/login <provider>` skips the provider prompt.
105
- `tt` does not accept provider secrets as flags and does not read
106
- `~/.pi/agent/`. `/model` and `/login` show OpenAI and OpenRouter.
107
- Other catalog providers remain available if you type their id.
108
- Unauthenticated entries are marked `auth required`. Local endpoints such as
109
- Ollama still need a placeholder `apiKey` in `models.json`.
99
+ Get a token from the dashboard's **Settings → API Keys** page. You can also
100
+ set `TUNED_TENSOR_API_KEY` in CI. When there is no saved BYO selection, TT
101
+ selects `tunedtensor/managed` automatically. In the shell, `/login tunedtensor`
102
+ saves the same account token and switches the saved agent selection to
103
+ `tunedtensor/managed`, including after restart. Managed inference requires no OpenRouter key
104
+ or additional login. The server controls the model and request limits.
105
+ `tt usage` shows the configured daily allowance and reported usage.
106
+
107
+ For BYO OpenRouter inference:
108
+
109
+ ```text
110
+ › /login openrouter
111
+ › /model openrouter/<model-id>
112
+ ```
113
+
114
+ `/login` asks which provider, then prompts for the TT access token or BYO
115
+ provider key with hidden input. `/login <provider>` skips the provider prompt.
116
+ `/model openrouter` lists the bundled catalog, but you can select any OpenRouter model ID, including one
117
+ newer than that catalog. OpenRouter validates the selected ID. New IDs use
118
+ conservative context/output defaults; custom metadata can be supplied in
119
+ `~/.tuned-tensor/agent/models.json`. For a model without reasoning support,
120
+ configure it with
121
+ `tt agent configure --provider openrouter --model <model-id> --thinking off`.
122
+ BYO inference is billed by your provider.
123
+
124
+ Provider keys are stored under TT's local agent config, separately from the
125
+ account token. The managed provider never stores your TT token in provider
126
+ files and does not accept endpoint/model overrides in `models.json`; use a
127
+ separate BYO provider for custom endpoints. `tt` does not read `~/.pi/agent/`.
128
+ `/model` and `/login` feature Tuned Tensor, OpenAI, and OpenRouter. Other
129
+ catalog providers remain available by ID. Unauthenticated entries are marked
130
+ `auth required`. Local endpoints such as Ollama use a placeholder `apiKey` in
131
+ `models.json` and need no TT account.
110
132
 
111
133
  Before the shell opens, `tt` performs a short, non-blocking npm version check.
112
134
  If a newer stable release is available it recommends
@@ -117,8 +139,8 @@ After a model is selected, the banner shows it and ordinary sentences go to
117
139
  the agent:
118
140
 
119
141
  ```text
120
- tt v0.13.1-beta.2
121
- agent anthropic/claude-sonnet-4-5 · workflow model base
142
+ tt v0.15.0
143
+ agent tunedtensor/managed · workflow model base
122
144
  ctrl+c stop/clear · ctrl+d exit · /help commands · tab complete
123
145
 
124
146
  Ask TT anything. Known commands run directly.
@@ -182,20 +204,21 @@ A changed workspace or spec requires a new review.
182
204
 
183
205
  Useful shell controls include `/help`, `/status`, `/context`, `/model`,
184
206
  `/login`, `/cd`, `/clear`, and `/exit`.
185
- The shell banner and `/context` surface the assistant's configured provider and
186
- model (`agent provider/model`) separately from the workflow model, so the
187
- model answering your prompts is always visible. `/model` shows and changes the
188
- laptop-local TT agent model: run it with no arguments to list providers and the
189
- two suggested models (GPT-5.6 Sol and DeepSeek V4 Flash), `/model <provider>`
190
- to list that provider's models, search
191
- with `/model <query>` (only the closest matches are shown), or switch with
192
- `/model <provider>/<model>` (for example `/model anthropic/claude-sonnet-4-5`).
193
- `/login` asks which provider to authenticate, then prompts for that provider's
194
- API key with hidden input. `/login <provider>` skips the provider prompt.
207
+ The shell banner and `/context` show the inference selection (`agent
208
+ provider/model`) separately from the workflow model. The managed alias identifies
209
+ inference through the server-selected model. Run `/model` with no arguments to
210
+ list the managed option and suggested BYO models, `/model <provider>` to list
211
+ that provider's models, or `/model <query>` to search. Switch with
212
+ `/model <provider>/<model>`, including `/model tunedtensor/managed` to return
213
+ to managed inference.
214
+ For managed inference, `tt agent configure --provider tunedtensor` needs no
215
+ model argument. For BYO inference, both provider and model are required.
195
216
  The equivalent non-interactive commands are `tt agent models`,
196
217
  `tt agent configure`, and `tt agent status`.
197
- `tt agent configure --thinking` accepts `off`, `minimal`, `low`, `medium`,
198
- `high`, `xhigh`, or `max`. Selection metadata can be overridden per process with
218
+ For BYO models, `tt agent configure --thinking` accepts `off`, `minimal`, `low`, `medium`,
219
+ `high`, `xhigh`, or `max`; managed inference uses the server's reasoning policy
220
+ and leaves the CLI thinking option off. Selection metadata can be overridden
221
+ per process with
199
222
  `TUNED_TENSOR_AGENT_PROVIDER`, `TUNED_TENSOR_AGENT_MODEL`, and
200
223
  `TUNED_TENSOR_AGENT_THINKING`. These values are not credentials.
201
224
  The shell keeps normal terminal scrollback and command history only for the
@@ -260,8 +283,8 @@ When `--config` is omitted, `pipeline run` uses `local-runner.json` beside the
260
283
  selected spec when that file exists.
261
284
 
262
285
  `--only` and `--skip` preserve dependency safety: a selected step cannot refer
263
- to an omitted predecessor. Cloud-targeted steps fail closed unless you pass
264
- `--dry-run`. Foundation documents are local-only. The TT agent may describe,
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,
265
288
  validate, and prepare a sealed pipeline action; only deterministic `/approve`
266
289
  handling can execute it.
267
290
 
@@ -273,6 +296,61 @@ scheduler, RNG, counters, and token cursor. See
273
296
  [Long foundation runs](docs/local-runtime/foundation-long-runs.md) before an
274
297
  unattended job.
275
298
 
299
+ ## Cloud runs and account reporting
300
+
301
+ Use the same TT token for cloud operations and managed inference. A BYO model
302
+ selection continues to work while you operate cloud runs with that token.
303
+
304
+ ```bash
305
+ tt auth login
306
+ tt cloud push --file tunedtensor.json
307
+ tt cloud runs estimate <spec-id>
308
+ tt cloud runs start <spec-id>
309
+ tt cloud runs watch <run-id>
310
+ tt cloud runs report <run-id>
311
+ tt cloud runs list
312
+ tt cloud models list
313
+ tt usage
314
+ tt balance
315
+ ```
316
+
317
+ Use the spec ID returned by `push`. `tt cloud specs`, `tt cloud datasets`,
318
+ `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.
322
+
323
+ With a TT token, the local agent can inspect cloud resources, run reports,
324
+ balances, transactions, and managed usage. It can prepare cloud spec edits for
325
+ `/approve`. Those proposals show the API origin and remain bound to the token
326
+ 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
330
+ local workflow commands and BYO inference continue to work.
331
+
332
+ `tt usage` reports the server-configured daily managed inference allowance.
333
+ Each provider completion, including a tool follow-up, consumes one request;
334
+ failed and cancelled requests also count. Token/cost coverage shows which
335
+ requests have provider usage reports, so incomplete reporting is not mistaken
336
+ 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.
339
+
340
+ Publish a local report for review in the dashboard:
341
+
342
+ ```bash
343
+ tt publish <local-run-id> --dry-run
344
+ tt publish <local-run-id>
345
+ tt cloud runs archive <published-run-id>
346
+ ```
347
+
348
+ Publishing shows the upload before confirmation and includes the spec, metrics,
349
+ prompts, and example model outputs. Archiving is supported for inactive local
350
+ reports published to the dashboard. Local model weights stay on your machine.
351
+ Use `--json` with reporting commands for scripts. `TUNED_TENSOR_URL` or
352
+ `--base-url` selects an alternate Tuned Tensor API deployment.
353
+
276
354
  ## Quick start
277
355
 
278
356
  Create a local project on an NVIDIA host:
@@ -314,7 +392,8 @@ Nemotron path is intended for DGX Spark-class unified memory, uses activation
314
392
  checkpointing, and adapts bounded shared attention/Mamba projections rather
315
393
  than every routed expert matrix. Muse Glimmer is a vision-language checkpoint
316
394
  whose text tower is fine-tuned through the image-text-to-text loader with the
317
- vision tower frozen and unused. Evaluation and serving may use CPU. Training
395
+ vision tower frozen and unused. Evaluation may use CPU; packaged local
396
+ serving requires Linux and NVIDIA CUDA. Training
318
397
  artifacts, datasets, and model weights remain on the execution host.
319
398
 
320
399
  Activation is optional and requires the run to pass a configured
@@ -353,8 +432,14 @@ npm run build
353
432
  npm run dev
354
433
  npm run typecheck
355
434
  npm test
435
+ npm run test:workflows # Focused product workflow regressions; no model key or GPU
436
+ npm run check # Typecheck, all tests, and build (the release gate)
356
437
  ```
357
438
 
439
+ See [the testing proposal and workflow contracts](docs/testing.md) for what the
440
+ suite guarantees, how to evaluate a real agent with `npm run eval:agent`, and
441
+ the remaining steps toward the full conversational product promise.
442
+
358
443
  ## License
359
444
 
360
445
  Apache-2.0
@@ -256,7 +256,7 @@ async function writeArtifactManifest(artifacts, options = {}) {
256
256
  let model;
257
257
  if (options.model) {
258
258
  if (options.model.framework !== "transformers-peft" || options.model.servable !== true || options.model.artifact_kind === "file" && options.model.format !== "tar.gz" || options.model.artifact_kind === "directory" && options.model.format !== "huggingface-directory") {
259
- throw new Error("TT Local model artifacts must be verified, servable Transformers PEFT adapters.");
259
+ throw new Error("TT local model artifacts must be verified, servable Transformers PEFT adapters.");
260
260
  }
261
261
  if (options.model.base_model_artifact_uri === void 0 !== (options.model.base_model_fingerprint === void 0)) {
262
262
  throw new Error("Model contracts must record a local base-model URI and fingerprint together.");
@@ -744,7 +744,7 @@ function assertCertifiedBaseModelConfig(value, label = "base-model config.json",
744
744
  return;
745
745
  }
746
746
  throw new Error(
747
- `${label} is not a certified TT Local base-model architecture.`
747
+ `${label} is not a certified TT base-model architecture.`
748
748
  );
749
749
  }
750
750
  function localModelArtifactPath(uri) {
@@ -4455,9 +4455,17 @@ async function prepareStage(args) {
4455
4455
  canReuse = await verifyReusableArtifacts(args.artifacts, [
4456
4456
  args.artifacts.stageMetadataJson,
4457
4457
  args.artifacts.trainingJsonl
4458
- ]);
4458
+ ], { verifyModel: true });
4459
4459
  }
4460
4460
  if (canReuse) {
4461
+ for (const stage of ["baseline", "train", "candidate"]) {
4462
+ await canReuseStageArtifact({
4463
+ stage,
4464
+ prepared,
4465
+ config: args.config,
4466
+ additionalPaths: stage === "train" ? [] : generalRegressionRequiredPaths(prepared, stage)
4467
+ });
4468
+ }
4461
4469
  await throwIfCancelled(args.store, args.request);
4462
4470
  await updateRun({
4463
4471
  ...args,
@@ -5848,4 +5856,4 @@ export {
5848
5856
  formatAgentHostBlock,
5849
5857
  assessHardware
5850
5858
  };
5851
- //# sourceMappingURL=chunk-VRDDO2FP.js.map
5859
+ //# sourceMappingURL=chunk-VVKC563R.js.map