--json on any command prints one envelope on stdout, {"ok": true, "data": ...}, or {"ok": false, "error": {"code", "message", "exit_code", "status", "request_id"}} on stderr. Run --dry-run --json in agent loops to check a run before it costs anything.
Code
Meaning
0
Success.
1
Error: network, server, timeout, checksum or local I/O.
2
Usage error: bad flags or arguments, an invalid local file, bad config.
3
Authentication or permission error (401/403).
4
Not found (404).
5
Conflict or validation error (409/422).
6
Capability unavailable on this server (inference_unavailable, secrets_unavailable).
7
A run, eval or import finished unsuccessfully (failed, cancelled; runs also stopped_budget and stopped_balance).
130
Interrupted (Ctrl-C). A started run keeps going on the server.
grad train --wait, grad runs watch, grad runs wait and grad runs resume --wait open a full-screen view when stdin and stdout are a terminal (over SSH and in tmux too). It shows the run and its config; the phase (waiting for a GPU, starting, training, resuming from a checkpoint) with how long it has lasted, and the attempt; step and cost progress against --max-cost-usd, tokens/s and an ETA; a train/eval loss chart with the best eval marked and the learning rate; checkpoints; and an event log with interruptions and resumes, reconnects, warnings and each eval step's recipe metrics (router offload and cost saving, decision accuracy and ECE, embedding recall@k). It reconnects on its own after a dropped connection and resumes the stream where it left off. Reattached to a running run, it replays the run from its first event, so the chart shows every step (0 to the total, a few spikes clipped and marked) and the phase clock starts when the phase began. Before the first step the chart says what the run is doing, for example Waiting for a GPU (2 workers online, all busy)… or Loading the model….
Key
Action
q / Ctrl-C
Detach (exit 130). The run keeps going; reattach with grad runs watch.
c
Cancel the run, after a y to confirm.
l
Show or hide the full event log.
?
Help.
When the run ends the view closes and prints the usual summary: time, tokens and cost, the eval report, the artifact and its download command. With --json, --plain or GRAD_NO_TUI=1, or when output is piped (CI logs), these commands print plain lines instead.
The server's trainable catalog. --recipe keeps models that support a recipe.
grad datasets list / get NAME
List datasets or show one.
grad datasets create NAME
Create an empty dataset.
grad datasets push NAME FILE
Push a JSONL file of records in batches (--batch-size, default 1000); each batch appends a version.
grad import FILE --dataset NAME
Upload a trace export (JSONL, JSON or Parquet) and import it. --format (auto, jsonl, json, parquet or a parser such as otel, langfuse), --connector, --no-wait.
grad datasets import hf REPO
Import a Hugging Face dataset: --split, --config, --revision, --limit, --column FIELD=COLUMN (repeatable), --secret NAME for gated datasets, --name.
grad datasets import benchmark NAME
Import gsm8k, mmlu, mmlu_pro or arc_challenge at a pinned revision (--limit, --name).
grad datasets records NAME
Print merged records (--version, --limit, --cursor).
grad datasets score NAME --rubric FILE
Score each record's own answer with a YAML/JSON rubric; billed like an eval, and the scores become the next version. --version, --limit, --wait.
grad datasets filter NAME
Save a filtered view: --score NAME>=VALUE (repeatable), --metadata KEY=VALUE, --created-after, --created-before, --ids, --version, --view.
grad imports list / status ID / wait ID
Inspect import jobs.
grad render NAME
Preview the chat template and loss mask: --model, --train-on last|all_assistant, --thinking auto|on|off, --limit (1–20).
Create or replace a write-only workspace secret; the value is read from stdin. --allowed-host HOST (repeatable) names where it may be sent; the default is the public provider hosts.
grad secrets list / delete NAME
List secret names, or delete one (refused while a source uses it).
grad sources add PROVIDER --dataset NAME
Connect langfuse, langsmith, braintrust, posthog, phoenix or gradiated to a dataset: --host, --secret NAME, --project (required for Braintrust and PostHog), --schedule CRON (five-field UTC), --filter KEY=VALUE (repeatable), --sample-rate, --max-records-per-sync, --max-records-per-day, --version-interval SECS, --idempotency-key. The gradiated source is coming soon on Gradiated Cloud (501 source_unavailable until then).
grad sources list
Sources with their filters, schedule, status (active or paused), last sync and last error (--dataset).
grad sources show ID
A source's effective filters, sampling, caps and last sync.
grad sources update ID
Change it from the next sync: --filter KEY=VALUE (replaces all), --clear-filters, --schedule CRON or --no-schedule, --sample-rate, --max-records-per-sync, --max-records-per-day (0 removes a cap), --version-interval.
grad sources sync ID
Sync now (--full rebuilds the dataset as a new version, --wait, --timeout SECS to stop waiting while the sync goes on). Returns the running sync if there is one, and resumes a paused source.
grad sources remove ID
Disconnect a source. Its dataset and versions stay.
Plan (--dry-run, $0) or start a run. --dataset, --name, --recipe (sft, dpo, router, decision-model, cartridge, embedding, distill, reward-model), --model, --max-cost-usd, --wait, --idempotency-key, or -f run.yaml.
grad train recipe flags
--lr, --lr-scale, --epochs, --batch-size, --adapter-rank, --train-on, --thinking, --split by_session|by_group|random, --eval-fraction; router --models, --max-quality-drop; DPO --beta; router, decision and reward --rubric NAME|FILE (a score already on your records, or a rubric file as in grad eval); distill --teacher, --rollout on-policy|off-policy, --max-new-tokens, --context-file; cartridge --context-file, --num-tokens, --teacher; reward --score. Anything else: --set KEY=VALUE.
grad runs list
Runs, newest first.
grad runs inspect RUN
Show a run. --yaml prints a config that grad train -f re-runs: it plans the same resolved config, with the resolved lr pinned and a continued-training run's starting artifact as model.
grad runs logs RUN
Step metrics; --follow streams them until the run ends, --after-step N skips earlier steps.
grad runs events RUN
Lifecycle events: phases, metrics, checkpoints, attempts and interruptions, warnings; --follow streams them until the run ends.
grad runs watch RUN
Follow a run live: the full-screen view on a terminal, the plain readout otherwise (--timeout). Reattach to a run you detached from.
grad runs wait RUN
Wait for a run to finish (--timeout, default 24 hours).
grad runs cancel RUN
Cancel a run. A running attempt is stopped and billed. A name must match one active run (--latest picks the newest).
grad runs resume RUN
Resume a stopped, failed or cancelled run from its latest checkpoint. --max-cost-usd is required for a stopped_budget run; --wait; --latest when several runs share the name.
grad runs checkpoints RUN
List checkpoints with step, score, best and expiry.
grad runs promote CHECKPOINT
Copy a checkpoint into a new artifact (--name).
RUN is a run id or a run name. Names aren't unique: when several runs share one, commands that read a run show the newest and say so on stderr (2 runs match 'X'; showing the newest (run_…). Pass a run id to choose.; with --json, in the envelope's warnings), and cancel and resume refuse unless --latest is given. grad train warns when a run with its --name is already queued or running, and starts it anyway. grad train, grad eval, grad datasets score and grad sources add take --idempotency-key KEY, so a retried command returns what the first one created.
Show an artifact by id, NAME@VERSION or NAME@latest, with its provenance (run, upload or import).
grad artifacts download REF
Download, verify (SHA-256) and extract into a PEFT directory: -o DIR, --archive FILE to keep the .grad.tar.gz, --force to replace an existing directory.
grad artifacts download REF --url
Print a presigned URL of the bundle, valid 15 minutes, instead of downloading.
grad artifacts upload PATH --base MODEL
Register local weights (a directory, file or .tar.gz) as an artifact after an import worker checks them: --format (default peft_lora), --name, --no-wait. A failed check names the file and exits 5.
grad artifacts import hf://OWNER/NAME[@REV] --base MODEL
The same from the Hugging Face Hub, pinned to the commit the revision resolved to: --secret NAME for gated or private repos, --format, --name.
grad artifacts delete REF
Delete an artifact and its bundle. Refused (409 artifact_pinned) while a published Gradiated Cloud model version pins it.
Create a scoped key; the secret is printed once. See API key scopes.
grad keys list / revoke ID
List or revoke keys.
grad usage
Cost and tokens for a period, by kind (training, eval, scoring, labeling, teacher), with the top 5 runs and evals. --from, --to, --by day|week|month|model|recipe|kind.
grad usage list
The billed rows, newest first: --from, --to, --run RUN (with the evals it started), --eval EVAL, --kind, --limit, --cursor.
grad ui [RUN]
Open the server's web UI in your browser, signed in with the current profile's key (RUN opens one run).
List commands take --limit and --cursor. Usage periods are UTC and default to this month: --from is inclusive, --to YYYY-MM-DD covers that whole day and a timestamp is exclusive.
grad local runs Postgres, SeaweedFS (S3), the API, a CPU trainer worker and an eval worker with Docker Compose on 127.0.0.1; the API and web UI are at http://127.0.0.1:18787. See Self-hosting.
Command
What it does and its main flags
grad local up
Pull the images, start the stack and write the local profile. --gpu adds the CUDA worker, --observability adds Prometheus and Grafana with the grad dashboards, --image-tag TAG pulls another build (sha-abc1234, 0.3.0), --build builds images from a checkout instead, --dev-models adds tiny random test models (test/tiny-qwen3, test/tiny-qwen3-teacher, test/tiny-bert) and a CPU inference endpoint that serves them, artifacts trained on them and the test/tiny-judge judge to evals, for trying the workflow (train, eval, compare) on a laptop, --port, --no-wait, --timeout. It writes only the local profile, and refuses when --profile or GRADIATED_PROFILE selects a profile for another server.
grad local status
Container status, API health and the API, UI, Grafana and Prometheus URLs.
grad local logs [SERVICE]
Logs of grad-server, grad-eval-worker, grad-trainer, postgres, seaweedfs or migrate (--follow, --tail).
grad local down
Stop the stack and keep its data (-v/--volumes deletes it).
grad local reset
Delete the local data and keys (-y skips the prompt).
Every grad local command takes -f/--file (repeatable) for your own compose files and --project-name. If Docker Hub refuses the pull, grad local up fails with image_pull_denied (run docker logout or docker login and retry, point GRAD_SERVER_IMAGE/GRAD_TRAINER_IMAGE at the ghcr.io/gradiated mirror, or use --build); image_not_found means no image has that tag. Inside a grad checkout without --image-tag, either one builds the images from the checkout instead and says so. GRAD_SERVER_IMAGE, GRAD_TRAINER_IMAGE and GRAD_TRAINER_GPU_IMAGE use your own images and skip the pull.