Documentation
Jobs and results
View .mdOpenAPI

Estimate a job before sending it

POSThttps://weights.fyi/run/v1/jobs/estimatescope: submit
text
POST https://weights.fyi/run/v1/jobs/estimate
Authorization: Bearer <token>                    scope: submit
{"kind": "finetune", "recipe": "<recipe>", "train_rows": <n>, ...}
Available since
2026-10-22: included in this build; see What is live for deployment status.
Answer time
synchronous: the estimate is worked out from the request alone, without reading your account or your data.

Works out, before you send it, what a batch of model calls or a training job would take: how long each part lasts, how many bytes travel in and out, whether the work fits in the memory one run of the model has, and a planning cost in US dollars and euros. An estimate is arithmetic on the numbers you give and the defaults it fills in. It makes no job, holds no credit, starts nothing and charges nothing, and the same request always answers the same estimate_id.

Every field is optional, so read the answer's workload back: it states what was assumed, and a request without any count is estimated as 100 items. throughput_source says what the speed rests on: measured, calibrated (taken from a similar model that was measured) or unmeasured (defaults for a model the estimator does not know). The cost follows from the estimated working time, not from the price per unit a job is admitted at; for what a job will be charged, ask GET /v1/quote.

Request

A JSON object of at most 64 KiB, or the service's small-body limit when that is larger.

NameWhereRequiredMeaning
AuthorizationheaderyesBearer and a token with submit.
workload_kind or kindbodynoinference_batch_flex (or batch, flex) for a batch of model calls; finetune_sft, finetune_dpo or finetune_discriminative for training. finetune picks the training kind from recipe. Left out, it is read from recipe, objective, format or the presence of items.
recipebodynoA training recipe, such as laya-page-role/v2, laya-specialist-heads/v1, laya-student-lora-sft/v1 or laya-student-lora-dpo/v1.
objective, formatbodynosft, dpo or specialist_heads, and the dataset's record format. Each must agree with the kind.
model or base_modelbodynoThe model to run or train. Left out: qwen3.8-27b for a batch, laya-student-base for sft and dpo, else laya-page-role-base.
items, items_countbodynoA batch's items, or only how many there are.
train_rows, validation_rowsbodynoA training job's rows.
byte_size, logical_byte_size, compressionbodynoThe data's size as sent and uncompressed, and none, zstd, gzip or lz4. Compressed data is not counted as compressed again.
source_refbodynoA dataset pointer; its row and byte counts are read.
optionsbodynoTraining options the estimate reads: epochs, checkpoint_seconds, max_seq_length, lora_rank, num_heads.
max_tokens, avg_prompt_tokens, avg_completion_tokens, response_formatbodynoA batch: the answer bound, the average tokens per item, and structured output.
strict_fitbodynotrue refuses work that does not fit with 422 instead of answering fits: false.
eur_per_usdbodynoYour own exchange rate for the euro amounts.

Return value

200 OK with the estimate. It can hold more fields than these; rely on the ones listed.

FieldMeaning
schema, estimator_versionweights.job-estimate/v1 and the estimator's version.
estimate_id, spec_sha256, basis_sha256est_ and 24 hexadecimal characters, a digest of the work as it was read, and a digest of the whole estimate.
workload_kind, modelThe kind that was resolved, and the model under its canonical name.
throughput_sourcemeasured, calibrated or unmeasured.
hardware_fitestimated_peak_hbm_gb, the memory the work is expected to need at its peak in GB, and fits.
bandwidth_proposalThe data moved: item_count, logical_ingress_bytes, wire_ingress_bytes, wire_egress_bytes, total_transfer_seconds, compression, already_compressed, and recommended_chunk_items and recommended_chunk_count for sending the work in chunks.
durationSeconds by part: transfer_seconds, warmup_seconds, compute_seconds, validation_seconds, checkpoint_seconds, calibration_seconds, and total_seconds.
costusd_micros and eur_micros, the same as usd and eur, the parts compute_usd_micros, transfer_usd_micros and storage_usd_micros, and fx: the exchange rate used, its source, as_of and is_fallback (true when you sent no rate).
workloadWhat was assumed: rows, epochs, tokens and speeds.

Errors

StatusCodeWhen it happensWhat to do
400invalid_estimate_specThe body is not one JSON object, repeats a key, names no kind that can be resolved, or its objective, format and kind disagree; message says which.Fix the body.
401unauthorized, invalid_token, token_revoked, token_expiredNo token, or one that does not work (any more).Use a valid token.
403scope_required, account_suspendedThe token lacks submit, or the account is suspended.Use a token with submit.
413body_too_largeThe body is over the limit; limit_bytes names it.Send counts and sizes, not the data.
422hardware_fit_exceededstrict_fit is true and the work does not fit.Make the work smaller, or read hardware_fit without strict_fit.
429rate_limitedThe token's request rate.Wait Retry-After seconds.

Examples

A training job of 40 training and 10 validation rows over 4 epochs; the answer is abridged to the fields above:

sh
curl -s https://weights.fyi/run/v1/jobs/estimate -H "Authorization: Bearer $WEIGHTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "finetune", "recipe": "laya-page-role/v2", "model": "laya-page-role-base", "train_rows": 40, "validation_rows": 10, "options": {"epochs": 4}}'
json
{
  "schema": "weights.job-estimate/v1",
  "estimator_version": "2026-10-22.v1",
  "estimate_id": "est_63575a51e2768b173ebba7b9",
  "workload_kind": "finetune_discriminative",
  "model": "laya-page-role-base",
  "throughput_source": "measured",
  "hardware_fit": {"estimated_peak_hbm_gb": 21.282, "fits": true},
  "duration": {"transfer_seconds": 0.0, "warmup_seconds": 25.0, "compute_seconds": 2.222, "validation_seconds": 0.278,
               "checkpoint_seconds": 67.2, "calibration_seconds": 0.0, "total_seconds": 94.7},
  "cost": {"usd_micros": 63138, "eur_micros": 54722, "usd": 0.063138, "eur": 0.054722,
           "fx": {"eur_per_usd": 0.866701, "usd_per_eur": 1.1538, "source": "ecb_reference_fallback",
                  "as_of": "2026-10-22T00:00:00Z", "is_fallback": true}},
  "workload": {"recipe": "laya-page-role/v2", "epochs": 4, "train_rows": 40, "validation_rows": 10, "num_heads": 1,
               "effective_pages_per_sec": 72.0, "calibrate_temperature_and_thresholds": false}
}

History

  • 2026-10-22: built.
  • 2026-11-16: this page added.

See also