@toloka-platform/sdk 0.2.0-preview.2 → 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.
- package/README.md +10 -4
- package/dist/cli/toloka.js +162 -154
- package/dist/cli/toloka.js.jsc +0 -0
- package/dist/cli/toloka.js.jsc.sha256 +1 -1
- package/dist/cli/toloka.js.sha256 +1 -1
- package/docs/authoring.md +18 -1
- package/docs/cli-v2.md +6 -4
- package/docs/cli.md +58 -11
- package/docs/getting-started.md +3 -3
- package/docs/limitations.md +1 -1
- package/docs/testing.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/examples/face-image-collection/README.md +2 -2
- package/openapi/gen/api.ts +78 -0
- package/openapi/gen/models/baseModel.ts +1 -0
- package/openapi/gen/models/checkReport.ts +2 -1
- package/openapi/gen/models/checkReportAnyOfTwoseven.ts +5 -0
- package/openapi/gen/models/checkReportAnyOfTwosevenResultsItem.ts +6 -0
- package/openapi/gen/models/checkReportAnyOfTwosevenResultsItemVerdict.ts +2 -0
- package/openapi/gen/models/currentUser.ts +3 -0
- package/openapi/gen/models/currentUserTeamsItem.ts +6 -0
- package/openapi/gen/models/deliveryOrder.ts +9 -0
- package/openapi/gen/models/deliveryOrderClientName.ts +2 -0
- package/openapi/gen/models/getTrainingRunMetricHistoryParams.ts +4 -0
- package/openapi/gen/models/gistingTrainingConfiguration.ts +6 -2
- package/openapi/gen/models/gistingTrainingConfigurationBatchSize.ts +2 -0
- package/openapi/gen/models/gistingTrainingConfigurationGistTokens.ts +2 -0
- package/openapi/gen/models/gistingTrainingConfigurationInput.ts +6 -2
- package/openapi/gen/models/gistingTrainingConfigurationInputBatchSize.ts +2 -0
- package/openapi/gen/models/gistingTrainingConfigurationInputGistTokens.ts +2 -0
- package/openapi/gen/models/index.ts +28 -4
- package/openapi/gen/models/listDeliveryOrders200.ts +5 -0
- package/openapi/gen/models/sftTrainingConfiguration.ts +6 -3
- package/openapi/gen/models/sftTrainingConfigurationBatchSize.ts +2 -0
- package/openapi/gen/models/sftTrainingConfigurationInput.ts +6 -3
- package/openapi/gen/models/sftTrainingConfigurationInputBatchSize.ts +2 -0
- package/openapi/gen/models/sftTrainingConfigurationInputLoraRank.ts +2 -0
- package/openapi/gen/models/sftTrainingConfigurationLoraRank.ts +2 -0
- package/openapi/gen/models/trainingRunMetricHistory.ts +9 -0
- package/openapi/gen/models/trainingRunMetricHistoryMetric.ts +2 -0
- package/openapi/gen/models/trainingRunMetricHistoryPointsItem.ts +9 -0
- package/openapi/gen/models/trainingRunMetricHistoryPointsItemNonFinite.ts +2 -0
- package/openapi/gen/models/trainingRunMetricHistoryPointsItemValue.ts +2 -0
- package/openapi/gen/models/trainingRunMetrics.ts +9 -0
- package/openapi/gen/models/trainingRunMetricsMetricsItem.ts +8 -0
- package/openapi/gen/models/trainingRunMetricsMetricsItemLatest.ts +9 -0
- package/openapi/gen/models/trainingRunMetricsMetricsItemLatestNonFinite.ts +2 -0
- package/openapi/gen/models/trainingRunMetricsMetricsItemLatestValue.ts +2 -0
- package/openapi/gen/models/trainingRunMetricsMetricsItemMetric.ts +2 -0
- package/openapi/gen/models/trainingRunMetricsUnavailableReason.ts +2 -0
- package/package.json +2 -2
- package/skills/catalog.json +55 -7
- package/skills/toloka-build/SKILL.md +35 -21
- package/skills/toloka-build/references/node-semantics.md +13 -11
- package/skills/toloka-build/references/workflow-and-cli.md +31 -20
- package/skills/toloka-fine-tuning/SKILL.md +155 -0
- package/skills/toloka-get-started/SKILL.md +70 -0
- package/skills/toloka-gisting/SKILL.md +166 -0
- package/skills/toloka-report-issue/references/report-template.md +1 -1
- package/src/authoring/index.ts +14 -0
- package/src/checks/task-ui-typecheck.ts +12 -10
- package/src/cli/analytics.ts +88 -15
- package/src/cli/auth.ts +93 -21
- package/src/cli/auto-update.ts +36 -39
- package/src/cli/check.ts +88 -39
- package/src/cli/cli-entry.ts +3 -2
- package/src/cli/cli-error.ts +43 -0
- package/src/cli/commands/auth.ts +89 -0
- package/src/cli/commands/config.ts +28 -0
- package/src/cli/commands/dataset.ts +85 -0
- package/src/cli/commands/delivery-order.ts +18 -0
- package/src/cli/commands/models.ts +121 -0
- package/src/cli/commands/pipeline.ts +131 -0
- package/src/cli/commands/project.ts +168 -0
- package/src/cli/commands/report.ts +43 -0
- package/src/cli/commands/secret.ts +40 -0
- package/src/cli/commands/skill.ts +36 -0
- package/src/cli/commands/source.ts +204 -0
- package/src/cli/commands/status.ts +17 -0
- package/src/cli/commands/training.ts +261 -0
- package/src/cli/commands/version.ts +14 -0
- package/src/cli/config.ts +7 -8
- package/src/cli/context.ts +251 -0
- package/src/cli/credentials.ts +12 -4
- package/src/cli/data.ts +96 -34
- package/src/cli/delivery-orders.ts +47 -0
- package/src/cli/environment.ts +26 -0
- package/src/cli/file-system.ts +6 -2
- package/src/cli/format-error.ts +45 -2
- package/src/cli/init.ts +14 -11
- package/src/cli/models.ts +43 -12
- package/src/cli/program.ts +120 -1347
- package/src/cli/project-context.ts +126 -43
- package/src/cli/project.ts +80 -28
- package/src/cli/report.ts +24 -9
- package/src/cli/runs.ts +33 -8
- package/src/cli/sdk-version.ts +38 -0
- package/src/cli/settings.ts +13 -5
- package/src/cli/skill.ts +67 -24
- package/src/cli/source.ts +3 -2
- package/src/cli/terminal-io.ts +110 -0
- package/src/cli/trainings.ts +242 -57
- package/src/cli/version.ts +3 -3
- package/src/client.ts +21 -9
- package/src/importer.ts +32 -2
- package/src/transport.ts +13 -1
- package/openapi/gen/models/gistingTrainingConfigurationInputRegime.ts +0 -2
- package/openapi/gen/models/gistingTrainingConfigurationRegime.ts +0 -2
- package/openapi/gen/models/sftTrainingConfigurationInputRegime.ts +0 -2
- 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,
|
|
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
|
|
|
@@ -51,9 +51,10 @@ It explains where to generate an API key — `console.toloka.ai` → Company →
|
|
|
51
51
|
credentials file with mode `0600`. Nothing is written when the key does not authenticate.
|
|
52
52
|
|
|
53
53
|
Most later commands read that file, so `--api-key` becomes optional. For networked commands that do
|
|
54
|
-
not mutate the machine project registry, key precedence is flag, then `
|
|
54
|
+
not mutate the machine project registry, key precedence is flag, then `TOLOKA_API_KEY`, then the
|
|
55
55
|
stored file; CI can use an environment variable without running login. Non-interactive callers can
|
|
56
|
-
skip the login prompt
|
|
56
|
+
skip the login prompt by piping the key to `toloka login --api-key-stdin`; `toloka login --api-key <key>`
|
|
57
|
+
also works but leaves the key in shell history. The base URL defaults to the platform.
|
|
57
58
|
|
|
58
59
|
```sh
|
|
59
60
|
toloka auth-status # or toloka whoami
|
|
@@ -61,22 +62,25 @@ toloka logout
|
|
|
61
62
|
```
|
|
62
63
|
|
|
63
64
|
`auth-status` reports which platform and key are in effect and where each came from, masks the key
|
|
64
|
-
unless you pass `--show-token`, and exits non-zero
|
|
65
|
-
|
|
65
|
+
unless you pass `--show-token`, and exits non-zero on failure — use it to check a setup rather than
|
|
66
|
+
guessing. Its last lines say which failure it was: `Rejected:` means the platform refused the key
|
|
67
|
+
(run `toloka login` with a working one); `Not reachable:` means the platform did not answer, so the
|
|
68
|
+
key was not evaluated (fix network access, do not ask for a new key); `Platform error:` means the
|
|
69
|
+
platform failed (retry later). `logout` deletes the stored file; it does not revoke the key.
|
|
66
70
|
|
|
67
71
|
A globally installed `toloka` auto-updates by default. It checks npm at most once per day and installs a newer `@toloka-platform/sdk` only after that version has been published for at least 24 hours, then re-runs the original command. `config`, `version`, and `help` never trigger a check. Project-local installs and CI skip it. Turn it off with `toloka config set auto-update false`.
|
|
68
72
|
|
|
69
73
|
## Configure the CLI
|
|
70
74
|
|
|
71
|
-
Provide the API key and base URL on networked workflows through `
|
|
72
|
-
`
|
|
75
|
+
Provide the API key and base URL on networked workflows through `TOLOKA_API_KEY` and
|
|
76
|
+
`TOLOKA_BASE_URL`, or with `--api-key` and `--base-url`. The registry-mutating commands
|
|
73
77
|
`toloka project add`, `toloka project switch`, `toloka project remove`, and `toloka project create`
|
|
74
78
|
require `toloka login` first because they read and write the credentials file. When flags or
|
|
75
|
-
`
|
|
76
|
-
project ID in this order: `--project-id`, `TOLOKA_PROJECT_ID`, `
|
|
79
|
+
`TOLOKA_*` variables are also present, they must identify the same stored key and platform. Resolve
|
|
80
|
+
project ID in this order: `--project-id`, `TOLOKA_PROJECT_ID`, `toloka.json`,
|
|
77
81
|
then the machine registry `current`.
|
|
78
82
|
|
|
79
|
-
Anonymous command telemetry is on by default (`sdk_cli_command_completed` / `sdk_cli_command_failed`). `toloka report` uses the same PostHog client to send explicitly approved Markdown in `sdk_cli_issue_report_submitted`. Set `TOLOKA_TELEMETRY=0` or `DO_NOT_TRACK=1` to disable
|
|
83
|
+
Anonymous command telemetry is on by default (`sdk_cli_command_completed` / `sdk_cli_command_failed`). Failed commands with exceptions also emit a sanitized PostHog Error Tracking `$exception`; API failures include the status code and server request ID when available. Raw arguments, messages, stacks, response bodies, and paths are excluded. `toloka report` uses the same PostHog client to send explicitly approved Markdown in `sdk_cli_issue_report_submitted`. Set `TOLOKA_TELEMETRY=0` or `DO_NOT_TRACK=1` to disable all capture; CI is off unless `TOLOKA_TELEMETRY=1`.
|
|
80
84
|
|
|
81
85
|
All commands accept `--source-root <directory>`. Prefer running from the source root so paths and diffs stay obvious. `init` does not walk up: it binds the working directory or `--source-root` only.
|
|
82
86
|
|
|
@@ -98,8 +102,9 @@ toloka project switch <alias>
|
|
|
98
102
|
toloka project current
|
|
99
103
|
toloka project url
|
|
100
104
|
toloka project remove <alias>
|
|
101
|
-
toloka project create [alias] [--name <name>] [--team-id <id>]
|
|
105
|
+
toloka project create [alias] [--name <name>] [--team-id <id>] [--delivery-order-id <id>]
|
|
102
106
|
toloka project untrack <pipeline|dataset> <name> [--confirm]
|
|
107
|
+
toloka delivery-order list
|
|
103
108
|
toloka init
|
|
104
109
|
toloka import [projectId]
|
|
105
110
|
toloka check [pipeline] [--node <name-or-id>] [--json] [--watch]
|
|
@@ -109,6 +114,7 @@ toloka apply
|
|
|
109
114
|
toloka status
|
|
110
115
|
toloka secret set <name> [--from-env <variable>]
|
|
111
116
|
toloka dataset list
|
|
117
|
+
toloka dataset create <name>
|
|
112
118
|
toloka dataset fields <name>
|
|
113
119
|
toloka dataset load <name> --out <file> [--limit <n>] [--timeout <ms>]
|
|
114
120
|
toloka dataset upload <name> <file>
|
|
@@ -128,22 +134,25 @@ toloka model create <name> --base <base-model-id> [--description <text>] [--json
|
|
|
128
134
|
toloka model archive <name-or-id> [--json]
|
|
129
135
|
toloka training list [--json]
|
|
130
136
|
toloka training get <name-or-id> [--json]
|
|
131
|
-
toloka training create <name> (--base-model <id> | --model-version <id>) --dataset <id> [--json]
|
|
132
|
-
toloka training update <name-or-id> [
|
|
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]
|
|
133
139
|
toloka training cost <name-or-id> [--idempotency-key <key>] [--json]
|
|
134
|
-
toloka training run <name-or-id> --estimate-file <path> --version-name <name> [--idempotency-key <key>] [--json]
|
|
140
|
+
toloka training run <name-or-id> [--estimate-file <path>] [--version-name <name>] [--idempotency-key <key>] [--json]
|
|
135
141
|
toloka training runs <name-or-id> [--json]
|
|
136
142
|
toloka training status <training-run-id> [--json]
|
|
137
143
|
toloka training resume <training-run-id> [--json]
|
|
138
144
|
toloka training cancel <training-run-id> [--json]
|
|
139
145
|
toloka training logs <training-run-id> [--follow]
|
|
146
|
+
toloka training metrics <training-run-id> [--key <metric>] [--resolution <n>] [--json]
|
|
140
147
|
toloka skill list [--json]
|
|
141
148
|
toloka skill search <query> [--json]
|
|
142
149
|
toloka skill install <skill-id> [--force]
|
|
143
150
|
toloka report <markdown> [--authored-by human|agent] [--confirm]
|
|
144
151
|
```
|
|
145
152
|
|
|
146
|
-
|
|
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.
|
|
154
|
+
|
|
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.
|
|
147
156
|
|
|
148
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.
|
|
149
158
|
|
|
@@ -151,13 +160,15 @@ Select the platform project with `toloka project add` or `toloka project create`
|
|
|
151
160
|
|
|
152
161
|
## Manage model checkpoints
|
|
153
162
|
|
|
154
|
-
The global Base Model Catalog is read-only and uses `toloka base-model`. `base-model list` prints aligned ID, name, provider, and upstream-
|
|
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.
|
|
155
164
|
|
|
156
165
|
## Train a model
|
|
157
166
|
|
|
158
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.
|
|
159
168
|
|
|
160
|
-
|
|
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.
|
|
161
172
|
|
|
162
173
|
## Adopt an existing live project
|
|
163
174
|
|
|
@@ -227,7 +238,7 @@ Register every code-node behavior with `test.code(pipeline, node, name, callback
|
|
|
227
238
|
|
|
228
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.
|
|
229
240
|
|
|
230
|
-
Register
|
|
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.
|
|
231
242
|
|
|
232
243
|
```sh
|
|
233
244
|
toloka check
|
|
@@ -261,7 +272,7 @@ Pull live rows with `toloka dataset load <name> --out <file> [--limit <n>]`. `--
|
|
|
261
272
|
|
|
262
273
|
## Run a pipeline and report results
|
|
263
274
|
|
|
264
|
-
A run needs a deployed pipeline
|
|
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.
|
|
265
276
|
|
|
266
277
|
```sh
|
|
267
278
|
toloka pipeline run <name> --wait --timeout 900000
|
|
@@ -274,7 +285,7 @@ toloka pipeline cancel <runId>
|
|
|
274
285
|
|
|
275
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".
|
|
276
287
|
|
|
277
|
-
|
|
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.
|
|
278
289
|
|
|
279
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.
|
|
280
291
|
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: toloka-fine-tuning
|
|
3
|
+
description: Create, estimate, start, monitor, and verify a project-owned supervised fine-tuning Training through the Toloka CLI. Use when the user wants to adapt a base model or existing 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.
|
|
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
|
|
30
|
+
|
|
31
|
+
- Never ask for an API key in chat; the user enters it through `toloka login`.
|
|
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
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: toloka-get-started
|
|
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
|
+
---
|
|
5
|
+
|
|
6
|
+
# Get started with Toloka
|
|
7
|
+
|
|
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
|
+
|
|
10
|
+
## Choose the relevant workflow
|
|
11
|
+
|
|
12
|
+
Honor an explicitly requested target. Otherwise choose the workflow that fits the outcome and briefly explain the choice:
|
|
13
|
+
|
|
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:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
bun --version
|
|
26
|
+
toloka --version
|
|
27
|
+
```
|
|
28
|
+
|
|
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:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
curl -fsSL https://platform.toloka.ai/cli/install.sh | TOLOKA_CLI_CHANNEL=preview sh
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Never request an API key in chat. Inspect the active identity with:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
toloka whoami
|
|
39
|
+
```
|
|
40
|
+
|
|
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.
|
|
42
|
+
|
|
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:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
toloka init
|
|
47
|
+
toloka skill search <workflow>
|
|
48
|
+
toloka skill install <skill-id>
|
|
49
|
+
```
|
|
50
|
+
|
|
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.
|
|
61
|
+
|
|
62
|
+
## Safety boundaries
|
|
63
|
+
|
|
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.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: toloka-gisting
|
|
3
|
+
description: Create, estimate, start, monitor, and verify a project-owned prompt-gisting Training through the Toloka CLI. Use when the user wants a compact prompt representation from example conversations and a prompt file.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Compress a prompt with gisting
|
|
7
|
+
|
|
8
|
+
## Mission
|
|
9
|
+
|
|
10
|
+
Help the user learn a compact representation of their static prompt from representative example conversations while preserving the exact prompt and their model, data, quality, latency, 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/gisting.md`.
|
|
13
|
+
|
|
14
|
+
## Domain model
|
|
15
|
+
|
|
16
|
+
- **Prompt gisting** learns soft prompt tokens that stand in for a static instruction prompt. Training examples should contain the dynamic inputs and desired assistant responses; do not repeat the static prompt in every user message.
|
|
17
|
+
- A **Training** is an editable project-owned draft. A **Training Run** is one immutable, billable execution of a frozen draft, prompt, 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, prompt, 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, prompt, 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 weight adaptation from labeled conversations or data labeling rather than prompt compression, explain the distinction and route to `toloka-fine-tuning` or `toloka-build`; never silently change the method.
|
|
28
|
+
|
|
29
|
+
## Safety
|
|
30
|
+
|
|
31
|
+
- Never ask for an API key in chat; the user enters it through `toloka login`.
|
|
32
|
+
- Never invent project, Dataset, Base Model, Training, Model, Model Version, prompt, price, or run IDs. Read identity and source metadata from the CLI.
|
|
33
|
+
- Use only authorized project Datasets containing representative examples. Keep credentials and production data out of source control and agent messages.
|
|
34
|
+
- The prompt file must be non-empty UTF-8 text no larger than 256 KiB. Preserve user-provided prompt text exactly unless they ask to edit it; when the prompt is supplied in chat, materialize that exact text instead of inventing missing intent.
|
|
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 runtime, authentication, or binding is unknown, inspect it:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
bun --version
|
|
47
|
+
toloka --version
|
|
48
|
+
toloka whoami
|
|
49
|
+
toloka project current
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Reuse an authenticated, compatible workspace. For an inspection request, inspect existing resources rather than creating a project, Dataset, Training, prompt file, or run.
|
|
53
|
+
|
|
54
|
+
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.
|
|
55
|
+
|
|
56
|
+
### 2. Inspect and assign data roles
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
toloka dataset list
|
|
60
|
+
toloka dataset fields <dataset-name-or-id>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
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:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
toloka dataset create <role-dataset-name>
|
|
67
|
+
toloka dataset upload <role-dataset-name> <absolute-jsonl-path>
|
|
68
|
+
toloka dataset fields <role-dataset-name>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
Check that the examples demonstrate the desired behavior under the prompt: dynamic input in user messages, target output in the final assistant message, representative edge cases, and no prompt or answer leakage across validation.
|
|
74
|
+
|
|
75
|
+
### 3. Preserve the prompt and choose the source
|
|
76
|
+
|
|
77
|
+
Confirm the prompt path contains non-empty UTF-8 text within 256 KiB. Use the supplied file as-is. If the user supplied prompt text in the request instead, write that exact text to a UTF-8 file. Ask only when the required prompt or its intended boundaries are genuinely missing; do not author a replacement prompt from assumptions.
|
|
78
|
+
|
|
79
|
+
Explicit source choices take precedence. An existing Model Version bypasses Base Model selection.
|
|
80
|
+
|
|
81
|
+
Gisting supports only `qwen3-4b` and `qwen3-8b` because it publishes full model weights. This restriction also applies to the underlying Base Model of an existing Model Version. Unsupported tiers are rejected when creating or updating a Training draft; explain the constraint rather than silently substituting a model.
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
toloka base-model list --json
|
|
85
|
+
toloka base-model get <base-model-id> --json
|
|
86
|
+
toloka model list --json
|
|
87
|
+
toloka model get <model-id> --json
|
|
88
|
+
toloka model versions <model-id> --json
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For a Base Model, compare available evidence about prompt and language fit, prior quality, data volume, desired compression fidelity, 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. Verify the selected catalog ID, upstream model, and pinned revision with `base-model get`, and consult upstream documentation or user-provided evidence for capabilities the catalog does not expose.
|
|
92
|
+
|
|
93
|
+
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, prompt, and data are supported together.
|
|
94
|
+
|
|
95
|
+
### 4. Reuse or create the draft
|
|
96
|
+
|
|
97
|
+
Inspect before creating another Training:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
toloka training list --json
|
|
101
|
+
toloka training get <training-id> --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
When a new draft is needed, use a descriptive name and create normalized gisting configuration:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
toloka training create "<training-name>" \
|
|
108
|
+
--method gisting \
|
|
109
|
+
--prompt-file <absolute-prompt-path> \
|
|
110
|
+
--base-model <base-model-id> \
|
|
111
|
+
--dataset <training-dataset-id> \
|
|
112
|
+
--validation-dataset <validation-dataset-id> \
|
|
113
|
+
--json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
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>`.
|
|
117
|
+
|
|
118
|
+
Preserve requested hyperparameters. The current CLI uses `--gist-tokens 8|32|64` (default 32), `--epochs 1..5` (default 3), `--learning-rate` within 0.001–0.3 (default 0.03), `--batch-size 8|16|32|64` (default 8), and `--max-sequence-length 64..16384` (default 3072), rather than `regime`. Use defaults when suitable; 8 gist tokens favor compression for simple prompts, while 64 may help when 32 loses holdout accuracy. Choose sequence length from actual examples within the supported limit. `--lora-rank` is rejected for gisting. `training update <name-or-id>` takes the same flags except `--method`; omitted flags retain current values.
|
|
119
|
+
|
|
120
|
+
Verify the saved method, exact source, prompt file, selections, filters, 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. Gisting publishes full model weights, so only `qwen3-4b` and `qwen3-8b` are supported; switching to the larger 8-GPU tiers is not a valid workaround. Reducing rows can weaken coverage and reducing epochs can weaken compression quality. Do not silently change the requested model, discard data, or alter epochs merely to make the estimate pass. Explain the tradeoff, obtain direction when material, update the draft, re-estimate, and obtain approval for the new quote.
|
|
131
|
+
|
|
132
|
+
For a ready estimate, report the source, prompt, 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.
|
|
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
|
+
Resume only after the user confirms a billing block is resolved. Cancel only on explicit request.
|
|
156
|
+
|
|
157
|
+
For a completed run, verify the observed output and download only when requested:
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
toloka training get <training-id> --json
|
|
161
|
+
toloka model get <model-id> --json
|
|
162
|
+
toloka model versions <model-id> --json
|
|
163
|
+
toloka model version download <model-version-id> --out <absolute-output-directory>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The downloaded folder contains full model weights (`config.json` and `model-*.safetensors`) and tokenizer files, including supported text sidecars such as `merges.txt` and `chat_template.jinja`. Keep the files together. The learned prompt is represented by `<|gist_…|>` tokens that prefix requests in place of the original prompt. Verify serving separately with a compatible runtime; a successful download alone does not establish inference readiness.
|
|
@@ -26,7 +26,7 @@ The CLI exits 1 with `Potato API request failed with status 500`. The same comma
|
|
|
26
26
|
|
|
27
27
|
## Environment
|
|
28
28
|
|
|
29
|
-
- toloka CLI 0.2.0-preview.
|
|
29
|
+
- toloka CLI 0.2.0-preview.3 (`toloka --version`), Bun 1.4.0, macOS 15
|
|
30
30
|
- Platform: https://platform.toloka.ai
|
|
31
31
|
|
|
32
32
|
## Redactions
|
package/src/authoring/index.ts
CHANGED
|
@@ -524,6 +524,20 @@ export function match(
|
|
|
524
524
|
settings: MatchAuthoringSettings,
|
|
525
525
|
options: AuthoringIdOptions = {},
|
|
526
526
|
): AuthoredMatchNode {
|
|
527
|
+
const conditionNames = new Set<string>();
|
|
528
|
+
for (const condition of settings.conditions) {
|
|
529
|
+
assert(condition.name !== "", "Condition must have a name");
|
|
530
|
+
assert(
|
|
531
|
+
condition.name.length >= 2 && condition.name.length <= 32,
|
|
532
|
+
"Condition name must be between 2 and 32 characters long",
|
|
533
|
+
);
|
|
534
|
+
assert(
|
|
535
|
+
/^[a-z]([a-z0-9_]*[a-z0-9])?$/u.test(condition.name),
|
|
536
|
+
"Condition name must start with a letter, contain only lowercase letters, numbers and underscores, and end with a letter or number",
|
|
537
|
+
);
|
|
538
|
+
assert(!conditionNames.has(condition.name), "Condition names must be unique");
|
|
539
|
+
conditionNames.add(condition.name);
|
|
540
|
+
}
|
|
527
541
|
const id = options.id ?? mintedId("match", name);
|
|
528
542
|
const { conditions, input, ...wireSettings } = settings;
|
|
529
543
|
return {
|