Skip to main content
Learn a compact prompt representation from conversations and a prompt text file. A Training is an editable project draft. A Training Run is one billed execution. A completed gisting Training Run publishes a full Model Version. Always pass --method gisting and --prompt-file. For weight adaptation, use Fine-tune a model.
To work with a coding agent, run claude -p "Let's use gisting. Follow https://platform.toloka.ai/agents/gisting.md" or give the same runbook URL to another agent.
Copy IDs from command output into later commands.

Before you start

You need:
  • macOS or Linux on ARM64 or x64. The installer uses compatible Bun or a standalone executable; standalone Linux downloads require glibc.
  • A Toloka account on a team. Browser sign-in needs no API key. Noninteractive automation can use an API key from the Business Console.
  • A funded team balance. Cost estimation is free; starting a Training Run places a hold up to the printed maximum charge.
  • Example conversations and a non-blank UTF-8 prompt file no larger than 256 KiB.

Step 1 — Install and sign in

Use the latest CLI release. This workflow does not import the TypeScript SDK and needs no project runtime. Rerun the installer for an immediate update. See CLI for installation modes, PATH fixes, and noninteractive authentication.

Step 2 — Create or select a project

The Training, datasets, prompt, billing, and output Model belong to one project.
If you belong to more than one team, pass --team-id. To reuse an existing project:

Step 3 — Put example conversations in a dataset

Each JSONL row is one chat. At least one turn must be user, and the final turn must be assistant with the expected output. Save these rows as support-tickets.jsonl:
The conversation should contain the dynamic task input and expected output. Keep the static instructions you want to compress in the prompt file in the next step. The Training command will give this new dataset an 80% train, 10% validation, 10% test split and freeze it in a slice. These 10 rows yield 8 training rows, 1 validation row, and 1 test row. Create an empty dataset, upload the rows once, and list its ID:
Uploads append, so repeating the upload adds the same rows again. Copy the ds.… ID.

Step 4 — Write the prompt file

Save this as prompt.txt:
The file must contain non-whitespace UTF-8 text and be no larger than 256 KiB.

Step 5 — Choose a Base model

Gisting supports qwen3-4b and qwen3-8b. Larger catalog tiers exceed Model Version size limits because gisting publishes full weights. This guide uses qwen3-8b. You can also start from an SFT LoRA adapter Model Version based on one of the supported tiers. Pass --model-version instead of --base-model. A full-weight Model Version cannot be a source.

Step 6 — Create the gisting Training draft

The command freezes a slice named after the Training and prints Created training trg.…. To use an existing ready slice, pass --slice <id> instead of --dataset; see Dataset selections. Copy that Training ID and inspect the draft:
Method is Prompt gisting. Output Model is - until the first Training Run is created, even if that run later blocks or fails before publishing a version. Optional gisting settings are --gist-tokens, --epochs, --learning-rate, --batch-size, and --max-sequence-length. --gist-tokens takes 8, 32, or 64, or the prompt fraction 1/4, 1/8, 1/16, or 1/32. The default is 1/8. See Training settings for accepted values and defaults.

Step 7 — Review the cost

Open estimate.json, require status: "ready", and review the training rows, tokens, maximum GPU seconds, maximumCharge, and fingerprint. With the 10-row example and default split, expect 8 training rows and 1 validation row; 1 test row stays out of learning. Keep this file for the run command. Gisting counts each training token twice when calculating work. If validation blocks the estimate, the command exits with code 1 and lists every issue.
Starting the Training Run places a hold for the saved estimate’s maximum charge. Do not continue until you accept that amount. If the saved estimate is rejected or expires, calculate and review a new one before retrying.
See Training cost for the estimate, hold, settlement, and no-charge cases.

Step 8 — Start the Training Run

The command uses the saved estimate and Support ticket gisting as the Model Version name. Copy the trn.… Training Run ID. Omitting --estimate-file would calculate a new estimate instead of using the one you reviewed.
Status normally moves from queued to running to completed. Progress queued or pending means the job is waiting for GPU capacity. A Training Run can train longer than estimated. Its charge remains capped at the approved maximum, and it publishes when complete. Do not start a duplicate because the first Training Run is slower than estimated. If status is blocked with reason funds, add funds and run toloka training resume trn.YOUR_RUN_ID. See Training errors for other blocked states.

Step 9 — Use the trained model

When status is completed, inspect the Training and list its Model Versions:
Copy the mdv.… Model Version ID and download it:
The directory contains a full model: config.json and either model.safetensors or a complete numbered set of model-*.safetensors weight shards. Tokenizer files, merges.txt, and chat_template.jinja can be included but are not guaranteed. Inspect the download manifest before choosing serving tooling. The CLI verifies each file’s size and SHA-256. The platform does not host or serve the downloaded Model Version.

If something fails

Use Training errors to search exact prompt, method, estimate, and Training Run messages.