Deploy a Cog model
Turion runs models packaged with Cog, the open-source container format from
Replicate. If your model already runs with cog predict, it runs on Turion. The loop is
turion cog build, turion cog push, turion run, or turion cog deploy for the first two in
one command. Your image runs on GPU machines you own, enrolled in a
fleet; Turion gives it the registry, versions, queueing and the predictions
API.
A minimal Cog project
Section titled “A minimal Cog project”A Cog project is a directory with two files. Here is a Whisper transcription model:
build: gpu: true cuda: "12.4" python_version: "3.11" system_packages: - ffmpeg run: # Blackwell GPUs (sm_120) need cu128 torch — install it explicitly. # See "Cog on Turion" for why this exact incantation. - uv run pip install --break-system-packages --no-cache-dir torch==2.8.0 --index-url https://download.pytorch.org/whl/cu128 - uv run pip install --break-system-packages --no-cache-dir openai-whisperpredict: "predict.py:Predictor"from cog import BasePredictor, BaseModel, Input, Pathimport whisper
class Output(BaseModel): text: str language: str
class Predictor(BasePredictor): def setup(self): # Runs once per container — load weights here, not in predict(). self.model = whisper.load_model("small")
def predict(self, audio: Path = Input(description="Audio file")) -> Output: result = self.model.transcribe(str(audio)) return Output(text=result["text"].strip(), language=result["language"])Two Turion-specific rules before you build:
- Prediction output must be a JSON object (a
cog.BaseModelsubclass or adict), not a bare string or number. See Cog on Turion. - CUDA wheels must carry sm_120 kernels (cu128 torch, as above) when your nodes have Blackwell GPUs, such as the RTX PRO 6000, or predictions fail at runtime. See Cog on Turion for the full packaging notes.
turion cog build . -t whisper-demo:latest# built whisper-demo:latestturion cog build wraps cog build. You need Docker running, and a linux/amd64 host is much
faster for multi-GB CUDA images than emulation on Apple Silicon. The path must be a Cog project
directory containing cog.yaml. -t defaults to the directory name.
Set up a fleet
Section titled “Set up a fleet”An image you push is your own code, so it runs only on a fleet you own.
The shared turion pool runs Turion’s own runtimes only (fine-tunes, decision models and
Civitai imports); registering your image on a model there is refused
with 403 image_needs_own_fleet. Before the first push:
-
Create a fleet:
Terminal window turion fleet create lab# created acme/lab (private) id 0198c2f0-…# enroll a machine: turion fleet join-token lab -
Enroll a GPU machine (Linux with Docker and the NVIDIA Container Toolkit):
turion fleet join-token labprints the installer command to run on it. Join a node covers the checks and options. -
Pin the model to the fleet: pass
--fleet acme/labtoturion cog pushorturion cog deploy, as below. Later pushes to the same model need no flag.
turion cog push whisper-demo:latest --fleet acme/lab# pushed registry.turion.ai/acme/whisper-demo@sha256:4f59dd…# soci SOCI lazy-pull index published# model acme/whisper-demo@v1# run it: turion run acme/whisper-demo:v1 -i ...The soci line reports the lazy-pull index built for your image; see
Cold starts. Pass --no-soci to skip it; the push
works either way and the digest is unchanged.
One command does three things:
- Tags and pushes the image to
registry.turion.ai/<handle>/<name>:<tag>(runturion login --registry-loginfirst). - Creates the model
acme/whisper-demoif it doesn’t exist (--modeloverrides the name, which otherwise comes from the image name), pinned to--fleet; a model that exists is moved there. Without--fleet, a new model, or one on the shared pool, is refused withimage_needs_own_fleetbefore anything is pushed. - Registers a new version,
v1, thenv2,v3, … on each later push, with the Cog input/output schema read from the image.
Digest pinning
Section titled “Digest pinning”The registered image_uri is pinned to the pushed digest (…/whisper-demo@sha256:4f59dd…), not
the tag. A version always runs exactly the bytes you pushed: pushing latest again never changes
what v1 runs; it creates v2.
turion run acme/whisper-demo:v1 -i audio=@sample.wavOmit :v1 to run the latest version. turion run executes on your fleet’s nodes; to run an
image once on your own machine, without Turion, see Local testing with turion cog predict.
turion cog deploy: build, push and smoke test
Section titled “turion cog deploy: build, push and smoke test”From the project directory (turion deploy . does the same when the directory has a cog.yaml):
turion cog deploy . --fleet acme/lab --smoke-input audio=@sample.wav# deployed acme/whisper-demo@v1 (registry.turion.ai/acme/whisper-demo@sha256:…)# smoke prediction OK{ "text": "…", "language": "en" }--smoke-input (repeatable, same key=value / key=@file / key:=json syntax as -i) runs
one prediction against the new version so you know it works. --model, --registry, --tag
and --fleet mirror the build and push flags.
Concurrency and priority
Section titled “Concurrency and priority”Two optional scheduling settings live on a model version:
| Setting | Default | Meaning |
|---|---|---|
concurrency_limit | null (no limit) | roughly this many predictions of the version at once (not exact) |
priority | 0 (-1000–1000) | higher priority runs first; first in, first out within a priority |
Set them when you publish:
turion cog push whisper-demo:latest --concurrency 2 --priority 100turion cog deploy . --concurrency 2 --priority 100or on POST /v1/model-versions. Omitted settings keep their defaults.
Retune a published version with turion model set (the SDK’s client.models.update_version,
or PATCH /v1/models/{slug}/versions/{version} over REST):
turion model set acme/whisper-demo@v1 --concurrency 4 --priority 250An omitted field is left alone; "concurrency_limit": null removes the limit.
turion model get acme/whisper-demo prints each version with its settings.
What the knobs actually guarantee
Section titled “What the knobs actually guarantee”Priority orders waiting work: when a node is free, it takes the highest-priority request first, then the oldest. It never preempts: a prediction already running finishes, and priority does not move work between fleets.
The concurrency limit is a throttle, not an exact count. It is checked when a node picks up a prediction. Two nodes picking up at the same instant can both see room, so the real ceiling is
concurrency_limit + (simultaneous claimers − 1)a brief overshoot of one or two on a busy fleet, which drains as those runs finish. Use the limit as protection against too much parallelism (VRAM pressure, a rate-limited downstream API), not as an exact count.
Replica count, keep-alive and VRAM footprint are separate settings on the same version; see Autoscaling replicas.
Archive a version
Section titled “Archive a version”Versions are immutable, but you can take one out of service:
turion model archive acme/whisper-demo v1# archived acme/whisper-demo@v1An archived version no longer accepts predictions. Past predictions and their outputs are unaffected.