Skip to content

Self-host on your own box

turion migrate --to ssh://[user@]host puts a Cog model on a machine you control: a lab box, an on-prem GPU server, a rented bare-metal host. No Turion account is involved; the model runs entirely on your hardware.

Terminal window
turion migrate --from cog:whisper-demo:latest --to ssh://ubuntu@gpu-box
# done: http://gpu-box:5000

One command, five steps, all over plain ssh and scp:

  1. docker save the image to a tarball locally
  2. scp it to the host
  3. docker load it there
  4. docker run -d --restart unless-stopped -p <port>:5000 (plus --gpus all when GPUs are on)
  5. Poll the Cog server’s /health-check until it reports READY, then print the URL

If setup fails inside the container you get setup_failed with the health output. If the server is not ready after about a minute you get timeout; the container keeps starting, so a model that loads slowly may still come up, and /health-check tells you when. The transfer tarball is removed from both machines either way. The container restarts with Docker (--restart unless-stopped), so the model survives a reboot of the box.

On your machine:

  • Docker, and the image present locally
  • non-interactive, key-based SSH access to the box (every step runs unattended)

On the box:

  • Docker, runnable by the SSH user
  • curl (used for the health poll)
  • For GPU serving: an NVIDIA driver and the NVIDIA Container Toolkit, so docker run --gpus all works

The SSH target needs a runnable image. Build the project first, then migrate the image:

Terminal window
turion cog build ./whisper-demo -t whisper-demo:latest
turion migrate --from cog:whisper-demo:latest --to ssh://ubuntu@gpu-box

A replicate: source works too when the image pull succeeds (see Migrate from Replicate), but a scaffold cannot be shipped over SSH (scaffold_only): implement and build it first.

FlagDefaultDescription
--port5000host port mapped to the Cog server’s port 5000
--gpus/--no-gpusprobeforce GPUs on or off; by default nvidia-smi -L is run over SSH and GPUs are used if it succeeds
Terminal window
turion migrate --from cog:whisper-demo:latest --to ssh://ubuntu@gpu-box --port 8080 --no-gpus
# done: http://gpu-box:8080

What runs on the box is a plain Cog HTTP server, the same one turion cog predict talks to locally. Call it directly:

Terminal window
curl -s http://gpu-box:5000/health-check
# {"status": "READY", …}
curl -s http://gpu-box:5000/predictions \
-X POST -H "Content-Type: application/json" \
-d '{"input": {"audio": "https://example.com/sample.wav"}}'
# {"status": "succeeded", "output": {"text": "…", "language": "en"}}

POST /predictions runs synchronously and returns the output JSON. This is the raw Cog server, with no authentication, no queue and one container. Keep it on a private network or behind a firewall or VPN rather than exposing the port to the internet.

ssh:// is for a single box you manage yourself: you get a direct HTTP endpoint and you own uptime, scaling and access control. --to turion gives you the registry, versioning, auth and the prediction API, with the model running on machines you join to a fleet.