@toloka-platform/sdk 0.2.0-preview.3 → 0.2.0-preview.4

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 (71) hide show
  1. package/dist/cli/toloka.js +136 -136
  2. package/dist/cli/toloka.js.jsc +0 -0
  3. package/dist/cli/toloka.js.jsc.sha256 +1 -1
  4. package/dist/cli/toloka.js.sha256 +1 -1
  5. package/docs/cli-v2.md +3 -2
  6. package/docs/cli.md +32 -4
  7. package/openapi/gen/models/baseModel.ts +1 -0
  8. package/openapi/gen/models/currentUser.ts +2 -0
  9. package/openapi/gen/models/currentUserTeamsItem.ts +6 -0
  10. package/openapi/gen/models/gistingTrainingConfiguration.ts +6 -2
  11. package/openapi/gen/models/gistingTrainingConfigurationBatchSize.ts +2 -0
  12. package/openapi/gen/models/gistingTrainingConfigurationGistTokens.ts +2 -0
  13. package/openapi/gen/models/gistingTrainingConfigurationInput.ts +6 -2
  14. package/openapi/gen/models/gistingTrainingConfigurationInputBatchSize.ts +2 -0
  15. package/openapi/gen/models/gistingTrainingConfigurationInputGistTokens.ts +2 -0
  16. package/openapi/gen/models/index.ts +9 -4
  17. package/openapi/gen/models/sftTrainingConfiguration.ts +6 -3
  18. package/openapi/gen/models/sftTrainingConfigurationBatchSize.ts +2 -0
  19. package/openapi/gen/models/sftTrainingConfigurationInput.ts +6 -3
  20. package/openapi/gen/models/sftTrainingConfigurationInputBatchSize.ts +2 -0
  21. package/openapi/gen/models/sftTrainingConfigurationInputLoraRank.ts +2 -0
  22. package/openapi/gen/models/sftTrainingConfigurationLoraRank.ts +2 -0
  23. package/package.json +1 -1
  24. package/skills/catalog.json +10 -10
  25. package/skills/toloka-build/SKILL.md +28 -17
  26. package/skills/toloka-build/references/node-semantics.md +7 -7
  27. package/skills/toloka-build/references/workflow-and-cli.md +13 -10
  28. package/skills/toloka-fine-tuning/SKILL.md +145 -62
  29. package/skills/toloka-get-started/SKILL.md +35 -20
  30. package/skills/toloka-gisting/SKILL.md +156 -66
  31. package/src/cli/analytics.ts +50 -23
  32. package/src/cli/auth.ts +31 -12
  33. package/src/cli/auto-update.ts +12 -6
  34. package/src/cli/check.ts +76 -29
  35. package/src/cli/cli-entry.ts +3 -2
  36. package/src/cli/cli-error.ts +43 -0
  37. package/src/cli/commands/dataset.ts +13 -3
  38. package/src/cli/commands/models.ts +6 -7
  39. package/src/cli/commands/pipeline.ts +6 -7
  40. package/src/cli/commands/project.ts +9 -16
  41. package/src/cli/commands/report.ts +6 -2
  42. package/src/cli/commands/secret.ts +5 -4
  43. package/src/cli/commands/source.ts +4 -4
  44. package/src/cli/commands/status.ts +2 -3
  45. package/src/cli/commands/training.ts +50 -17
  46. package/src/cli/config.ts +2 -2
  47. package/src/cli/context.ts +55 -17
  48. package/src/cli/credentials.ts +12 -4
  49. package/src/cli/data.ts +96 -34
  50. package/src/cli/delivery-orders.ts +18 -1
  51. package/src/cli/file-system.ts +6 -2
  52. package/src/cli/format-error.ts +45 -2
  53. package/src/cli/init.ts +13 -7
  54. package/src/cli/models.ts +43 -12
  55. package/src/cli/program.ts +4 -55
  56. package/src/cli/project-context.ts +117 -32
  57. package/src/cli/project.ts +80 -28
  58. package/src/cli/report.ts +24 -9
  59. package/src/cli/runs.ts +33 -8
  60. package/src/cli/settings.ts +13 -5
  61. package/src/cli/skill.ts +61 -22
  62. package/src/cli/source.ts +3 -2
  63. package/src/cli/terminal-io.ts +13 -6
  64. package/src/cli/trainings.ts +129 -35
  65. package/src/cli/version.ts +2 -2
  66. package/src/client.ts +3 -9
  67. package/src/transport.ts +13 -1
  68. package/openapi/gen/models/gistingTrainingConfigurationInputRegime.ts +0 -2
  69. package/openapi/gen/models/gistingTrainingConfigurationRegime.ts +0 -2
  70. package/openapi/gen/models/sftTrainingConfigurationInputRegime.ts +0 -2
  71. package/openapi/gen/models/sftTrainingConfigurationRegime.ts +0 -2
@@ -26,7 +26,7 @@ Treat the three layers differently:
26
26
 
27
27
  ## Initialize the source root
28
28
 
29
- For a first-time guided session, read `https://platform.toloka.ai/agents/data-labeling.md` first. Keep its stage order and checkpoints; use this reference for the commands and source-first invariants inside those stages.
29
+ For a first-time guided session, consult `https://platform.toloka.ai/agents/data-labeling.md` for orientation. Adapt the journey to the user's goal and already-complete setup while preserving dependencies, cost approval, and identity/source protection; use this reference for command details.
30
30
 
31
31
  Install the SDK before invoking project commands:
32
32
 
@@ -114,6 +114,7 @@ toloka apply
114
114
  toloka status
115
115
  toloka secret set <name> [--from-env <variable>]
116
116
  toloka dataset list
117
+ toloka dataset create <name>
117
118
  toloka dataset fields <name>
118
119
  toloka dataset load <name> --out <file> [--limit <n>] [--timeout <ms>]
119
120
  toloka dataset upload <name> <file>
@@ -133,8 +134,8 @@ toloka model create <name> --base <base-model-id> [--description <text>] [--json
133
134
  toloka model archive <name-or-id> [--json]
134
135
  toloka training list [--json]
135
136
  toloka training get <name-or-id> [--json]
136
- toloka training create <name> (--base-model <id> | --model-version <id>) --dataset <id> [--json]
137
- toloka training update <name-or-id> [configuration flags] [--json]
137
+ toloka training create <name> [--method sft|gisting] (--base-model <id> | --model-version <id>) --dataset <id> [--train-filter field=value] [--validation-dataset <id> [--validation-filter field=value]] [--prompt-file <path>] [--lora-rank 8|16|32 | --gist-tokens 8|32|64] [--epochs 1..5] [--learning-rate <rate>] [--batch-size 8|16|32|64] [--max-sequence-length <tokens>] [--json]
138
+ toloka training update <name-or-id> [--base-model <id> | --model-version <id>] [--dataset <id>] [--train-filter field=value] [--validation-dataset <id> [--validation-filter field=value]] [--prompt-file <path>] [--lora-rank 8|16|32 | --gist-tokens 8|32|64] [--epochs 1..5] [--learning-rate <rate>] [--batch-size 8|16|32|64] [--max-sequence-length <tokens>] [--json]
138
139
  toloka training cost <name-or-id> [--idempotency-key <key>] [--json]
139
140
  toloka training run <name-or-id> [--estimate-file <path>] [--version-name <name>] [--idempotency-key <key>] [--json]
140
141
  toloka training runs <name-or-id> [--json]
@@ -149,9 +150,9 @@ toloka skill install <skill-id> [--force]
149
150
  toloka report <markdown> [--authored-by human|agent] [--confirm]
150
151
  ```
151
152
 
152
- Select the platform project with `toloka project add` or `toloka project create` before `import`, `plan`, or `apply`. For `init`, `toloka --project-id <id> init` and `TOLOKA_PROJECT_ID` bind an empty checkout directly without changing the machine registry. `project create` also writes `toloka.json`; `project add` changes only the machine registry, so follow it with `import <projectId>` for an existing project or an explicit project ID on `init` for an empty one. Confirm `toloka project current` and `toloka.json` resolve to the intended ID before authoring.
153
+ Resolve the intended platform project before `import`, `plan`, or `apply`; use an existing correct binding rather than registering or creating a project again. For `init`, `toloka --project-id <id> init` and `TOLOKA_PROJECT_ID` bind an empty checkout directly without changing the machine registry. `project create` also writes `toloka.json`; `project add` changes only the machine registry, so follow it with `import <projectId>` for an existing project or an explicit project ID on `init` for an empty one. Confirm `toloka project current` and `toloka.json` resolve to the intended ID before authoring.
153
154
 
154
- `toloka delivery-order list` and `project create --delivery-order-id` appear only when `toloka whoami` prints `Internal: true`. For an internal user, list active Sunday orders first; if the list is empty, stop. Pass a selected id to `project create` — internal teams require it. When `Internal: false`, omit the flag and do not run `delivery-order`.
155
+ `toloka delivery-order list` and `project create --delivery-order-id` are always available; the platform accepts them only for internal teams. When `toloka whoami` marks the project's owning team `(internal)` on its `Teams:` line, list active Sunday orders first; if the list is empty, stop. Pass a selected id to `project create` — internal teams require it. For a project in an external team, omit the flag; the platform rejects an order there.
155
156
 
156
157
  `toloka project url` prints only the selected project's platform UI URL. Use it when the user needs a working link to inspect the live project.
157
158
 
@@ -159,13 +160,15 @@ Select the platform project with `toloka project add` or `toloka project create`
159
160
 
160
161
  ## Manage model checkpoints
161
162
 
162
- The global Base Model Catalog is read-only and uses `toloka base-model`. `base-model list` prints aligned ID, name, provider, and upstream-model columns by default. `toloka model` manages project-owned lineages; creation requires one catalog `baseModelId` and creates metadata without a Model Version. Every Base Model and Model command accepts `--json` for machine-readable output. Model Version upload, validation, and download commands are deferred until the separate upload-processing contract is implemented.
163
+ The global Base Model Catalog is read-only and uses `toloka base-model`. `base-model list` prints aligned ID, name, provider, upstream-model, revision (first 12 characters) and upstream-snapshot URL columns by default; `base-model get` prints the full pinned revision and the `https://huggingface.co/<model>/tree/<revision>` snapshot URL, which is the exact base every Training Run trains on. `toloka model` manages project-owned lineages; creation requires one catalog `baseModelId` and creates metadata without a Model Version. Every Base Model and Model command accepts `--json` for machine-readable output. Model Version upload, validation, and download commands are deferred until the separate upload-processing contract is implemented.
163
164
 
164
165
  ## Train a model
165
166
 
166
167
  `toloka training create` requires one source (`--base-model` or `--model-version`) and a training Dataset. The output Model is created on the first Training Run from the Training name, or bound from an existing Model Version source.
167
168
 
168
- Use `training cost` to validate inputs and show the maximum charge before `training run`. `training run` accepts that ready estimate JSON through `--estimate-file`; without it, the command calculates a fresh ready estimate itself before creating the run. `--version-name` defaults to the Training name; pass it when a Model Version with that name already exists. Use `training status`, `training logs`, `training metrics`, `training resume`, and `training cancel` with the returned Training Run ID. `training metrics` lists each metric's latest value while the run is still training; `--key` prints one metric's point history instead.
169
+ Hyperparameters are optional flags on `training create` and `training update`: `--epochs 1..5` (default 3), `--learning-rate` (SFT 0.00001–0.001, default 0.00015; gisting 0.001–0.3, default 0.03), `--batch-size 8|16|32|64` (default 8; sequences per optimizer step across all GPUs) and `--max-sequence-length 64..16384` (default 12288 for SFT, 3072 for gisting) apply to both methods; `--lora-rank 8|16|32` (default 16) is SFT-only and `--gist-tokens 8|32|64` (default 32) is gisting-only — passing one to the other method fails before any request. `--regime` and `--eval-steps` no longer exist. `training update` has no `--method` flag: the method stays as created, and every flag you omit keeps its current value. `training cost` is blocked when the longest example exceeds `--max-sequence-length` or when the training selection leaves fewer rows than `--batch-size` after the 10% holdout.
170
+
171
+ Use `training cost` to validate inputs and show the maximum charge before `training run`. A blocked estimate exits 1 and lists the issues on stderr instead of printing the estimate; fix them and recalculate. `training run` accepts that ready estimate JSON through `--estimate-file`; without it, the command calculates a fresh ready estimate itself before creating the run. `--version-name` defaults to the Training name; pass it when a Model Version with that name already exists. Use `training status`, `training logs`, `training metrics`, `training resume`, and `training cancel` with the returned Training Run ID. `training metrics` lists each metric's latest value while the run is still training; `--key` prints one metric's point history instead.
169
172
 
170
173
  ## Adopt an existing live project
171
174
 
@@ -235,7 +238,7 @@ Register every code-node behavior with `test.code(pipeline, node, name, callback
235
238
 
236
239
  Before choosing component names or props, call `ui.componentDocumentation()` in a local `@toloka-platform/sdk/testing` scenario. A component's contract is its returned `propsType`, `valueType`, and `example`. For structured or array-valued Fields, derive the dataset field schema from `valueType`, then feed the documented example value through `setValue`, `getValue`, and `submit`; never translate undocumented property names or replace missing values with defaults. Register required human-work behavior with `test.ui(pipeline, node, name, callback)`. Its callback receives bound `render(options?)`; the test counts only after a successful `submit`, at least one assertion, and a passing callback.
237
240
 
238
- Register the representative connected flow with `test.pipeline(pipeline, name, callback)`. When a local dataset file is available, use its first row as the initial item state; redact sensitive values while preserving field names, nesting, optionality, and media/value shapes. Use synthetic input only when no local row exists. Use the callback's bound `runCode` and `renderUi` helpers, merge only declared node outputs, and assert the final `root.completed` fields. Keep a linear happy path in one test; use separate scenarios for match branches, optional routes, and failures.
241
+ Register representative connected flows with `test.pipeline(pipeline, name, callback)`. Choose fixtures from available data that exercise the task, redacting sensitive values while preserving field names, nesting, optionality, and media/value shapes. Use synthetic cases for privacy or boundaries absent from the sample. Use the callback's bound `runCode` and `renderUi` helpers, merge only declared node outputs, and assert the final `root.completed` fields. Cover meaningful match branches, optional routes, and failures as well as the happy path.
239
242
 
240
243
  ```sh
241
244
  toloka check
@@ -269,7 +272,7 @@ Pull live rows with `toloka dataset load <name> --out <file> [--limit <n>]`. `--
269
272
 
270
273
  ## Run a pipeline and report results
271
274
 
272
- A run needs a deployed pipeline, so apply before starting one.
275
+ A run needs a deployed pipeline. Apply any requested source changes and verify convergence first; an already-deployed unchanged pipeline does not need another apply. Present the cost forecast and obtain run approval before starting. The commands below are available operations, not a sequence that requires starting or canceling a run.
273
276
 
274
277
  ```sh
275
278
  toloka pipeline run <name> --wait --timeout 900000
@@ -282,7 +285,7 @@ toloka pipeline cancel <runId>
282
285
 
283
286
  Read the exit code, not just the text. `toloka pipeline run --wait` exits `0` when the run reaches a successful terminal state, `1` when it reaches a failed one, and `2` when the wait window elapses while the run is still going. Without `--wait` the command returns as soon as the run is accepted, and exit `0` means "accepted", not "succeeded".
284
287
 
285
- Never treat a started run as a finished one. There is no background watcher: nothing will report back later. But bound every wait — a queue no one is working stays in progress indefinitely, and an unbounded poll loop ends with the agent killed and no report written. Pick a window, and when it closes report the observed counts and states along with the fact that the run had not finished. Poll in the foreground and deliver that report before you finish: there is no later turn, so promising to report once a window closes loses the observation entirely.
288
+ A started run is not a finished one. Choose a bounded monitoring window appropriate to the task, then report observed counts and states even if work is still in progress. Continue with another bounded check when useful; do not promise an automatic later update unless a reporting mechanism actually exists.
286
289
 
287
290
  `toloka pipeline runs` lists ids and timestamps. `toloka pipeline status` reports the latest run. `toloka status` (no prefix) is project health. When a listing is capped it says so; report the cap rather than presenting a page as the whole picture.
288
291
 
@@ -5,68 +5,151 @@ description: Create, estimate, start, monitor, and verify a project-owned superv
5
5
 
6
6
  # Fine-tune a model with Toloka
7
7
 
8
- Use this skill for supervised fine-tuning. For the full first-time agent sequence, read `https://platform.toloka.ai/agents/fine-tuning.md`.
8
+ ## Mission
9
9
 
10
- ## Rules
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.
17
+ - A **Training** is an editable project-owned draft. A **Training Run** is one immutable, billable execution of a frozen draft and Dataset selections.
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. Separate Datasets and disjoint top-level filters are both valid. Without a validation selection, the provider reserves 10% of the training rows as a holdout.
21
+
22
+ ## Working posture
23
+
24
+ - 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.
25
+ - Honor explicit choices first. If a requested project, source, Dataset, or configuration is incompatible, explain the evidence and tradeoff before proposing a substitute.
26
+ - 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.
27
+ - 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.
28
+
29
+ ## Safety
11
30
 
12
31
  - Never ask for an API key in chat; the user enters it through `toloka login`.
13
- - Never invent project, Dataset, Base Model, Training, Model, Model Version, price, or run IDs.
14
- - Use authorized project Datasets containing labeled conversations. Keep production data out of source control.
15
- - Prefer a separate validation Dataset. Without one, the provider holds out 10% of training rows.
16
- - Do not start a Training Run before the user approves the ready estimate's `maximumCharge`.
17
- - Use `--model-version` only for an existing Model Version source.
18
- - Keep polling bounded and report terminal state only when the CLI shows it.
19
-
20
- ## Workflow
21
-
22
- 1. Verify `bun --version`, `toloka --version`, `toloka whoami`, and `toloka project current`.
23
- 2. Inspect the exact training Dataset ID supplied by the user:
24
- ```sh
25
- toloka dataset fields <training-dataset-id>
26
- ```
27
- 3. Verify the supplied Base Model ID or existing Model Version source:
28
- ```sh
29
- toloka base-model get <base-model-id>
30
- ```
31
- 4. Ask the user to choose the source, training Dataset, optional validation Dataset, and Training name.
32
- 5. Create the normalized SFT Training:
33
- ```sh
34
- toloka training create "<training-name>" \
35
- --base-model <base-model-id> \
36
- --dataset <training-dataset-id> \
37
- --validation-dataset <validation-dataset-id> \
38
- --json
39
- ```
40
- Omit `--validation-dataset` when the user chooses provider holdout. Use `--model-version <model-version-id>` instead of `--base-model` for an existing Model Version source.
41
- 6. Verify the draft:
42
- ```sh
43
- toloka training get <training-id> --json
44
- ```
45
- 7. Calculate a ready estimate to an absolute path:
46
- ```sh
47
- toloka training cost <training-id> --json > <absolute-estimate-file>
48
- ```
49
- Report rows, tokens, maximum GPU seconds, `maximumCharge`, currency, and fingerprint. Fix every blocked issue and recalculate after changing inputs.
50
- 8. Ask the user to approve the exact `maximumCharge`. After approval, start one run:
51
- ```sh
52
- toloka training run <training-id> \
53
- --estimate-file <absolute-estimate-file> \
54
- --version-name <unique-version-name> \
55
- --json
56
- ```
57
- Both flags are optional. Without `--estimate-file`, `training run` calculates a fresh ready estimate itself; without `--version-name`, the Model Version takes the Training name. Passing the approved estimate prevents a fresh quote from replacing the reviewed one.
58
- 9. Monitor with bounded commands:
59
- ```sh
60
- toloka training status <training-run-id> --json
61
- toloka training logs <training-run-id>
62
- toloka training metrics <training-run-id> --json
63
- ```
64
- Resume only after the user confirms a billing block is resolved. Cancel only on explicit request.
65
- 10. When completed, verify the output Model and Model Version, then download if requested:
66
- ```sh
67
- toloka training get <training-id> --json
68
- toloka model get <model-id> --json
69
- toloka model version download <model-version-id> --out <absolute-output-directory>
70
- ```
71
-
72
- A completed Training Run produces a durable Model Version. It does not prove deployment or inference readiness.
32
+ - Never invent project, Dataset, Base Model, Training, Model, Model Version, price, or run IDs. Read identity and source metadata from the CLI.
33
+ - Use only authorized project Datasets containing representative data. Keep credentials and production data out of source control and agent messages.
34
+ - Preserve train/validation separation and avoid duplicate or near-duplicate examples across roles.
35
+ - Never start a Training Run before the user approves the ready estimate's exact `maximumCharge`.
36
+ - Keep polling bounded. Report terminal state only when the CLI shows it, and report timeouts as still running.
37
+
38
+ ## Process
39
+
40
+ ### 1. Establish only the context the goal needs
41
+
42
+ When runtime, authentication, or binding is unknown, inspect it:
43
+
44
+ ```sh
45
+ bun --version
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, organize Datasets by training and validation role, not automatically by file. `dataset upload` appends, so compatible files for one role can share a Dataset:
63
+
64
+ ```sh
65
+ toloka dataset create <role-dataset-name>
66
+ toloka dataset upload <role-dataset-name> <absolute-jsonl-path>
67
+ toloka dataset fields <role-dataset-name>
68
+ ```
69
+
70
+ CLI uploads to an otherwise undeclared Dataset store each row whole. A nested `split` value in that uploaded object is not a top-level Dataset field and cannot be used by `--train-filter` or `--validation-filter`. In that case, use separate role Datasets or omit validation flags and use the provider's 10% holdout. Existing Datasets with a real top-level split field can use disjoint filters. Never use overlapping selections or mix a supplied validation set back into training.
71
+
72
+ ### 3. Choose and verify the source
73
+
74
+ Explicit source choices take precedence. An existing Model Version bypasses Base Model selection.
75
+
76
+ ```sh
77
+ toloka base-model list --json
78
+ toloka base-model get <base-model-id> --json
79
+ toloka model list --json
80
+ toloka model get <model-id> --json
81
+ toloka model versions <model-id> --json
82
+ ```
83
+
84
+ 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.
85
+
86
+ 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. The ready cost estimate is the concrete final check that the source type, underlying Base Model, method, and data are supported together.
87
+
88
+ ### 4. Reuse or create the draft
89
+
90
+ Inspect before creating another Training:
91
+
92
+ ```sh
93
+ toloka training list --json
94
+ toloka training get <training-id> --json
95
+ ```
96
+
97
+ When a new draft is needed, use a descriptive name and create normalized SFT configuration:
98
+
99
+ ```sh
100
+ toloka training create "<training-name>" \
101
+ --base-model <base-model-id> \
102
+ --dataset <training-dataset-id> \
103
+ --validation-dataset <validation-dataset-id> \
104
+ --json
105
+ ```
106
+
107
+ Omit `--validation-dataset` when no separate validation selection exists so the provider uses its 10% holdout. For disjoint selections in a Dataset with top-level fields, add `--train-filter <field>=<value>` and `--validation-filter <field>=<value>`. For an existing Model Version source, replace `--base-model` with `--model-version <model-version-id>`.
108
+
109
+ 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.
110
+
111
+ Verify the saved method, exact source, selections, filters, and configuration with `toloka training get <training-id> --json`.
112
+
113
+ ### 5. Validate and estimate
114
+
115
+ ```sh
116
+ toloka training cost <training-id> --json > <absolute-estimate-file>
117
+ ```
118
+
119
+ 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.
120
+
121
+ 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.
122
+
123
+ For a ready estimate, report the source and selections, training and validation row counts, token totals, maximum GPU seconds, `maximumCharge`, currency, and fingerprint. If the user asked only for an estimate, stop here.
124
+
125
+ ### 6. Run only after explicit cost approval
126
+
127
+ 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:
128
+
129
+ ```sh
130
+ toloka training run <training-id> \
131
+ --estimate-file <absolute-estimate-file> \
132
+ --version-name <unique-version-name> \
133
+ --json
134
+ ```
135
+
136
+ 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.
137
+
138
+ Monitor only as far as the user requested, with bounded commands:
139
+
140
+ ```sh
141
+ toloka training status <training-run-id> --json
142
+ toloka training logs <training-run-id>
143
+ toloka training metrics <training-run-id> --json
144
+ ```
145
+
146
+ Resume only after the user confirms a billing block is resolved. Cancel only on explicit request.
147
+
148
+ For a completed run, verify the observed output and download only when requested:
149
+
150
+ ```sh
151
+ toloka training get <training-id> --json
152
+ toloka model get <model-id> --json
153
+ toloka model versions <model-id> --json
154
+ toloka model version download <model-version-id> --out <absolute-output-directory>
155
+ ```
@@ -1,40 +1,46 @@
1
1
  ---
2
2
  name: toloka-get-started
3
- description: Route a first Toloka agent session to the correct workflow and establish safe CLI, authentication, project, and approval checkpoints. Use when the user is new to Toloka, asks what to do first, or has not selected a pipeline, fine-tuning, or gisting workflow.
3
+ description: Orient a Toloka session to the user's outcome and safely reuse or establish the needed CLI, authentication, project, workflow, and approval context. Use when the user is new to Toloka, asks what to do first, or has not selected a pipeline, fine-tuning, or gisting workflow.
4
4
  ---
5
5
 
6
6
  # Get started with Toloka
7
7
 
8
- Use this skill to orient a new session. Choose one workflow before making a platform mutation:
8
+ Use this skill to help the user reach the outcome they asked for. Start with the request, the current checkout, and observed CLI state. If setup, authentication, a project binding, or workflow source is already in place and consistent with the task, continue from it instead of repeating onboarding, replacing the binding, or creating a demo.
9
9
 
10
- - **Label data or build a pipeline:** install and read `toloka-build`, then follow `https://platform.toloka.ai/agents/data-labeling.md`.
11
- - **Fine-tune a model:** install and read `toloka-fine-tuning`, then follow `https://platform.toloka.ai/agents/fine-tuning.md`.
12
- - **Compress a prompt with gisting:** install and read `toloka-gisting`, then follow `https://platform.toloka.ai/agents/gisting.md`.
10
+ ## Choose the relevant workflow
13
11
 
14
- ## Prepare the CLI
12
+ Honor an explicitly requested target. Otherwise choose the workflow that fits the outcome and briefly explain the choice:
15
13
 
16
- Check the required runtime and CLI:
14
+ - **Label data or build a pipeline:** install and read `toloka-build`, then use `https://platform.toloka.ai/agents/data-labeling.md` as a reference.
15
+ - **Fine-tune a model:** install and read `toloka-fine-tuning`, then use `https://platform.toloka.ai/agents/fine-tuning.md` as a reference.
16
+ - **Compress a prompt with gisting:** install and read `toloka-gisting`, then use `https://platform.toloka.ai/agents/gisting.md` as a reference.
17
+
18
+ The workflow sequence preserves important dependencies and gates, but it is not a script: skip steps that current evidence shows are already satisfied or irrelevant. If the user asks only for design, inspection, or an estimate, finish at that outcome rather than creating extra resources or starting a run.
19
+
20
+ ## Prepare missing prerequisites
21
+
22
+ Check the runtime or CLI only when its state is not already known:
17
23
 
18
24
  ```sh
19
25
  bun --version
20
26
  toloka --version
21
27
  ```
22
28
 
23
- The runbooks above use the `preview` channel of `@toloka-platform/sdk`, so `toloka --version` must print a `-preview` version. If `toloka` is unavailable or comes from another channel, ask the user to run the installer in their own shell:
29
+ The runbooks use the `preview` channel of `@toloka-platform/sdk`, so `toloka --version` must print `0.2.0-preview.4` or newer. If `toloka` is unavailable or comes from another channel, install the preview version:
24
30
 
25
31
  ```sh
26
32
  curl -fsSL https://platform.toloka.ai/cli/install.sh | TOLOKA_CLI_CHANNEL=preview sh
27
33
  ```
28
34
 
29
- Do not request an API key in chat or run an unattended installer. Ask the user to run `toloka login`, then verify the intended account with:
35
+ Never request an API key in chat. Inspect the active identity with:
30
36
 
31
37
  ```sh
32
38
  toloka whoami
33
39
  ```
34
40
 
35
- `Rejected:` means the key was refused (ask for `toloka login` again); `Not reachable:` means the platform did not answer and the key was not evaluated (fix network access, do not ask for a new key); `Platform error:` means the platform failed (retry later).
41
+ If the reachable account is evidently the intended identity from the request, project, team, or established checkout, continue and report it. Ask a focused question when the identity conflicts with that context or more than one material choice remains. For a missing or rejected key, ask the user to run `toloka login`, then verify `toloka whoami` again. `Rejected:` means the key was refused; `Not reachable:` means the platform did not answer and the key was not evaluated, so fix network access rather than requesting another key; `Platform error:` means the platform failed, so retry later.
36
42
 
37
- Use a source root for pipeline work. Run `toloka init` before searching or installing skills:
43
+ Pipeline work needs a source root. Reuse a suitable initialized root when one exists. In a new root, or when the Agent Bootstrap or installed skills genuinely need initialization or refresh, use:
38
44
 
39
45
  ```sh
40
46
  toloka init
@@ -42,14 +48,23 @@ toloka skill search <workflow>
42
48
  toloka skill install <skill-id>
43
49
  ```
44
50
 
45
- Read the installed skill before acting. Refresh a stale skill with `--force`.
51
+ Read the installed skill before acting. Refresh a stale skill with `--force`; do not refresh a current one merely to follow onboarding.
52
+
53
+ ## Operating posture
54
+
55
+ - Inspect current state before writing. Use the user's explicit workflow and project choices first. Make routine, reversible choices from available evidence and briefly report the reasoning. Ask only for material ambiguity, missing authorization or required inputs, conflicting constraints, or a destructive or out-of-scope change.
56
+ - For pipeline work, choose a node approach from the task and explain it briefly: deterministic processing or scripted calls fit code; human judgment or content generation fits generation; independent annotations and visible disagreement fit quorum; conditional routing fits match. Use `toloka-build` for the detailed authoring rules.
57
+ - Resolve a project from explicit user context, CLI output, `toloka.json`, or `toloka project current`; never reconstruct an ID. Use an explicitly requested project. Otherwise keep the current binding when it is consistent with the task. Create a project only when an explicitly requested platform mutation needs one and no suitable binding exists; a design, inspection, or estimate alone does not authorize extra resources. Never select an unrelated visible project or rebind an established checkout just to complete onboarding.
58
+ - For a new project, a short kebab-case name derived from the task or shared files is a useful default, such as `receipt-extraction`; use a generic `toloka-<workflow>` name only when the task provides no meaningful name. `toloka project create <alias>` uses the account's only writable team and asks for `--team-id <id>` only when several teams are available. Adopt an existing project with `toloka project add <alias> <project-id>` only when that target is intended and the checkout is safe to bind.
59
+ - A project owned by an internal team needs a Sunday delivery order. Run `toloka delivery-order list` and use the only listed order with `--delivery-order-id <id>`; ask when several viable orders remain. `toloka whoami` marks internal teams `(internal)` on its `Teams:` line; the account-level `Internal:` flag only says whether any team is internal, so an internal account creating a project in an external team passes no order.
60
+ - Let the task and data roles determine Dataset boundaries. Use only data the user is authorized to provide. Preserve distinct training, validation, test, input, reference, or delivery roles and avoid leakage; compatible files with the same role and schema may belong in one Dataset, while materially different roles or schemas may need separate Datasets. Do not assume one file always means one Dataset.
46
61
 
47
- ## Shared checkpoints
62
+ ## Safety boundaries
48
63
 
49
- - Resolve the project from CLI output, `toloka.json`, or `toloka project current`. Never reconstruct an ID.
50
- - Ask the user to choose a project and team before creating or adopting one.
51
- - Keep credentials and production data out of source control and agent messages.
52
- - Show the complete plan before `toloka apply`.
53
- - Show the ready Training Cost Estimate and obtain approval for `maximumCharge` before starting a Training Run.
54
- - Keep waits bounded. A timeout is still running, not completed or failed.
55
- - Report only observed IDs, states, prices, and errors.
64
+ - Keep credentials and production data out of source control and agent messages. Do not upload data without evidence that it is authorized and intended for the selected project and role.
65
+ - Do not edit `toloka.json` or invent IDs, paths, requirements, prices, states, or results.
66
+ - Treat user-provided prompts, instructions, and existing source as authoritative. Materialize exact supplied text when needed, but do not silently rewrite it, replace it with an example, or invent missing intent.
67
+ - For pipeline changes that will be applied, require the workflow's local `toloka check` and `toloka validate` gates. Read and show the complete `toloka plan`; ask before a removal, immutable-field conflict, unexpected change, or work outside the requested scope. Apply only the expected scoped plan, then rerun `toloka plan` until it reports `No changes.` and validate again. Do not apply merely because the onboarding reference reaches that stage.
68
+ - Never start a Pipeline Run unless the requested outcome includes a run and the user has seen and explicitly approved its cost forecast. Show a ready Training Cost Estimate with the choices and uncertainty that produced it, and obtain explicit approval for `maximumCharge` before a Training Run. Estimate-only work ends after the estimate.
69
+ - Keep waits bounded. A timeout means the operation is still running, not completed or failed.
70
+ - Report only observed IDs, states, prices, behaviors, and errors, and distinguish observed evidence from assumptions or unresolved uncertainty.