@tuned-tensor/cli 0.19.0 → 0.21.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 +45 -9
- package/dist/{chunk-4Q54NHKR.js → chunk-PVLX7LJI.js} +381 -148
- package/dist/chunk-PVLX7LJI.js.map +1 -0
- package/dist/index.js +2051 -417
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +41 -6
- package/dist/local-runtime.js.map +1 -1
- package/docs/local-runtime/architecture.md +6 -1
- package/docs/local-runtime/decision.md +142 -0
- package/docs/spec-architecture.html +2 -2
- package/docs/spec-workflow.md +16 -7
- package/examples/single-spec/decision/tunedtensor.json +630 -0
- package/package.json +5 -2
- package/training/adapter/src/evaluate.py +14 -7
- package/training/adapter/src/model_contract.py +38 -5
- package/training/adapter/src/prefetch.py +6 -1
- package/training/adapter/src/serve.py +37 -11
- package/training/adapter/src/train.py +8 -0
- package/training/decision/pyproject.toml +25 -0
- package/training/decision/src/common.py +127 -0
- package/training/decision/src/evaluate.py +70 -0
- package/training/decision/src/train.py +181 -0
- package/training/decision/uv.lock +1175 -0
- package/dist/chunk-4Q54NHKR.js.map +0 -1
package/README.md
CHANGED
|
@@ -94,9 +94,14 @@ npm link
|
|
|
94
94
|
## Behavior spec workflow
|
|
95
95
|
|
|
96
96
|
`tunedtensor.json` is the source of truth for behavior and training settings.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
In the shell, `/spec` shows a readable overview grouped into behavior,
|
|
98
|
+
examples, training, evaluation and runtime sections; `/spec <section>` (for
|
|
99
|
+
example `/spec examples`) shows one section in full and `/spec show` prints the
|
|
100
|
+
highlighted JSON. `/spec diff`, `/spec validate`, and `/spec history` complete
|
|
101
|
+
the review, all without a model call. Outside the shell, `tt spec view` and
|
|
102
|
+
`tt spec <section>` print the same readable view. Ask the agent for changes, inspect its proposed
|
|
103
|
+
diff, then press `y` when tt asks (or `/approve` later) to save a validated edit
|
|
104
|
+
with revision history. Pipeline
|
|
100
105
|
runs use the saved spec. See [the spec workflow](docs/spec-workflow.md).
|
|
101
106
|
|
|
102
107
|
## Conversational terminal
|
|
@@ -173,7 +178,9 @@ Ordinary sentences go through the locally orchestrated model session. The
|
|
|
173
178
|
model has no shell or general filesystem tool. It can read and propose reviewed
|
|
174
179
|
edits to an existing spec, or prepare one new folder directly beneath the shell's current working directory with a validated
|
|
175
180
|
`tunedtensor.json`, or prepare a local pipeline dry-run sealed to the reviewed
|
|
176
|
-
workspace and spec contents. Writes and pipeline previews wait for
|
|
181
|
+
workspace and spec contents. Writes and pipeline previews wait for your approval: after the
|
|
182
|
+
answer, tt shows the proposal and asks inline, where `y` approves, `n` rejects and `Esc`
|
|
183
|
+
leaves it pending for a later `/approve` or `/reject`. Any other key is ignored. The tools refuse path
|
|
177
184
|
traversal, symlinked workspace roots, overwriting a new-project target, unsupported spec
|
|
178
185
|
fields, cloud pipeline targets, and spec changes after review. Known CLI
|
|
179
186
|
commands such as `runs list`, `doctor`, and `models list` still execute directly.
|
|
@@ -223,8 +230,15 @@ that request real execution fail before the child command is dispatched. Real
|
|
|
223
230
|
training remains available through the explicit direct `tt pipeline run` command.
|
|
224
231
|
A changed workspace or spec requires a new review.
|
|
225
232
|
|
|
226
|
-
Useful shell controls include `/help`, `/status`, `/context`, `/
|
|
227
|
-
`/login`, `/cd`, `/clear`, and `/exit`.
|
|
233
|
+
Useful shell controls include `/help`, `/status`, `/context`, `/system`,
|
|
234
|
+
`/model`, `/login`, `/cd`, `/clear`, and `/exit`.
|
|
235
|
+
When the shell opens, the TT logo mark (drawn in the terminal) greets you with the current spec, a
|
|
236
|
+
live machine panel (GPU utilization, VRAM and temperature from `nvidia-smi`,
|
|
237
|
+
CPU, RAM, and free space in the model cache) and whether this machine can
|
|
238
|
+
fine-tune the spec's base model, plus a suggested next step. `/system` refreshes
|
|
239
|
+
that panel and lists every certified base model's verdict. Fit verdicts come
|
|
240
|
+
from the same certified memory profiles as `tt hardware`; a fresh
|
|
241
|
+
`tt hardware` snapshot takes precedence over the quick live check.
|
|
228
242
|
The shell banner and `/context` show the inference selection (`agent
|
|
229
243
|
provider/model`) separately from the workflow model. The managed alias identifies
|
|
230
244
|
inference through the server-selected model. Run `/model` with no arguments to
|
|
@@ -257,18 +271,40 @@ optional `gpu` configuration moves its GPU processes to your AWS instance.
|
|
|
257
271
|
The portable document contract lives in `@tuned-tensor/pipeline-contract`. The
|
|
258
272
|
CLI adds execution planning (step selection) on top of it.
|
|
259
273
|
|
|
260
|
-
|
|
274
|
+
Three local engines share that document version:
|
|
261
275
|
|
|
262
276
|
- **Adapter** (default): LoRA SFT on a certified Hugging Face checkpoint.
|
|
263
277
|
Runs through `tt pipeline run`. Uses `train` / `evaluate` / `compare` with
|
|
264
278
|
`evaluate.with.evaluator: "behavior"`.
|
|
279
|
+
Certified models (`Qwen/Qwen3.5-2B`, Nemotron 3.5 Lightning, Muse Glimmer)
|
|
280
|
+
have a reviewed revision, architecture, and memory profile. Any other
|
|
281
|
+
Hugging Face text model can be trained as **uncertified** by pinning its
|
|
282
|
+
commit; it loads as a causal LM with safetensors weights, no remote code,
|
|
283
|
+
and generic LoRA defaults (override them in `hyperparameters`):
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"base_model": "mistralai/Mistral-7B-Instruct-v0.3",
|
|
288
|
+
"hyperparameters": { "base_model_revision": "<40-char commit SHA>" }
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Pick an instruct/chat variant (the trainer needs a chat template) and check
|
|
293
|
+
hardware fit with `tt doctor`, since TT has no memory profile for it.
|
|
265
294
|
- **Foundation**: from-scratch tokenizer + GPT. Also runs through
|
|
266
295
|
`tt pipeline run`. Uses
|
|
267
296
|
`tokenize` / `pretrain` / `finetune` / optional `rl` plus `bpb`, `chat`, and
|
|
268
297
|
`inference` evaluators. Requires a foundation `tunedtensor.json`
|
|
269
298
|
(`engine: "foundation"`, at least two examples, no `base_model`).
|
|
270
|
-
|
|
271
|
-
|
|
299
|
+
- **Decision**: fine-tunes a small typed decision model
|
|
300
|
+
(`convaiinnovations/laya`, 421M) that answers one choice, yes/no or score
|
|
301
|
+
question per input with a probability per label, instead of generating text.
|
|
302
|
+
Uses the adapter vocabulary (`train` / `evaluate` / `compare`) and runs on
|
|
303
|
+
CPU, Apple MPS or CUDA. Requires `engine: "decision"` and a `decision`
|
|
304
|
+
question; example outputs are labels. See
|
|
305
|
+
[Decision models](docs/local-runtime/decision.md).
|
|
306
|
+
|
|
307
|
+
All engines are spec-driven. `system_prompt`, `guidelines`, and `constraints`
|
|
272
308
|
are compiled into one canonical system instruction, and `examples` supply the
|
|
273
309
|
demonstrated behavior. Adapter training, foundation tokenizer/pretraining,
|
|
274
310
|
chat SFT, optional RL, and evaluation all receive that same compiled
|