@tuned-tensor/cli 0.16.0 → 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 CHANGED
@@ -21,6 +21,11 @@ Inference choice is independent of where training uses a GPU. Your AWS GPU
21
21
  needs AWS credentials and SSH access; TT account operations under `tt cloud`
22
22
  require a TT access token.
23
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.
28
+
24
29
  ## Unified commands
25
30
 
26
31
  Local workflows remain the default: `tt pipeline run`, `tt runs list`,
@@ -86,6 +91,14 @@ npm run build
86
91
  npm link
87
92
  ```
88
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
+
89
102
  ## Conversational terminal
90
103
 
91
104
  The interactive agent harness and conversation state run on your laptop.
@@ -157,11 +170,11 @@ Ask TT anything. Known commands run directly.
157
170
  ```
158
171
 
159
172
  Ordinary sentences go through the locally orchestrated model session. The
160
- model has no shell or general filesystem tool. It can prepare one new folder
161
- 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
162
175
  `tunedtensor.json`, or prepare a local pipeline dry-run sealed to the reviewed
163
- workspace and spec contents. Neither action starts until `/approve`. The tools refuse path
164
- traversal, symlinked workspace roots, existing spec targets, unsupported spec
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
165
178
  fields, cloud pipeline targets, and spec changes after review. Known CLI
166
179
  commands such as `runs list`, `doctor`, and `models list` still execute directly.
167
180
  Prefix a command with `:` when you want to make that intent explicit.
@@ -275,6 +288,10 @@ expected output for every example. Treat those metrics as an end-to-end
275
288
  execution and overfit check—not held-out capability or multi-GPU evidence when
276
289
  no validation corpus is configured.
277
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
+
278
295
  ```bash
279
296
  tt pipeline init --file pipeline.json
280
297
  tt pipeline init --engine foundation --file foundation.pipeline.json
@@ -370,7 +387,7 @@ tt init \
370
387
  --model Qwen/Qwen3.5-2B
371
388
  ```
372
389
 
373
- Edit the generated `tunedtensor.json`, replacing both placeholder examples.
390
+ Edit the generated `tunedtensor.json`, replacing the placeholder system prompt and both placeholder examples.
374
391
  For a local GPU, `tt hardware` reports this machine's training and serving
375
392
  capacity. For an AWS GPU, save the following as `local-runner.json` beside the
376
393
  spec, replacing the instance, region, profile and SSH settings with your own:
@@ -1438,6 +1438,56 @@ async function loadLocalRunInput(path, options = {}) {
1438
1438
  options
1439
1439
  );
1440
1440
  }
1441
+ function specHash(source) {
1442
+ return createHash2("sha256").update(source).digest("hex");
1443
+ }
1444
+ function validateBehaviorSpec(input) {
1445
+ const errors = [];
1446
+ const warnings = [];
1447
+ if (input.kind === "request") {
1448
+ return { valid: false, errors: ["Use a behavior spec, not a run request."], warnings };
1449
+ }
1450
+ const { spec } = input;
1451
+ const placeholders = input.kind === "foundation-spec" ? foundationPlaceholderIssues(input.spec) : generatedPlaceholderIssues(input.request);
1452
+ if (placeholders.length) {
1453
+ errors.push(`Edit the generated behavior spec before training: ${placeholders.join("; ")}.`);
1454
+ }
1455
+ if (input.kind === "foundation-spec") {
1456
+ if (input.spec.foundation.nproc_per_node !== 1) {
1457
+ errors.push("Foundation nproc_per_node must be 1 for this runtime.");
1458
+ }
1459
+ const nonNumericOutput = spec.examples.some(
1460
+ (example) => !/-?\d+(?:\.\d+)?/.test(example.output.replaceAll(",", ""))
1461
+ );
1462
+ if (input.spec.foundation.rl_steps > 0 && nonNumericOutput) {
1463
+ errors.push("Foundation RL requires numeric expected outputs in every example.");
1464
+ }
1465
+ }
1466
+ for (const key of ["name", "system_prompt"]) {
1467
+ if (!spec[key].trim()) errors.push(`${key} must not be blank.`);
1468
+ }
1469
+ if (spec.examples.length < 2 && !(input.kind === "spec" && input.spec.dataset_prebuilt)) {
1470
+ errors.push("Add at least two examples for training and evaluation.");
1471
+ }
1472
+ const seen = /* @__PURE__ */ new Set();
1473
+ for (const [index, example] of spec.examples.entries()) {
1474
+ if (!example.input.trim() || !example.output.trim()) {
1475
+ errors.push(`examples[${index}] input and output must not be blank.`);
1476
+ }
1477
+ const key = example.input.trim();
1478
+ if (seen.has(key)) {
1479
+ errors.push(`examples[${index}] repeats an input; use distinct examples to avoid conflicting labels or train/eval overlap.`);
1480
+ }
1481
+ seen.add(key);
1482
+ }
1483
+ if (!spec.guidelines.length) {
1484
+ warnings.push("Add guidelines to make expected behavior explicit.");
1485
+ }
1486
+ if (spec.examples.length < 10) {
1487
+ warnings.push("This is a small example set; passing validation does not establish model quality.");
1488
+ }
1489
+ return { valid: errors.length === 0, errors, warnings };
1490
+ }
1441
1491
 
1442
1492
  // src/local-runtime/dataset.ts
1443
1493
  import { readFile as readFile3 } from "fs/promises";
@@ -6077,6 +6127,8 @@ export {
6077
6127
  runRequestFromLocalSpec,
6078
6128
  parseLocalRunInput,
6079
6129
  loadLocalRunInput,
6130
+ specHash,
6131
+ validateBehaviorSpec,
6080
6132
  normalizeChatJsonlForRelocation,
6081
6133
  buildSystemMessage,
6082
6134
  exampleToChatRow,
@@ -6126,4 +6178,4 @@ export {
6126
6178
  formatAgentHostBlock,
6127
6179
  assessHardware
6128
6180
  };
6129
- //# sourceMappingURL=chunk-6RLNBTM6.js.map
6181
+ //# sourceMappingURL=chunk-KRKISPHG.js.map