Local testing with turion cog predict
turion cog predict runs a Cog image once on your own machine, the quickest way to check an image
works before you push it. turion run is the remote equivalent, on your
fleet’s nodes.
turion cog build . -t whisper-demo:latestturion cog predict whisper-demo:latest -i audio=@sample.wav{ "text": "And so my fellow Americans…", "language": "en"}Inputs use the same syntax as turion run: key=value (string), key=@file (file), and
key:=json (raw JSON, e.g. temperature:=0.7).
What it does
Section titled “What it does”- Starts the image with
docker run -d -P, adding--gpus allifnvidia-smiis on yourPATH. On a machine without it, the container runs without GPUs. - Waits for the Cog server’s
/health-checkto reportREADY. Ifsetup()raises, it reportsSETUP_FAILEDand the command fails with the reason. - Sends one prediction.
@fileinputs are inlined as data URIs; nothing is uploaded. - Prints the output JSON and removes the container (
docker rm -f), whether the run succeeded or failed.
--timeout (default 600 seconds) covers the whole run, including model load. Raise it for
models that download weights in setup(), and keep in mind that on Turion setup() has
less time.
File outputs
Section titled “File outputs”If the model returns files (Cog encodes them as data: URIs locally), turion cog predict writes
them to your working directory as output.0.png, output.1.wav, … and prints the file paths in
place of the base64. See Files & outputs.
turion cog predict vs turion run
Section titled “turion cog predict vs turion run”turion cog predict | turion run | |
|---|---|---|
| Runs on | your machine (local Docker) | your fleet, through Turion |
| Takes | an image (whisper-demo:latest) | a model ref (acme/whisper-demo:v1) |
| Needs | Docker (and an NVIDIA GPU for CUDA images) | an API key; no Docker |
| File inputs | inlined as data URIs | uploaded to Turion storage |
| Lifecycle | one container, one prediction, then removed | a prediction you can list, get, cancel and read logs for |
| Needs a push first | no | yes (turion cog push or turion cog deploy) |
A CUDA image can pass turion cog predict on an older local GPU and still fail on a Blackwell
node (sm_120, such as the RTX PRO 6000) if its torch wheels lack sm_120 kernels; see
Cog on Turion.