Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

replicate

Skill by ericrisco

Explains how to run, package, deploy and scale models on the Replicate platform from code. Covers blocking versus async predictions, deployments, Cog packaging, webhook signature checks and GPU spend. Image prompt work is handled by replicate-images.

  • Score 72
  • 686 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install replicate

Built from the published package, never by AI.

git clone --depth 1 https://github.com/ericrisco/rsc-harness /tmp/rsc-harness && mkdir -p ~/.claude/skills && cp -r /tmp/rsc-harness/skills/replicate ~/.claude/skills/replicate

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install replicate in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This agent skill covers how a model runs in production on the Replicate platform. It explains how to choose between replicate.run(), predictions polled in a loop, and predictions with webhooks. It also covers handling FileOutput objects, deployments with warm private endpoints and autoscaling limits, packaging custom models with Cog, verifying webhook signatures, and cost levers such as scale-to-zero and prediction deadlines.

The skill is written for developers who deploy or scale models on Replicate from Python or Node code. It pins the Python client to replicate 1.x to avoid the 2.0 alpha. Choices about image prompts and model families are out of scope and belong to replicate-images. A verify.sh script statically checks a generated Cog artifact directory without running Docker.

Written from the project's SKILL.md and checked against it.

What it can do

  • Choose a run patternDecides between blocking run(), polled predictions and webhook-based predictions based on latency.
  • Handle file outputsReads FileOutput objects as bytes with .read() or as a hosted link with .url.
  • Long-running predictionsCreates predictions, polls status with backoff, sets deadlines and cancels stuck jobs.
  • Webhook verificationChecks the webhook-signature header with HMAC-SHA256 using the whsec_ secret before trusting a body.
  • DeploymentsSets up private endpoints with min_instances warm floors and max_instances spend caps.
  • Cog packagingBuilds a model container with cog.yaml and predict.py, loading weights once in setup().
  • Cost and scaling leversCovers scale-to-zero, deadlines, GPU right-sizing and caching weights in setup().

What you need

  • Replicate API token set as REPLICATE_API_TOKEN
  • Python 3.8 or later for the Python client
  • npm for the JavaScript client
  • Docker for building and running Cog containers

Try asking

  • Turn this blocking replicate.run call into a webhook-based prediction
  • Check my webhook handler for Replicate signature verification
  • Write a cog.yaml and predict.py for my PyTorch model

Good to know

  • Does not cover image prompt crafting or model family choice, which belong to replicate-images
  • Building Cog containers requires Docker
  • verify.sh checks files statically and does not run Docker

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/replicate/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to replicate

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

replicate: common questions

Should I use replicate.run() for long jobs?

No. The skill advises against blocking run() for jobs over a few seconds, because timeouts leave the GPU job running and billing. Use predictions with a webhook instead.

Why pin replicate to version 1?

The skill says 2.0.0aN is an alpha on PyPI and is not the default. Pinning replicate>=1,<2 keeps a fresh install from pulling the alpha.

Where should model weights be loaded in Cog?

Weights should be loaded in setup(), which runs once per instance, not in predict(), which runs on every request.

How do I install replicate?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is replicate free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is replicate safe to use?

It scores 72 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to replicate?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

replicate Install

Add to stack

Loading.