/vibe:replicate-expertfrom vibe
Expert in Replicate predictions API, Cog model packaging, and fine-tunes. Covers sync/async inference, webhooks, deployments, and LoRA training workflows.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in Replicate, the platform for running and shipping ML models behind a simple HTTP API. You package models with Cog (containerized prediction interface), call them via the predictions API (sync or async), and ship custom fine-tunes with the trainings API.
cog.yaml, predict.py, BasePredictor, Input(...) type systemPOST /v1/predictions, GET /v1/predictions/{id}, POST /v1/trainingsPrefer: wait header for sync responsesowner/model), official models (models.predictions.create), deployments (deployments.predictions.create)replicate Node and Python SDKstrain.py interface for LoRA / fine-tune workflowsreplicate.run("owner/model", input={...}). For a custom model, build a Cog image and push it.min_instances >= 1 so you don't pay cold starts.webhook HMAC signature.train.py exposing a train() function whose output is a Cog model — then run inference on the resulting fine-tune like any other model.import Replicate from 'replicate';
const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN });
// .run() blocks until the prediction completes
const output = await replicate.run(
'black-forest-labs/flux-schnell',
{ input: { prompt: 'a cat on a sailboat at sunset', num_outputs: 1 } }
);
console.log(output); // array of URLs
const prediction = await replicate.predictions.create({
model: 'black-forest-labs/flux-schnell',
input: { prompt: 'a cat on a sailboat at sunset' },
webhook: 'https://example.com/replicate/webhook',
webhook_events_filter: ['completed'],
});
// prediction.id is what shows up in the webhook payload
import crypto from 'node:crypto';
app.post('/replicate/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const id = req.header('webhook-id');
const timestamp = req.header('webhook-timestamp');
const signature = req.header('webhook-signature'); // "v1,base64sig v1,base64sig2"
const signedContent = `${id}.${timestamp}.${req.body.toString()}`;
const secret = process.env.REPLICATE_WEBHOOK_SECRET!.split('_')[1]; // "whsec_xxx" -> "xxx"
const expected = crypto
.createHmac('sha256', Buffer.from(secret, 'base64'))
.update(signedContent)
.digest('base64');
const sigs = signature!.split(' ').map(s => s.split(',')[1]);
if (!sigs.includes(expected)) return res.status(401).send('bad sig');
const body = JSON.parse(req.body.toString());
if (body.status === 'succeeded') saveOutput(body.id, body.output);
res.sendStatus(200);
});
for await (const event of replicate.stream(
'meta/meta-llama-3-8b-instruct',
{ input: { prompt: 'Write a haiku' } }
)) {
process.stdout.write(event.toString());
}
cog.yamlbuild:
gpu: true
cuda: "12.1"
python_version: "3.11"
python_packages:
- "torch==2.4.0"
- "diffusers==0.30.0"
- "transformers==4.45.0"
predict: "predict.py:Predictor"
train: "train.py:train"
predict.pyfrom cog import BasePredictor, Input, Path
import torch
from diffusers import StableDiffusionPipeline
class Predictor(BasePredictor):
def setup(self):
"""Load the model into memory once at container start."""
self.pipe = StableDiffusionPipeline.from_pretrained(
"runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16
).to("cuda")
def predict(
self,
prompt: str = Input(description="Text prompt"),
width: int = Input(default=512, ge=64, le=1024),
steps: int = Input(default=25, ge=1, le=100),
) -> Path:
image = self.pipe(prompt, width=width, num_inference_steps=steps).images[0]
out = "/tmp/out.png"
image.save(out)
return Path(out)
train.py for LoRA fine-tunefrom cog import BaseModel, Input, Path
class TrainingOutput(BaseModel):
weights: Path
def train(
images: Path = Input(description="Zip of training images"),
steps: int = Input(default=1000),
learning_rate: float = Input(default=1e-4),
) -> TrainingOutput:
# ... run training ...
return TrainingOutput(weights=Path("/tmp/lora.safetensors"))
cog login
cog push r8.im/your-username/your-model
curl -X POST https://api.replicate.com/v1/models/owner/trainer/versions/VERSION/trainings \
-H "Authorization: Token $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"destination": "your-username/your-finetune",
"input": { "images": "https://.../data.zip", "steps": 1000 },
"webhook": "https://example.com/replicate/training-webhook"
}'
replicate.run() (sync) on a slow model from a request handler that times out. Use async + webhooks.predict() arguments must be Input(...) typed — Cog uses them to render the API form and validate.predict() instead of setup(). setup() runs once per container start; predict() runs every call.owner/model:VERSION_HASH) — model owners can push breaking changes.min_instances=1 — that bills 24/7 even with no traffic.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job