Submit a compute plan
POST https://weights.fyi/run/v1/compute/plans
Authorization: Bearer <token> scope: submit
Content-Type: application/json- Available since
- 2026-10-28: included in this build; see What is live for deployment status.
- Answer time
- synchronous admission; execution follows asynchronously. Optional source checks wait for remote reads, with a five-second timeout on each connection and read.
Drops a ComputePlan into the durable queue: work split into stages, dependencies, a schedule and a budget. Admission costs nothing and starts nothing by itself. Each stage runs once its dependencies are done, its window is open and capacity that is ready for its own model exists; wake_policy says whether the plan may start that capacity or only use what already runs (Queued work). The account must hold a grant for the supplied tenant and organisation.
Retry the same normalised submission to recover its current receipt. operation_key is unique within the account and tenant; reusing it with different content returns 409. plan_id is optional and globally unique; omit it to have one minted. Source-check flags are removed before comparison. Admission confirms acceptance, not execution; check a plan first, at no cost, with a dry run.
Request
Send one JSON object, at most 1 MiB. Identifiers contain 1–128 ASCII letters, digits, ., _, : or -; integers below are signed 64-bit values without fractions or booleans. Dependencies must name stages in this plan and contain no cycles; output paths must belong to the plan's tenant.
Unknown fields are refused, never ignored. 400 invalid_compute_plan names every unknown field of the submission, tenancy, schedule, placement, a stage or its workload at once, as in unknown schedule field(s): wake_polcy. metadata, stream_spec, customer_container, mounts and datasets are free-form or checked on their own.
| Name | Where | Required | Meaning |
|---|---|---|---|
Authorization | header | yes | Bearer token with submit. |
plan_id | body | no | The plan's identifier, unique across all accounts: one in use returns 409, whoever holds it. Omit it and the service mints plan- and 32 random hexadecimal digits, which no one can name first; the receipt carries it, and a retry under the same operation_key finds it again. |
operation_key | body | yes | Replay protection within the account and tenant. |
tenancy | body | yes | Object described below. |
schedule | body | yes | Object described below. schedule_window is an alias and is enough on its own; if both appear, they must agree. |
placement | body | no | Object or null, described below: whether the plan may start capacity or only use what already runs. |
metadata | body | no | Free-form object. metadata.request declares the chat request a dry run checks. |
stages | body | yes | Nonempty array of stage objects. |
lazy | body | no | Boolean, default false. True holds the plan as queued until service dispatch; promotion does not release this queue. Omit it for ordinary submission. This flag is independent of lazy pack registration. |
required_models | body | no | Array of objects with nonempty model_id and role; at most one primary, which must match a supported model configuration. Optional tp_degree is a positive integer up to 4,294,967,295. |
webhook_url | body | no | Nonempty string or null; stored only, never called. Use notify. |
notify | body | no | Object or null, described below: push the plan's events to one of your webhook trace sinks. |
verify_source | body or stages[].workload | no | Boolean. True checks all mounts and inline pack manifest entries, or only that stage's, before admission. |
verify_source | query | no | 1, true, 0 or false, ignoring case and surrounding whitespace. True checks all stages; false cannot disable a service-required check. |
| Object | Fields and rules |
|---|---|
tenancy | Required identifiers tenant_id, org_slug; nonempty platform; max_budget_usd_micros, positive under the default funding_mode: plan_cap, the plan's one budget for every stage (accounting). Optional nonempty container_id, actor_email, default null. Defaults: colocation_policy: "shared_pool_ok", privacy_rung: "rung1_standard"; privacy also accepts rung2_enclave_tls and rung3_sealed_envelope. |
tenancy.funding_mode | plan_cap (default) requires a positive lifetime cap. operator_epoch requires max_budget_usd_micros: 0 and an authenticated operator/admin workspace and, when present, operator/admin person. It retains all model-seat stages, spend and reservations without a per-plan or derived daily token cap; the shared operator epoch funds execution. Ordinary account credit checks still apply. A client-supplied platform: awow grants no privilege. |
tenancy.funding | platform_shared, byoc_self_funded or null (default). A byoc_self_funded plan runs only on workers your workspace enrolled, or that are shared with your account, and rents nothing: its hourly rate is zero, so no price ceiling holds it. |
schedule | Required nonnegative Unix milliseconds window_start_ms, until_ms, with end after start. Optional boolean prefer_low_cost_window, default true; nonnegative max_hourly_usd_micros, default null. |
schedule.wake_policy | standard (default): the plan may start the model it needs, within max_hourly_usd_micros, and keeps it running while its work remains. scavenger_stream, piggyback: a standing plan. It never starts a model and never keeps one running; it waits at no cost until capacity that other work started is ready for its model, then works beside that work. A piggyback fine-tune rides a model that is already warm. |
schedule.until_ms | A deadline, not a queue horizon. Under incomplete: fail, or none, unfinished stages fail at until_ms with hard_deadline_expired and the plan ends failed. Under incomplete: ok each stream stage settles as completed over what it delivered: its lazy and pending packs become expired_incomplete and its outcome reads incomplete_expired. A standing plan's unfinished whole-stage work, such as a fine-tune, is cancelled with standing_window_closed. |
schedule.incomplete | fail or ok; aliases require_all and allow_incomplete. ok makes the plan standing and requires a stream stage. A standing wake policy requires a stream stage or a finetune stage, so standalone training is accepted under piggyback or scavenger_stream. scavenge_label requires a standing schedule. |
placement | placement_mode: default or existing_byoc_only. Booleans allow_provisioning, requires_cold_boot. existing_byoc_only, false on either boolean, or a nonempty allowed_node_ids makes the plan use existing capacity only: like a standing plan it never starts a model and never keeps one running. The booleans default to false for an existing_byoc_only or pinned one and to true otherwise; a standing plan starts nothing while it stands, and once promoted starts capacity unless its placement forbids it. An existing_byoc_only or pinned plan never starts capacity, whatever the booleans say. pool_id (identifier or null) is validated and recorded with the plan; this build does not place work by it. |
placement.allowed_node_ids | Array of identifiers, default []: the node_id of each of your enrolled workers the plan may run on. Empty, any worker the plan's tenancy admits runs it. Nonempty, the plan is pinned: only a worker whose node_id is listed, exactly as enrollment issued it, is handed its packs and stages, and only that worker counts toward the plan's readiness and capacity. Every other worker passes the plan over and does not count; one that already holds work of the plan cannot renew or report it. A revoked worker, or one that never enrolled, matches no list. The tenancy rules still apply to a listed worker. |
stages[] | Required unique stage_id, execution_mode, workload. needs defaults to []; every entry names a stage in this plan. Optional object metadata; object or null stream_spec; positive max_pending_packs; mounts, datasets, lazy_materializer. |
execution_mode | awow_harness_lease for live_session_pool; weights_managed_compute for the other kinds below. |
workload | Required kind; nonempty model except for cpu_scavenger. Optional positive packs_total, expected_packs, max_attempts; boolean materialize_lazy_on_lease on streams. Boolean continuous on an open stream (open_stream: true, no fixed total_items): the stream is never sealed on a pack count, and a pack registered after it was sealed or completed reopens it; see consolidation. |
qos_priority, qos_tier, qos | Optional on schedule, stage, metadata or workload: standard, interactive, priority, flex, batch, scavenger, piggyback. Resolution: stage, workload, metadata, schedule; within each, aliases in the listed order. The first three values resolve to the standard class; the rest to flex. |
priority_weight | The scheduling weight, separate from the class. Integer 1–16 on a stage, its workload or the schedule; the most specific wins. Without one the declared tier decides: priority 4, interactive 3, standard 2, and 1 for flex, batch, scavenger and piggyback. With no tier either: 2 for a standard plan, 1 for a standing one. Heavier stages wake first. When one model's capacity is too small for every stage that wants it, its seats are shared in proportion to sessions times weight, no stage getting more than it asked for; with room to spare the weight changes nothing. Priority and standard work therefore run at the same time on one wave, at equal session counts in a 4:2 share, not one after the other. |
| Window controls | min_remaining_window_ms, est_duration_ms: positive integers on the schedule, a stage, its workload or stream_spec, or on a pack. A pack is leased only while at least min_remaining_window_ms of the window remains. skip_unfinishable_packs: true on the schedule also holds back a pack whose est_duration_ms no longer fits before until_ms. |
mounts, datasets | Arrays on stage, metadata or workload. Each entry has unique mount_id (aliases name, dataset_id) and source_uri; optional sha256, byte_range: [start, end] with an exclusive end, nonnegative compressed_bytes, nonempty format, absolute unique mount_path, hydration: "jit" or "prestage". See supported sources for pinning. |
| Runtime mounts | Put JIT mounts in workload.mounts or workload.datasets. They fetch digest-checked files into a scratch cache; mount_path does not create an arbitrary filesystem mount. prestage entries require prior preparation; OCI requires prestaging. Supply an explicit range digest for ranged reads. |
| Output paths | Use r2://tenants/<tenant_id>/<path>, s3://tenants/<tenant_id>/<path> or s3://<bucket>/tenants/<tenant_id>/<path>. No credentials, query, fragment or traversal. Input storage access also enforces tenant custody. |
notify | Required sink_id: the id of one of your webhook trace sinks. Optional events: unique public event names, stored sorted; empty or left out receives every one. null is the plan without notify. |
notify.events | pack_completed, pack_dead_lettered, pack_requeued, plan.cancelled, plan.failed, plan_admitted, plan_completed, plan_consolidated, plan_superseded, scavenger_plan_promoted, stage.cancelled, stage.failed, stage.lease.revoked, stage_completed, stage_dead_lettered, stage_incomplete_settled, stage_lease_ready, stage_lease_released, stage_progress, stage_woken, stream_reopened. |
notify delivery | A POST to the sink's URL per batch, one JSON line per event: type: "compute_event", schema: "weights.compute-event/v1", event_id (compute-event-<seq>), seq, emitted_at_ms, event, account_id, tenant_id, org_slug, container_id, plan_id, stage_id, pack_id and ordinal (null but on pack events), and data, the event's public fields as the event log names them. Signed as the sink's spans: X-Weights-Signature: sha256= and the hex HMAC-SHA256 of X-Weights-Timestamp, . and the body. A plan's events arrive oldest first and at least once: key on event_id. A failure is retried with backoff and never dropped; a redirect is not followed. Bearer tokens, prices and capacity details are never sent. |
lazy_materializer | Policy on stage, metadata or workload; an eligible stage can register its first batch during admission. Read the backlog before explicitly filling another window. See materialization for its fields and a prepared-input example. |
| Workload kind | Additional fields |
|---|---|
classifier_drain, embedding_drain | Positive total_items, nonempty manifest_uri, tenant-scoped output_prefix_uri. With open_stream: true, total_items may be zero or omitted with nonnegative total_items_hint; manifest may be null. |
embedding_drain | Model Qwen/Qwen3-Embedding-8B, Qwen/Qwen3-Embedding-4B or Qwen/Qwen3-Embedding-0.6B; aliases qwen3-embedding-8b, qwen3-embedding-4b, qwen3-embedding-0.6b. dimensions 1–4096 (default 768); unique nonempty aspects from offerings, profile (default both); dtype float16 (default) or halfvec. |
llm_batch_drain | Nonnegative total_items_hint, est_input_tokens, est_output_tokens; output_prefix_uri; either open_stream: true or nonempty manifest_uri. |
cpu_scavenger | output_prefix_uri; either an open stream or manifest. Only runtime_id: "google-quantum-scavenger-v1" is accepted (also the default). Positive cpu_cores, ram_mb required; arch defaults to x86_64, also accepts aarch64 and their aliases amd64, x86-64, arm64. |
scavenge_label | Standing schedule; model haiku, claude-haiku-5-5, luna or luna-6; output_prefix_uri; either an open stream or manifest. Optional seat budget for one lease, refused on every other kind: max_wall_seconds (positive, at most the window's length), max_turns (positive integer), wrap_up_fraction (strictly between 0 and 1; needs one of the other two): the share of either budget at which the seat is told to wrap up. See seat lanes. |
finetune | Positive steps, nonempty dataset_uri, tenant-scoped output_checkpoint_uri; optional training intent such as recipe, objective, dataset_id, dataset_revision, manifest_uri, manifest_sha256, base_checkpoint_uri, replay_weights. |
live_session_pool | Positive target_parallel_sessions up to 4,294,967,295; nonnegative est_total_tokens, est_duration_seconds; optional harness_kind, customer_container, workload_spec. |
| Optional workload fields | Rules |
|---|---|
| Checkpoint dependencies | reload_checkpoint_from_stage must also appear in needs (accepted on classifier_drain, llm_batch_drain, embedding_drain, and finetune for SFT -> DPO chaining). To reload a checkpoint from an earlier plan, also set reload_checkpoint_from_plan; its stage must be a finetune stage owned by this account with the same tenant and model. Execution waits for its completed output_checkpoint_uri and passes it to the worker in lease.reload_checkpoint_uri. |
| Training intent | recipe, dataset_id, manifest_uri, base_checkpoint_uri: nonempty strings or null. objective: sft, dpo, specialist_heads. dataset_revision: nonnegative integer or nonempty string. manifest_sha256: 64 lowercase hexadecimal digits. replay_weights: nonempty mapping of nonempty cohort names to finite positive numbers. Optional total_pages is positive. |
| CPU resources | Resolve from stage resources, stage scavenger, workload scavenger, then workload. Cores may use cpu_millis rounded up to whole cores; memory may use memory_bytes rounded up to MiB or ram_gb multiplied by 1024. Cores cannot exceed 4,294,967,295. |
| Live session context | session_duty_cycle: number in (0,1]; multiplex_across_seats: boolean; mean_context_tokens: finite positive number, effective default 32768; prefix_sharing_alpha: number in [0,1], effective default 0. |
customer_container | Object or null. Required nonempty image; command: string or string array, default []; allowed_target_domains: nonempty-string array, default []; cpu, memory: nonempty strings, defaults "2", "4Gi"; registry_secret_ref: nonempty string or null. |
workload_spec, runner | Live sessions only; object-valued runner specifications accept command, args, entrypoint as strings or string arrays; string-valued env; allowed_target_domains or allowed_domains; positive lease_ttl_seconds, heartbeat_interval_seconds, timeout_seconds; booleans require_hot_pool, requeue_on_failure; mounts and datasets. A supplied workload_spec.model must match the workload model. |
Return value
201 Created with the plan receipt and source_probe; 200 OK for an identical retry.
| Field | Meaning |
|---|---|
source_probe.verified, mode, probes | No reads: false, syntax_and_custody_only, []. Otherwise true, live_range_probe, and one entry per checked mount or manifest entry. |
probes[] | stage_id, mount_id (a mount) or pack_id (a lazy_materializer entry), uri, HTTP status, supports_range, remote_bytes, magic_ok; the last three may be null where unknown or inapplicable. |
Probes check reachability, ranges, sizes where known and recognised file headers. They do not hash entire inputs. A failed probe leaves a new plan unwritten; a plan without mounts or manifest entries naming one object remains unverified. Checks run again on a verified retry; failure does not remove earlier accepted work.
Errors
| Status | Code | Meaning |
|---|---|---|
400 | invalid_json, invalid_compute_plan | Invalid JSON, unknown or invalid fields, dependencies, source syntax or tenant paths. message names the input to correct. |
400 | source_unreachable, source_range_unsupported, source_range_out_of_bounds, source_size_mismatch, source_format_mismatch | Requested source checks failed. Fix the source or its declaration. |
401 | unauthorized, invalid_token, token_revoked, token_expired | Supply a valid token. |
403 | scope_required, account_suspended, compute_tenancy_unauthorized, compute_funding_unauthorized | Missing scope, active account, matching tenant grant, or operator funding authority. |
400 | notify_sink_not_webhook | notify.sink_id names an OpenTelemetry or MLflow sink; events go to a webhook sink. |
404 | compute_stage_not_found | An external checkpoint stage cannot be read by this account. |
404 | sink_not_found | notify.sink_id names no trace sink of this account. |
409 | compute_plan_conflict | The plan_id is already in use, or the operation key was used with different content. |
413 | body_too_large | Body exceeds 1 MiB. |
429 | rate_limited | Wait for Retry-After before retrying. |
503 | source_probe_unavailable | The service lacks storage settings needed for the requested check. |
Examples
Use your granted tenant and organisation, and a suitable future window. Then register packs using the returned stage stream_id:
curl -s https://weights.fyi/run/v1/compute/plans \
-H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
-d '{"plan_id":"example-plan","operation_key":"example-1","tenancy":{"tenant_id":"demo","org_slug":"demo","platform":"api","max_budget_usd_micros":1000000},"schedule":{"window_start_ms":1793232000000,"until_ms":1793318400000,"wake_policy":"scavenger_stream"},"stages":[{"stage_id":"pages","execution_mode":"weights_managed_compute","workload":{"kind":"classifier_drain","model":"laya-page-role","open_stream":true,"total_items_hint":0,"output_prefix_uri":"r2://tenants/demo/results/"}}]}'Selected response fields:
{"plan_id":"example-plan","operation_key":"example-1","state":"waiting_price","stages":[{"stage_id":"pages","stream_id":"example-plan~pages","kind":"classifier_drain","model":"laya-page-role","state":"waiting_price","needs":[]}],"source_probe":{"verified":false,"mode":"syntax_and_custody_only","probes":[]}}Patterns
Chaining a fine-tune stage into a drain
curl -s https://weights.fyi/run/v1/compute/plans \
-H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
-d '{
"plan_id": "leadgen-jev-scavenge-experiments-20261102",
"operation_key": "leadgen-jev-scavenge-experiments-20261102",
"tenancy": {"tenant_id": "12", "org_slug": "zyxio", "platform": "leadgen", "max_budget_usd_micros": 25000000},
"schedule": {"window_start_ms": 1793577600000, "until_ms": 1794182400000, "wake_policy": "piggyback", "incomplete": "ok", "qos_priority": "scavenger", "max_hourly_usd_micros": 3500000},
"stages": [
{
"stage_id": "heads_fastino_glide_28b",
"execution_mode": "weights_managed_compute",
"needs": [],
"datasets": [{"dataset_id": "ds_9c4a2fe8c05ca3c197027074", "source_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/datasets/scavenge-teacher/2026-11-02-r1/heads/manifest.json", "sha256": "f0d0329d2ded7a90e721a95299aecd7feb6640107d11cb0af73baf819e545c41", "format": "laya-specialist/v1", "hydration": "jit"}],
"workload": {
"kind": "finetune",
"model": "fastino-glide-28b",
"objective": "specialist_heads",
"recipe": "laya-specialist-heads/v1",
"steps": 1843,
"dataset_id": "ds_9c4a2fe8c05ca3c197027074",
"dataset_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/datasets/scavenge-teacher/2026-11-02-r1/heads/manifest.json",
"manifest_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/datasets/scavenge-teacher/2026-11-02-r1/heads/manifest.json",
"manifest_sha256": "f0d0329d2ded7a90e721a95299aecd7feb6640107d11cb0af73baf819e545c41",
"output_checkpoint_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/checkpoints/heads_fastino_glide_28b"
}
},
{
"stage_id": "heads_fastino_glide_28b_drain",
"execution_mode": "weights_managed_compute",
"needs": ["heads_fastino_glide_28b"],
"workload": {
"kind": "classifier_drain",
"model": "fastino-glide-28b",
"open_stream": true,
"total_items": 0,
"reload_checkpoint_from_stage": "heads_fastino_glide_28b",
"output_prefix_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/results/heads_fastino_glide_28b_drain"
}
}
]
}'Response (201 Created):
{
"plan_id": "leadgen-jev-scavenge-experiments-20261102",
"operation_key": "leadgen-jev-scavenge-experiments-20261102",
"state": "waiting_price",
"stages": [
{
"stage_id": "heads_fastino_glide_28b",
"stream_id": "leadgen-jev-scavenge-experiments-20261102~heads_fastino_glide_28b",
"kind": "finetune",
"model": "fastino-glide-28b",
"objective": "specialist_heads",
"dataset_id": "ds_9c4a2fe8c05ca3c197027074",
"state": "waiting_price",
"needs": [],
"checkpoint_uri": null
},
{
"stage_id": "heads_fastino_glide_28b_drain",
"stream_id": "leadgen-jev-scavenge-experiments-20261102~heads_fastino_glide_28b_drain",
"kind": "classifier_drain",
"model": "fastino-glide-28b",
"reload_checkpoint_from_stage": "heads_fastino_glide_28b",
"state": "waiting_dependency",
"needs": ["heads_fastino_glide_28b"],
"checkpoint_uri": null
}
]
}History
- 2026-10-28: documented plan admission, replay and optional source checks.
- 2026-11-16: documented the queue model,
wake_policy, deadline outcomes,placement,tenancy.funding,priority_weight, window controls, seat budgets, strict unknown-field refusal and standalone standing fine-tunes. - 2026-11-19: added
notify, which pushes the plan's events to a webhook sink.