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.
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/replicateRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/ericrisco/rsc-harness /tmp/rsc-harness && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/rsc-harness/skills/replicate ~/.gemini/antigravity-cli/skills/replicateAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
