agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/replicate/SKILL.md

replicate

Skill13 starsChanged 27 days agoMITView on GitHub

  • Reads credentials
  • Installs packages

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We found no rules to list in this file: it reads as prose or reference rather than instructions.

Files
SKILL.md

Replicate API Skill

Overview

Replicate lets developers run open-source AI models in the cloud through a unified API. Run models for image generation (Flux, Stable Diffusion), video synthesis, voice, and multimodal reasoning.

Installation

npm install replicate
pip install replicate

Authentication & Setup

import Replicate from 'replicate';

const replicate = new Replicate({
  auth: process.env.REPLICATE_API_TOKEN,
});

Core API Operations

1. Run Image Generation Model (Flux.1 Schnell)

const output = await replicate.run(
  'black-forest-labs/flux-schnell',
  {
    input: {
      prompt: 'A futuristic cybernetic library with glowing neon data conduits',
      aspect_ratio: '16:9',
      num_outputs: 1,
    },
  }
);

console.log('Generated image URL:', output);

2. Asynchronous Prediction with Webhooks

const prediction = await replicate.predictions.create({
  model: 'black-forest-labs/flux-dev',
  input: {
    prompt: 'Hyper-realistic macro photography of a mechanical bumblebee',
  },
  webhook: 'https://api.myapp.com/api/webhooks/replicate',
  webhook_events_filter: ['completed'],
});

console.log('Prediction started:', prediction.id);

3. Stream Model Output

for await (const event of replicate.stream('meta/meta-llama-3-70b-instruct', {
  input: {
    prompt: 'Write a comprehensive guide to database indexing.',
  },
})) {
  process.stdout.write(event.toString());
}

AI Pitfalls & Anti-Hallucination Guidelines

  • Temporary Asset URLs: Output image/video URLs returned by Replicate expire after a period of time. Always download and persist them in your own object store (S3, Cloudflare R2).
  • GPU Cold Boots: Handle cold start delays gracefully in UI with progress polling.

Production Verification Checklist

  • Output assets transferred to private persistent object storage
  • Webhook signatures verified on completion callbacks
  • Client timeouts configured to allow for GPU allocation

Last Verified: 2026-07-03

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.