Autoscaling replicas
A replica is one copy of a model version loaded on a GPU node and ready to serve. Turion decides how many replicas each version should have, and the nodes start and stop containers to match. Four settings on the version control it:
| Setting | Default | Meaning |
|---|---|---|
min_replicas | 0 (scale to zero) | replicas kept warm with no traffic |
max_replicas | 1 | the most warm replicas at once (up to 100) |
keep_alive_s | 60, or 300 for a fine-tune | seconds a node keeps an idle container before stopping it (0–86400) |
vram_footprint_mb | null (unknown) | VRAM one replica needs |
Fine-tunes get these from turion deploy: --min-replicas,
--max-replicas and --keep-alive. A fine-tune of a catalog base gets its footprint from the
base’s serving memory (serve_vram_gb in turion bases --json); a fine-tune of an hf: base has
none.
To change them on any version, use turion model set. It sends only the flags you pass:
turion model set acme/support-v3 --min-replicas 1 --max-replicas 4 --keep-alive 600The SDK equivalent is client.models.update_version(slug, version, min_replicas=…, …), and the
REST call is PATCH /v1/models/{slug}/versions/{version}. vram_footprint_mb can only be set
over REST:
curl -X PATCH https://api.turion.ai/v1/models/acme/whisper-demo/versions/v1 \ -H "Authorization: Bearer tk_…" -H "Content-Type: application/json" \ -d '{"min_replicas": 1, "max_replicas": 4, "keep_alive_s": 300, "vram_footprint_mb": 16384}'An omitted field is left alone. "vram_footprint_mb": null clears the footprint back to unknown.
A Cog version can also set these when it is published, on POST /v1/model-versions.
Serverless and dedicated
Section titled “Serverless and dedicated”- Serverless (the default).
min_replicas: 0. Nothing runs while the version is idle, and the first request after an idle period pays a cold start. The replica it starts is billed for its loading time, asrunseconds on that request, and then as slot GPU-seconds from the moment it has loaded untilkeep_alive_sruns out after the last request; the requests it serves are not billed again. See the worked example. - Dedicated.
min_replicas: 1or more. A replica stays loaded whether or not it is used, so there is no cold start, and it is billed as slot GPU-seconds around the clock, idle or not. Use it for latency-sensitive traffic.
Every replica is billed the same way, so a version scaled out to three replicas records three replicas’ slot time.
Either mode can also carry a cold_start_target_s: a version whose measured cold start is slower
than the target is kept warm even with min_replicas: 0. See
Cold starts.
How scaling behaves
Section titled “How scaling behaves”Scaling follows sustained queue depth, not spikes. Turion counts the requests for your
version that have waited longer than about 30 seconds, adds the ones running, divides by the
version’s concurrency_limit, and clamps the
result between min_replicas and max_replicas. A burst that drains within a few seconds starts
nothing, and after a new replica is placed, further scale-up waits about a minute so one slow cold
start is not answered with a second replica.
A version with no concurrency_limit counts as one request per replica, so it reaches
max_replicas fastest. If your model serves several requests at once, set concurrency_limit so
the autoscaler does not over-provision it.
max_replicas wins over min_replicas. The ceiling is the outer clamp, and your account’s
replica quota caps it in turn: the effective ceiling is the lower of the two. A quota of 0 means
the account keeps no reserved warmth, so its models start cold. See
Usage & billing.
Warm replicas are best effort. A node that does not have the free VRAM for a replica skips it and keeps serving; nothing fails.
keep_alive_s only applies to containers nobody wants warm. A container that is one of the
version’s current warm replicas is kept regardless of keep_alive_s. The timer governs the rest,
which is how a min_replicas: 0 version drains to zero.
Declare vram_footprint_mb if models share GPUs. With a footprint set, a node is never given
more models than its GPU can hold. Turion keeps a headroom margin on every node, so declare the
footprint your model peaks at, not its average. A version with no footprint can be placed on any
node, which is fine when each node serves one model but unsafe when several share a GPU.
A node runs one model container at a time by default. On your own nodes, raise the agent’s
WORKER_MAX_SLOTS to let a node hold several; see
Join a node. Turion configures the shared pool’s nodes.