toloka. A Training is an editable project draft. A Training Run is one billed execution. The first Training Run creates the output Model; a completed run publishes an immutable LoRA adapter Model Version.
To work with a coding agent, run
claude -p "Let's fine-tune a model. Follow https://platform.toloka.ai/agents/fine-tuning.md" or give the same runbook URL to another agent.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.
- Labeled conversations. Use the sample below, or prepare your own with Prepare training data.
Step 1 — Install and sign in
toloka update command. See CLI for installation modes, PATH fixes, and noninteractive authentication.
login opens the Toloka sign-in page in your browser. whoami prints the platform URL, account, selected project, and reachable project count.
Step 2 — Create or select a project
The Training, datasets, billing, and output Model belong to one project.--team-id. To reuse an existing project:
Step 3 — Put labeled conversations in a dataset
Each JSONL row is one chat. At least one turn must beuser, and the last turn must be assistant with the output the model should learn.
Save these rows as support-tickets.jsonl:
Uploaded 10 rows to dataset support-tickets. Uploads append, so repeating it adds the same rows again. Copy the ds.… ID from dataset list.
Step 4 — Choose a Base model
qwen3-4b, qwen3-8b, qwen3-32b, and qwen3-235b. This guide uses qwen3-8b. Pass the printed ID to --base-model.
To continue training an existing adapter, use a LoRA adapter Model Version from the same project instead. Find its ID with:
Step 5 — Create the Training draft
SFT is the default method, so do not pass--method:
Created training trg.…. To use an existing ready slice, pass --slice <id> instead of --dataset; see Dataset selections. Copy that Training ID.
To warm-start from an adapter, pass --model-version instead of --base-model:
Supervised fine-tuning (SFT). Output Model is - until the first Training Run is created, even if that run later blocks or fails before publishing a version.
Optional SFT settings are --lora-rank, --epochs, --learning-rate, --batch-size, and --max-sequence-length. See Training settings for accepted values and defaults.
Step 6 — Review the cost
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. If validation blocks the estimate, the command exits with code 1 and lists every issue. Fix them and calculate again.
See Training cost for the estimate, minimum charge, hold, settlement, and no-charge cases.
Step 7 — Start the Training Run
Support ticket SFT 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.
queued to running to completed. While status is running, Progress shows the current phase. Progress queued or pending means the job is waiting for GPU capacity.
A Training Run can train longer than estimated. It stays running, 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.
training metrics lists each metric’s latest value. Use --key train/loss for one metric’s point history and --resolution to request 2–500 points; the default is 200. The CLI reports when a history was thinned or trimmed.
If status is blocked with reason funds, add funds and run:
Step 8 — Use the trained model
When status iscompleted, inspect the Training and list its Model Versions:
mdv.… Model Version ID and download it:
adapter_model.safetensors, adapter_config.json, and any additional validated JSON files. The CLI verifies file sizes and SHA-256 hashes.
The result is a LoRA adapter, not a hosted endpoint. Use it with its matching Base model. The Model Version records the Base model ID; upstream repository and revision belong to the catalog entry. See Pinned revisions and lineage before serving the adapter.