@toloka-platform/sdk 0.27.0 → 0.27.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.
Files changed (34) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/toloka.js +179 -190
  3. package/dist/cli/toloka.js.jsc +0 -0
  4. package/dist/cli/toloka.js.jsc.sha256 +1 -1
  5. package/dist/cli/toloka.js.sha256 +1 -1
  6. package/examples/video-pair-rating/nodes/adjudicate/node.ts +1 -1
  7. package/examples/video-pair-rating/nodes/adjudicate_op/node.ts +1 -1
  8. package/examples/video-pair-rating/nodes/overall_preference_pick/node.ts +5 -1
  9. package/examples/video-pair-rating/nodes/rate_pair/node.ts +5 -1
  10. package/openapi/gen/api.schemas.ts +51 -758
  11. package/openapi/gen/api.ts +0 -860
  12. package/package.json +2 -2
  13. package/skills/catalog.json +6 -40
  14. package/skills/toloka-build/references/human-work.md +15 -6
  15. package/skills/toloka-build/references/local-setup.md +2 -2
  16. package/skills/toloka-build/references/workflow-and-cli.md +3 -22
  17. package/skills/toloka-get-started/SKILL.md +9 -13
  18. package/src/cli/analytics.ts +0 -31
  19. package/src/cli/context.ts +0 -109
  20. package/src/cli/init.ts +1 -1
  21. package/src/cli/program.ts +0 -6
  22. package/src/cli/project.ts +9 -1
  23. package/src/client.ts +0 -259
  24. package/src/importer.ts +12 -2
  25. package/src/index.ts +0 -2
  26. package/src/pipeline-graph-v1.contract.json +130 -128
  27. package/skills/toloka-fine-tuning/SKILL.md +0 -177
  28. package/skills/toloka-gisting/SKILL.md +0 -186
  29. package/src/cli/batch-inference.ts +0 -267
  30. package/src/cli/commands/batch-inference.ts +0 -116
  31. package/src/cli/commands/models.ts +0 -121
  32. package/src/cli/commands/training.ts +0 -275
  33. package/src/cli/models.ts +0 -304
  34. package/src/cli/trainings.ts +0 -880
@@ -2390,7 +2390,76 @@
2390
2390
  ],
2391
2391
  "additionalProperties": false
2392
2392
  },
2393
+ "allowedExperts": {
2394
+ "default": [],
2395
+ "description": "Ids of up to 20 fields at the node's input, each holding an expert id (string) or a list of expert ids (array of strings). Before each upload of an item's task, only the experts these fields name for the item can take it, and only those in the node's expert-list audience. An expert id is 1 to 128 letters, digits, `_`, `.`, `:` or `-`; a value that is not one fails the item, as does an item whose fields name no such expert or more than 100 of them. Experts outside the node's expert lists are skipped with a warning in the item trace. Requires per-item expert settings and expert lists for the team and an expert-list audience. `[]` lets any expert of the audience take the task.",
2396
+ "maxItems": 20,
2397
+ "type": "array",
2398
+ "items": {
2399
+ "type": "string"
2400
+ }
2401
+ },
2402
+ "excludedExperts": {
2403
+ "default": [],
2404
+ "description": "Ids of up to 20 fields at the node's input, each holding an expert id or a list of expert ids: a dataset field, or an upstream node's `generation_sft_<nodeId>_annotator_id`, `generation_sft_<nodeId>_qa_annotator_id` or `quorum_sft_<nodeId>_annotator_ids`. The experts they name for an item can't take its task, on top of the experts the platform already excludes. An expert id is 1 to 128 letters, digits, `_`, `.`, `:` or `-`; other values are skipped with a warning in the item trace; more than 100 ids fail the item. Requires per-item expert settings for the team. `[]` adds no exclusions.",
2405
+ "maxItems": 20,
2406
+ "type": "array",
2407
+ "items": {
2408
+ "type": "string"
2409
+ }
2410
+ },
2411
+ "checks": {
2412
+ "type": "object",
2413
+ "propertyNames": {
2414
+ "type": "string",
2415
+ "enum": [
2416
+ "ui",
2417
+ "llmqa",
2418
+ "annotation_qa",
2419
+ "qc_lint",
2420
+ "ui_types_lint",
2421
+ "exam_dataset",
2422
+ "synthgen"
2423
+ ]
2424
+ },
2425
+ "additionalProperties": {
2426
+ "type": "array",
2427
+ "items": {
2428
+ "type": "object",
2429
+ "properties": {
2430
+ "id": {
2431
+ "type": "string"
2432
+ },
2433
+ "name": {
2434
+ "type": "string"
2435
+ },
2436
+ "input": {
2437
+ "anyOf": [
2438
+ {
2439
+ "type": "string"
2440
+ },
2441
+ {
2442
+ "type": "object",
2443
+ "propertyNames": {
2444
+ "type": "string"
2445
+ },
2446
+ "additionalProperties": {
2447
+ "type": "string"
2448
+ }
2449
+ }
2450
+ ]
2451
+ }
2452
+ },
2453
+ "required": [
2454
+ "id",
2455
+ "name",
2456
+ "input"
2457
+ ]
2458
+ }
2459
+ }
2460
+ },
2393
2461
  "reuseAudienceWithNodeId": {
2462
+ "deprecated": true,
2394
2463
  "anyOf": [
2395
2464
  {
2396
2465
  "type": "object",
@@ -2415,7 +2484,7 @@
2415
2484
  ]
2416
2485
  },
2417
2486
  "smartSearch": {
2418
- "default": null,
2487
+ "deprecated": true,
2419
2488
  "anyOf": [
2420
2489
  {
2421
2490
  "type": "object",
@@ -2475,74 +2544,6 @@
2475
2544
  "type": "null"
2476
2545
  }
2477
2546
  ]
2478
- },
2479
- "allowedExperts": {
2480
- "default": [],
2481
- "description": "Ids of up to 20 fields at the node's input, each holding an expert id (string) or a list of expert ids (array of strings). Before each upload of an item's task, only the experts these fields name for the item can take it, and only those in the node's expert-list audience. An expert id is 1 to 128 letters, digits, `_`, `.`, `:` or `-`; a value that is not one fails the item, as does an item whose fields name no such expert or more than 100 of them. Experts outside the node's expert lists are skipped with a warning in the item trace. Requires per-item expert settings and expert lists for the team and an expert-list audience. `[]` lets any expert of the audience take the task.",
2482
- "maxItems": 20,
2483
- "type": "array",
2484
- "items": {
2485
- "type": "string"
2486
- }
2487
- },
2488
- "excludedExperts": {
2489
- "default": [],
2490
- "description": "Ids of up to 20 fields at the node's input, each holding an expert id or a list of expert ids: a dataset field, or an upstream node's `generation_sft_<nodeId>_annotator_id`, `generation_sft_<nodeId>_qa_annotator_id` or `quorum_sft_<nodeId>_annotator_ids`. The experts they name for an item can't take its task, on top of the experts the platform already excludes. An expert id is 1 to 128 letters, digits, `_`, `.`, `:` or `-`; other values are skipped with a warning in the item trace; more than 100 ids fail the item. Requires per-item expert settings for the team. `[]` adds no exclusions.",
2491
- "maxItems": 20,
2492
- "type": "array",
2493
- "items": {
2494
- "type": "string"
2495
- }
2496
- },
2497
- "checks": {
2498
- "type": "object",
2499
- "propertyNames": {
2500
- "type": "string",
2501
- "enum": [
2502
- "ui",
2503
- "llmqa",
2504
- "annotation_qa",
2505
- "qc_lint",
2506
- "ui_types_lint",
2507
- "exam_dataset",
2508
- "synthgen"
2509
- ]
2510
- },
2511
- "additionalProperties": {
2512
- "type": "array",
2513
- "items": {
2514
- "type": "object",
2515
- "properties": {
2516
- "id": {
2517
- "type": "string"
2518
- },
2519
- "name": {
2520
- "type": "string"
2521
- },
2522
- "input": {
2523
- "anyOf": [
2524
- {
2525
- "type": "string"
2526
- },
2527
- {
2528
- "type": "object",
2529
- "propertyNames": {
2530
- "type": "string"
2531
- },
2532
- "additionalProperties": {
2533
- "type": "string"
2534
- }
2535
- }
2536
- ]
2537
- }
2538
- },
2539
- "required": [
2540
- "id",
2541
- "name",
2542
- "input"
2543
- ]
2544
- }
2545
- }
2546
2547
  }
2547
2548
  },
2548
2549
  "required": [
@@ -4234,7 +4235,66 @@
4234
4235
  ],
4235
4236
  "additionalProperties": false
4236
4237
  },
4238
+ "excludedExperts": {
4239
+ "default": [],
4240
+ "description": "Ids of up to 20 fields at the node's input, each holding an expert id or a list of expert ids: a dataset field, or an upstream node's `generation_sft_<nodeId>_annotator_id`, `generation_sft_<nodeId>_qa_annotator_id` or `quorum_sft_<nodeId>_annotator_ids`. The experts they name for an item can't take its quorum tasks, on top of the experts the platform already excludes. An expert id is 1 to 128 letters, digits, `_`, `.`, `:` or `-`; other values are skipped with a warning in the item trace; more than 100 ids fail the item. Requires per-item expert settings for the team. `[]` adds no exclusions.",
4241
+ "maxItems": 20,
4242
+ "type": "array",
4243
+ "items": {
4244
+ "type": "string"
4245
+ }
4246
+ },
4247
+ "checks": {
4248
+ "type": "object",
4249
+ "propertyNames": {
4250
+ "type": "string",
4251
+ "enum": [
4252
+ "ui",
4253
+ "llmqa",
4254
+ "annotation_qa",
4255
+ "qc_lint",
4256
+ "ui_types_lint",
4257
+ "exam_dataset"
4258
+ ]
4259
+ },
4260
+ "additionalProperties": {
4261
+ "type": "array",
4262
+ "items": {
4263
+ "type": "object",
4264
+ "properties": {
4265
+ "id": {
4266
+ "type": "string"
4267
+ },
4268
+ "name": {
4269
+ "type": "string"
4270
+ },
4271
+ "input": {
4272
+ "anyOf": [
4273
+ {
4274
+ "type": "string"
4275
+ },
4276
+ {
4277
+ "type": "object",
4278
+ "propertyNames": {
4279
+ "type": "string"
4280
+ },
4281
+ "additionalProperties": {
4282
+ "type": "string"
4283
+ }
4284
+ }
4285
+ ]
4286
+ }
4287
+ },
4288
+ "required": [
4289
+ "id",
4290
+ "name",
4291
+ "input"
4292
+ ]
4293
+ }
4294
+ }
4295
+ },
4237
4296
  "reuseAudienceWithNodeId": {
4297
+ "deprecated": true,
4238
4298
  "anyOf": [
4239
4299
  {
4240
4300
  "type": "object",
@@ -4259,7 +4319,7 @@
4259
4319
  ]
4260
4320
  },
4261
4321
  "smartSearch": {
4262
- "default": null,
4322
+ "deprecated": true,
4263
4323
  "anyOf": [
4264
4324
  {
4265
4325
  "type": "object",
@@ -4319,64 +4379,6 @@
4319
4379
  "type": "null"
4320
4380
  }
4321
4381
  ]
4322
- },
4323
- "excludedExperts": {
4324
- "default": [],
4325
- "description": "Ids of up to 20 fields at the node's input, each holding an expert id or a list of expert ids: a dataset field, or an upstream node's `generation_sft_<nodeId>_annotator_id`, `generation_sft_<nodeId>_qa_annotator_id` or `quorum_sft_<nodeId>_annotator_ids`. The experts they name for an item can't take its quorum tasks, on top of the experts the platform already excludes. An expert id is 1 to 128 letters, digits, `_`, `.`, `:` or `-`; other values are skipped with a warning in the item trace; more than 100 ids fail the item. Requires per-item expert settings for the team. `[]` adds no exclusions.",
4326
- "maxItems": 20,
4327
- "type": "array",
4328
- "items": {
4329
- "type": "string"
4330
- }
4331
- },
4332
- "checks": {
4333
- "type": "object",
4334
- "propertyNames": {
4335
- "type": "string",
4336
- "enum": [
4337
- "ui",
4338
- "llmqa",
4339
- "annotation_qa",
4340
- "qc_lint",
4341
- "ui_types_lint",
4342
- "exam_dataset"
4343
- ]
4344
- },
4345
- "additionalProperties": {
4346
- "type": "array",
4347
- "items": {
4348
- "type": "object",
4349
- "properties": {
4350
- "id": {
4351
- "type": "string"
4352
- },
4353
- "name": {
4354
- "type": "string"
4355
- },
4356
- "input": {
4357
- "anyOf": [
4358
- {
4359
- "type": "string"
4360
- },
4361
- {
4362
- "type": "object",
4363
- "propertyNames": {
4364
- "type": "string"
4365
- },
4366
- "additionalProperties": {
4367
- "type": "string"
4368
- }
4369
- }
4370
- ]
4371
- }
4372
- },
4373
- "required": [
4374
- "id",
4375
- "name",
4376
- "input"
4377
- ]
4378
- }
4379
- }
4380
4382
  }
4381
4383
  },
4382
4384
  "required": [
@@ -1,177 +0,0 @@
1
- ---
2
- name: toloka-fine-tuning
3
- description: Create, estimate, start, monitor, and verify a project-owned supervised fine-tuning (SFT with LoRA adapters) Training through the Toloka CLI. Use when the user wants to adapt a base model or an existing LoRA Model Version from labeled conversations.
4
- ---
5
-
6
- # Fine-tune a model with Toloka
7
-
8
- ## Mission
9
-
10
- Help the user adapt a compatible model from labeled conversations while preserving their intended task, data, model, and budget constraints. Match the work to the requested outcome: inspect an existing Training or run, prepare a draft, calculate an estimate, start an approved run, monitor it, or retrieve its output. Do not create resources or start a run merely because they appear later in this reference.
11
-
12
- For first-time setup details, read `https://platform.toloka.ai/agents/fine-tuning.md`.
13
-
14
- ## Domain model
15
-
16
- - **SFT** adapts model weights from representative chat examples. Each training row must follow the platform chat contract and end with the assistant response the model should learn to produce. Rows with tool calls also need `tools` declaring every function they call. Each call's `arguments` must be a string holding a JSON object (it is not checked against the function's `parameters`), call ids must be unique within a turn, and the `tool` replies must answer every call before the next turn. Cost estimation rejects rows that break these rules and names the first few in its error.
17
- - A **Training** is an editable project-owned draft. A **Training Run** is one immutable, billable execution of a frozen draft and the rows of its slice.
18
- - A run can start from a catalog **Base Model** or an exact existing **Model Version**. An explicit Model Version is the source; do not also select a Base Model.
19
- - A completed run publishes a durable Model Version. It does not prove deployment or inference readiness.
20
- - Training and validation are data roles, not file-layout rules. A **split column** puts each Dataset row in a part such as `train`, `validate` or `test`, and a **slice** freezes rows together with their split columns. A Training learns on a slice's rows in the train parts of one split column and validates on its validate parts, which may include a part that also tests. Without validation rows, the provider reserves 10% of the training rows as a holdout.
21
- - A Training needs `--dataset <dataset>` or `--slice <id>`. `--dataset` fills the empty cells of the Dataset's split column (a new `split` column, 80/10/10, when it has none) and freezes a slice named after the Training; `--slice` takes a slice frozen with `toloka dataset slice create`, which must freeze a split column. Rows without a part are never trained on. Rows that any split column puts in a test part never reach training, nor validation unless they sit in a validate + test part of the Training's own split column; the cost estimate reports any train rows they remove as `Left out as test`. `toloka dataset split <dataset>` places only rows without a part, so after adding rows, run it again and take a new slice: no test row moves into training. `toloka dataset columns <dataset>` shows the split columns and their roles.
22
-
23
- ## Working posture
24
-
25
- - Inspect the user's request and current CLI, project, Training, Dataset, and run state before changing anything. The process below is a dependency map: skip satisfied or irrelevant work and stop when the requested outcome is complete.
26
- - Honor explicit choices first. If a requested project, source, Dataset, or configuration is incompatible, explain the evidence and tradeoff before proposing a substitute.
27
- - Make routine reversible choices and briefly explain them. Ask a focused question only for material ambiguity, missing authorization or inputs, conflicting constraints, or destructive or out-of-scope changes.
28
- - If the goal is prompt compression or data labeling rather than SFT, explain the distinction and route to `toloka-gisting` or `toloka-build`; never silently change the method.
29
-
30
- ## Safety
31
-
32
- - Never ask for an API key in chat; the user enters it through `toloka login`.
33
- - Never invent project, Dataset, Base Model, Training, Model, Model Version, price, or run IDs. Read identity and source metadata from the CLI.
34
- - Use only authorized project Datasets containing representative data. Keep credentials and production data out of source control and agent messages.
35
- - Preserve train/validation separation and avoid duplicate or near-duplicate examples across roles.
36
- - Never start a Training Run before the user approves the ready estimate's exact `maximumCharge`.
37
- - Keep polling bounded. Report terminal state only when the CLI shows it, and report timeouts as still running.
38
-
39
- ## Process
40
-
41
- ### 1. Establish only the context the goal needs
42
-
43
- When the CLI, authentication, or binding is unknown, inspect it. The runtime-inclusive standalone CLI is sufficient for Training-only work; no separate Bun or Node.js installation, SDK, TypeScript, or test packages are needed:
44
-
45
- ```sh
46
- toloka --version
47
- toloka whoami
48
- toloka project current
49
- ```
50
-
51
- Reuse an authenticated, compatible workspace. For an inspection request, inspect existing resources rather than creating a project, Dataset, Training, or run.
52
-
53
- Use the project the user explicitly requested. Otherwise keep the current binding when it is consistent with the task. If no suitable project is bound and the requested work needs one, inspect `toloka project list --limit 20`, then create a task-named project or register the exact existing project the user identified. Do not silently select an unrelated project or rebind an existing checkout; use an explicit `--project-id` or a separate source root when working against another project without changing the binding.
54
-
55
- ### 2. Inspect and assign data roles
56
-
57
- ```sh
58
- toloka dataset list
59
- toloka dataset fields <dataset-name-or-id>
60
- ```
61
-
62
- Use the user's authorized data and existing role assignments. If local JSONL files must be uploaded, put them in one Dataset for the task; `dataset upload` appends, and a split column records each row's role:
63
-
64
- ```sh
65
- toloka dataset create <dataset-name>
66
- toloka dataset upload <dataset-name> <absolute-jsonl-path>
67
- toloka dataset fields <dataset-name>
68
- ```
69
-
70
- When the user supplied separate training and validation files, give each file its role before uploading the next one: `toloka dataset split <dataset-name> --parts train:100 --json` after the training file, then `toloka dataset split <dataset-name> --parts validate:100 --json` after the validation file. Each fill places only rows without a part, so a supplied validation set never mixes into training; pass `--parts` on every such fill, because a fill without it repeats the column's last shares. For one undivided file, let the split sample it: `toloka dataset split <dataset-name> --ratios 80/10/10 [--balance-by <label-field>] --json`, or leave it to `training create --dataset`, which splits 80/10/10.
71
-
72
- CLI uploads to an otherwise undeclared Dataset store each row whole in its `uploaded` field, so the rows' own fields are not dataset fields yet. `toloka dataset fields add <dataset> <field>…` adds top-level fields of the uploaded rows as dataset fields, for filters and `--balance-by`, and copies their values from every upload. When the rows carry their own role, such as a Hugging Face `split` field, add it, then adopt it: `toloka dataset fields add <dataset> split`, then `toloka dataset split <dataset> --column split`. Roles follow the values `train`, `validation`/`validate`/`val`/`dev` and `test`, and `--parts train,dev=validate,test` maps other names. `dataset split` and `training create --dataset` refuse a split column name that is a field of the uploaded rows but not a dataset field, and print the `fields add` command.
73
-
74
- To train on a subset or reuse rows across Trainings, freeze a slice once every upload and split has finished; `--filter <field>=<value>` keeps only matching rows, and split columns are always frozen:
75
-
76
- ```sh
77
- toloka dataset slice create <dataset-name> --name "<slice-name>" --json
78
- ```
79
-
80
- ### 3. Choose and verify the source
81
-
82
- Explicit source choices take precedence. An existing Model Version bypasses Base Model selection.
83
-
84
- ```sh
85
- toloka base-model list --json
86
- toloka base-model get <base-model-id> --json
87
- toloka model list --json
88
- toloka model get <model-id> --json
89
- toloka model versions <model-id> --json
90
- ```
91
-
92
- For a Base Model, compare upstream documentation, user-provided benchmarks, and prior results for task and language fit, data volume, quality, training budget, and serving latency or deployment constraints. Model size alone is not a quality decision; a smaller model is a useful cost and latency baseline when the task permits it, not a mandatory default. Use `base-model get` only to verify the selected catalog ID, upstream model, and pinned revision; it does not establish those broader capabilities.
93
-
94
- For a Model Version, verify the exact ID and revision under its project-owned Model, and record the owning Model's Base Model and the Version's runtime base from JSON. If those identities conflict, report the conflict rather than guessing or substituting. Use `--model-version` only for that existing version, and only for a LoRA adapter Model Version (one produced by fine-tuning) — a full-weights version is rejected with "Training from a Model Version requires a LoRA adapter source". The ready cost estimate is the concrete final check that the source type, underlying Base Model, method, and data are supported together.
95
-
96
- ### 4. Reuse or create the draft
97
-
98
- Inspect before creating another Training:
99
-
100
- ```sh
101
- toloka training list --json
102
- toloka training get <training-id> --json
103
- ```
104
-
105
- When a new draft is needed, use a descriptive name and create normalized SFT configuration:
106
-
107
- ```sh
108
- toloka training create "<training-name>" \
109
- --base-model <base-model-id> \
110
- --dataset <dataset-name-or-id> \
111
- --json
112
- ```
113
-
114
- `--dataset` fills the empty cells of the Dataset's split column, freezes a slice named after the Training, and prints a line for each step; pass `--split-column <name>` when the Dataset has several split columns. To train on a slice frozen earlier, pass `--slice <slice-id>` instead. The Training learns on the column's train parts, or the ones `--parts <names>` lists, and validates on its validate parts; without validate rows, the platform holds out 10% of training rows for evaluation.
115
-
116
- To continue from a Model Version, replace `--base-model` with `--model-version <model-version-id>`.
117
-
118
- Preserve requested hyperparameters. The current CLI uses `--lora-rank 8|16|32` (default 16), `--epochs 1..5` (default 3), `--learning-rate` within 0.00001–0.001 (default 0.00015), `--batch-size 8|16|32|64` (default 8), and `--max-sequence-length 64..16384` (default 12288), rather than `regime`. Use defaults when suitable; rank 8 can fit narrow tasks or small data, while 32 may help when 16 underfits and the data supports more capacity. Choose sequence length from actual examples within the supported limit. `--gist-tokens` is rejected for SFT. `training update <name-or-id>` takes the same flags except `--method`; omitted flags retain current values. A new `--slice` or `--dataset` resets `--split-column` and `--parts` unless you pass them again.
119
-
120
- Verify the saved method, exact source, slice, split column, train parts, and configuration with `toloka training get <training-id> --json`.
121
-
122
- ### 5. Validate and estimate
123
-
124
- ```sh
125
- toloka training cost <training-id> --json > <absolute-estimate-file>
126
- ```
127
-
128
- A blocked estimate exits 1, leaves the redirected file empty, and prints `Training cannot run with these inputs:` followed by one `- <message>` line per issue on stderr. Report every issue, correct the cause, and calculate a new estimate.
129
-
130
- For a duration issue, use the reported rows, tokens, epochs, GPU count, and wall time to compare supported options. `qwen3-32b` and `qwen3-235b` use 8 GPUs and can reduce wall time, but changing the model also changes quality, serving constraints, and cost; reducing rows can weaken coverage; reducing epochs can weaken adaptation. Do not change the requested model, silently discard data, or alter epochs merely to make the estimate pass. Present the tradeoff, obtain direction when it is material, then update the draft, re-estimate, and obtain approval for the new quote.
131
-
132
- For a ready estimate, report the source, slice and split column, training and validation row counts, any rows left out as test, token totals, maximum GPU seconds, `maximumCharge`, currency, and fingerprint. If the user asked only for an estimate, stop here.
133
-
134
- ### 6. Run only after explicit cost approval
135
-
136
- Ask the user to approve the exact ready `maximumCharge`. After approval, start only the requested run and pass the approved file so a new unseen quote cannot replace it:
137
-
138
- ```sh
139
- toloka training run <training-id> \
140
- --estimate-file <absolute-estimate-file> \
141
- --version-name <unique-version-name> \
142
- --json
143
- ```
144
-
145
- Both flags are optional at the CLI level. Without `--estimate-file`, `training run` calculates a fresh ready estimate; do not use that path when the user approved a saved quote. Without `--version-name`, the Model Version takes the Training name.
146
-
147
- Monitor only as far as the user requested, with bounded commands:
148
-
149
- ```sh
150
- toloka training status <training-run-id> --json
151
- toloka training logs <training-run-id>
152
- toloka training metrics <training-run-id> --json
153
- ```
154
-
155
- Metrics can appear while the run is `running` and stop updating when training ends, before the run reaches `completed`. When `available: false`, check `unavailableReason`:
156
-
157
- - `unresolved`: metrics are not available yet. Check again while the run is `running`.
158
- - `not_configured`: this run will not report metrics. Stop polling for them.
159
-
160
- Control and billing rules:
161
-
162
- - Resume only after the user confirms a billing block is resolved.
163
- - `payment_window_expired` is final: the run is `failed`, cannot resume, and was not charged, even though `billingStatus` remains `payment_required`. A replacement run needs funds and new cost approval.
164
- - Cancel only on explicit request, before output checks begin. Before training starts, cancellation is free. During training, it stops the GPU job and charges for GPU seconds used, with no Model Version. A startup cancellation may remain `stopping` until the job stops; wait rather than retrying cancel.
165
- - `provider_failed` and `provider_timeout` are platform failures: no charge, full hold returned. Reported GPU usage remains visible.
166
- - A `failed` or `canceled` run frees its estimate: the same estimate file can start one new run at the same `maximumCharge` until the estimate expires. Retry only an error with `retryable: true` (network, storage, or GPU capacity), and only after the user agrees.
167
-
168
- Do not duplicate a slow run. Progress `queued` or `pending` means it is waiting for GPUs; training starts automatically. Training may also exceed the estimated duration. The charge stays capped at the approved `maximumCharge`; successful runs still publish a Model Version.
169
-
170
- For a completed run, verify the observed output and download only when requested:
171
-
172
- ```sh
173
- toloka training get <training-id> --json
174
- toloka model get <model-id> --json
175
- toloka model versions <model-id> --json
176
- toloka model version download <model-version-id> --out <absolute-output-directory>
177
- ```