Skip to content

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.

Terminal window
turion cog build . -t whisper-demo:latest
turion 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).

  1. Starts the image with docker run -d -P, adding --gpus all if nvidia-smi is on your PATH. On a machine without it, the container runs without GPUs.
  2. Waits for the Cog server’s /health-check to report READY. If setup() raises, it reports SETUP_FAILED and the command fails with the reason.
  3. Sends one prediction. @file inputs are inlined as data URIs; nothing is uploaded.
  4. 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.

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 predictturion run
Runs onyour machine (local Docker)your fleet, through Turion
Takesan image (whisper-demo:latest)a model ref (acme/whisper-demo:v1)
NeedsDocker (and an NVIDIA GPU for CUDA images)an API key; no Docker
File inputsinlined as data URIsuploaded to Turion storage
Lifecycleone container, one prediction, then removeda prediction you can list, get, cancel and read logs for
Needs a push firstnoyes (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.