Documentation

Language models

Overview
View .mdOpenAPI

How it works

Status. Reviewed against this build on 2026-11-16, with the page classifier's start times measured on 2026-10-08 and in the readiness run of 2026-10-09; What is live says what this service has switched on.

A model needs hardware that costs money for every second it is switched on, busy or not. weights.fyi takes that off your hands: a model is started when your work arrives and stopped when there is nothing left to do, and you pay for your work, per page or per token, never for the time it runs. You see models, your calls, jobs and plans, their results and a price per unit; you never see the hardware.

Page classification is available. Fine-tuning is switched on for this service. No LLM chat model is available on this service yet.

Three ways in

You want toYou sendStart with
Chat with a language modelOpenAI-shaped calls to https://weights.fyi/run/v1/proxy, whose first chat call creates and starts your workspace endpoint, or to https://weights.fyi/run/v1 with an endpoint you manageLLM endpoints
Label pages, or train your own labellerPages for laya-page-role, in one call or a batch job of any size; labelled pages for a training jobClassify pages, Fine-tune a model
Queue larger workA ComputePlan: stages with dependencies, a time window and a budget, fed by streams of packs that point at your data where it already isQueued work, Python SDK, POST /v1/compute/plans

Waiting for a start

A model is not always ready. The first work of a quiet period waits for a start: for the page classifier, 2 min 12 s to 2 min 31 s in our measurements of 2026-10-08, and 160.4 s from first call to result in the readiness run. A classify call then answers 202 with Retry-After. A chat call does not hold open: it wakes the model and answers at once, 429 overloaded with Retry-After, or 503 model_not_ready on an endpoint you manage that was stopped; send it again after the wait. typical_ready_seconds in GET /v1/models says how long to allow. The start costs nothing.

A model sometimes moves to new hardware. Your work is held and carries on without a page lost or answered twice (Jobs, progress and results).

Queued work

Drop work in the queue now; it runs when capacity for its model is ready. A ComputePlan is admitted whole in one call and kept in a durable queue. Queueing costs nothing and starts nothing by itself: a waiting plan spends none of its budget. It waits for capacity that is ready for its own model; a model still starting, or capacity serving another model, does not count.

You chooseWhat it means
wake_policy: "standard"The plan may start the model it needs, within max_hourly_usd_micros, and keeps it running while its work remains.
wake_policy: "scavenger_stream" or "piggyback"A standing plan. It never starts a model and never keeps one running: it waits at no cost until other work has its model ready, then runs beside that work. Promote it to let it start capacity itself.
until_msA deadline, not a queue horizon. Unfinished work fails there with hard_deadline_expired, unless incomplete: "ok" lets each stream settle over what it delivered: packs not started become expired_incomplete and the outcome reads incomplete_expired.
max_budget_usd_microsOne budget for the whole plan. The receipt's accounting tells apart what was charged, what is set aside for work in flight, and what is left.
qos_priority, priority_weightHow work shares one model's capacity when it is short: weight 4 for priority, 3 for interactive, 2 for standard, 1 for flex and the other standing tiers, or an explicit priority_weight from 1 to 16. All of it runs at the same time, heavier work holding more seats; nothing waits for another class to finish.
placement, tenancy.fundingWhether the plan may start capacity at all, and whether it runs on workers you enrolled yourself at no rental charge.
A plan or stage readsIt is waiting forCost while it waits
queuedDispatch by the service: it was submitted with lazy: true.Nothing
waiting_dependencyA stage it needs to complete.Nothing
waiting_priceIts window to open, a preferred low-cost hour, or an hourly price within its ceiling.Nothing
ready_to_wake, waiting_capacityCapacity that is ready for its model: nothing else holds it.Nothing
executingNothing: it runs.The work done, within the budget.

Check a plan first with a dry run, then read it or list what is queued. While its sessions run, one chat turn can be answered 429 campaign_concurrency_limited: a turn asked to wait, not the plan failing (Rate limits).

Plans wait their turn

A stream stage works through its packs as they are registered or made from the shards you declared. A stage that fails ends only the stages that depend on it; independent stages run on. Every plan, stage and pack keeps its state and receipt, and plan events can be followed from a saved cursor.

The pieces

  • A workspace and its keys. API tokens made on your panel, /app, each with scopes and, if you like, an expiry and a daily spend cap. Teammates share the workspace's endpoints, plans, usage and keys (Teams and workspaces).
  • Workspace billing. Prepaid credit, or monthly pay-as-you-go; the workspace shares one spending allowance across its team (Workspace billing).
  • Models. Every call names one: a language model from your workspace's catalog, laya-page-role (the Laya page classifier, which gives a page's text one of five labels with a probability for each), or your own trained version of it (Models and capabilities).
  • Jobs. Classification and training work is a job, job_ and 24 hexadecimal characters: a few pages in one call, or a batch of any size.
  • Plans, stages and packs. Queued work is a ComputePlan of stages; a stream stage works through packs. They are not jobs (how they differ).
  • Results, exactly once. Each page gets a sequence number in the order you sent it, and each number is answered once, whatever happens to the model. A stream pack's completion is recorded once, with its output receipt.
  • Runs. A run of the model lasts from the request to start it until it has stopped. A job lists the runs its charges landed in; a move costs it nothing.
  • Traces. Every step of every job is recorded as spans and events you can read, download or send to your own tools. They carry counts, times, identifiers and codes, not content: logging of inputs and outputs stays off until you turn it on (Tracing and exports).

Conventions

Answers are JSON, sent compact and shown indented here. Fields ending in usd_micros are micro-dollars: 1,000,000 is $1.00. Times are UTC, ISO 8601 with milliseconds; plan windows are Unix milliseconds. A refusal carries a short error code (Errors and limits); chat refusals are OpenAI-shaped. Examples keep the key in $WEIGHTS_API_KEY.