Skip to content

Migrate from Replicate

turion migrate imports a model from Replicate: it reads the version’s metadata, tries to pull the exact image Replicate runs, and delivers it to --to: Turion, a private box over SSH, or a local directory for review.

Terminal window
turion migrate --from replicate:you/your-model --to turion --fleet acme/lab

Sources are replicate:owner/name (latest version) or replicate:owner/name:version-id to pin a specific version. --from cog:<path-or-image> also works for a local Cog project directory or an already-built Cog image. Other platforms, such as fal, are not supported.

When the target is Turion, turion host is the same pipeline with --to turion implied, and it takes the model page URL from your browser:

Terminal window
turion host https://replicate.com/you/your-model --fleet acme/lab
# hosted acme/your-model@v1 https://turion.ai/members/models/acme/your-model

It adds one thing migrate does not: it records where the model came from on the registered version (the workspace and GET /v1/models show the source and link back to it).

Use turion migrate for the other targets, --to ssh://user@host and --to ./dir, which never touch a Turion account. Everything below applies to both commands.

  • REPLICATE_API_TOKEN: an r8_… key, used to read the model’s metadata and to attempt the image pull. Required for every replicate: source.
  • Docker running, for the pull attempt and any build or push.
  • For --to turion: a Turion account, turion login, and a fleet of your own with a machine enrolled, passed as --fleet. The image is your own code, and the shared turion pool runs only Turion’s own runtimes. A directory target needs no Turion account.
  1. Metadata: fetches the model version from api.replicate.com (its id, Cog version, and OpenAPI input/output schema).
  2. Pull attempt: docker login r8.im with your Replicate token, then a digest-pinned pull of r8.im/owner/name@sha256:<version-id>, the exact image Replicate serves.
  3. Deliver: if the pull succeeds, the image goes to your target. With --to turion that is a push to the Turion registry plus a registered version, as with turion cog push:
Terminal window
turion migrate --from replicate:acme/whisper-demo --to turion --fleet acme/lab
# done: turion: acme/whisper-demo@v1 (registry.turion.ai/acme/whisper-demo@sha256:…)

When the pull is denied: the scaffold fallback

Section titled “When the pull is denied: the scaffold fallback”

Pulling from r8.im is not a documented Replicate feature: it usually works for models you own and is usually denied for models you do not. When the pull is denied, turion migrate does not fail; it scaffolds a Cog project from the version’s OpenAPI schema instead, under --workdir (default .turion-migrate/<name>):

  • schema.json: the version’s full input/output schema
  • predict.py: a Predictor stub with a typed predict() signature generated from the schema, defaults included; setup() and predict() raise NotImplementedError until you port the model
  • cog.yaml: a starting build config (GPU, Python 3.11)
  • MIGRATION.md: what was migrated, what is missing, and what to do next

The scaffold keeps the model’s interface; you supply the implementation and weights from the model’s source repository. A scaffold is not runnable, so --to turion refuses it with scaffold_only: implement predict() first, then turion cog build and turion cog push, or emit to a directory target and finish it there.

For models you do not own, you may not be entitled to the image or the weights, so do not try to work around a denied pull. Rebuild from the model’s source repository, get the weights through the channel its licence allows, and respect that licence wherever you serve the model. The generated MIGRATION.md repeats this.

A directory: write a reviewable copy without touching any account:

migrated/whisper-demo
turion migrate --from replicate:acme/whisper-demo --to ./migrated

For a pulled image you get IMAGE (the digest-pinned reference), schema.json and MIGRATION.md; for a scaffold you get the project files and MIGRATION.md.

A private box over SSH: load and serve the image on your own Docker host:

Terminal window
turion migrate --from replicate:acme/whisper-demo --to ssh://user@gpu-box
# done: http://gpu-box:5000

The SSH target needs a runnable image (not a scaffold). See Self-host on your own box for prerequisites, --port/--gpus, and how to call the server.

turion host always delivers to Turion, so use migrate for these two targets. All flags for both commands are in the CLI reference.