How to Build AI Applications with Replicate Agent Skills

Use the Replicate skill in VoltAgent to discover, compare, and invoke any model on the Replicate platform through high-level actions like listModels, runModel, and compareModels.

Building AI applications with Replicate agent skills lets you integrate thousands of open-source and commercial models without managing complex API infrastructure. The Replicate skill, listed in the VoltAgent awesome-agent-skills repository under Skills by Replicate, provides a unified interface for model discovery, execution, and comparison. This guide shows you how to build AI applications with Replicate agent skills using concrete code examples and the actual skill implementation.

What the Replicate Skill Provides

The Replicate skill exposes three core actions that agents can invoke directly. These actions abstract Replicate's REST API and handle authentication, request formatting, and response parsing automatically.

Core Actions

Action Purpose Key Parameters
listModels Retrieve catalog of public Replicate models filter (optional category filter)
runModel Execute a specific model with inputs model, version, input
compareModels Fetch metadata for multiple models models, criteria

The skill retrieves your Replicate API token from the agent's secret store, eliminating hardcoded credentials from your application code.

How to Build AI Applications with Replicate Agent Skills: Step-by-Step

Step 1: Discover Available Models

Before running any model, use listModels to explore what's available. This action returns model names, descriptions, versions, and required input fields.

// List all public Replicate models
const models = await YOUR_AGENT_INSTANCE.runSkill('replicate/listModels', {});

// Filter for image generation models only
const imageModels = await YOUR_AGENT_INSTANCE.runSkill('replicate/listModels', {
  filter: { category: 'image' },
});

The response includes metadata that helps you determine which model fits your use case.

Step 2: Run a Specific Model

Once you've identified a model, invoke it with runModel. The example below runs Stable Diffusion XL for text-to-image generation.

// Run Stable Diffusion with specific parameters
const result = await YOUR_AGENT_INSTANCE.runSkill('replicate/runModel', {
  model: 'stability-ai/sdxl',      // Replicate model slug
  version: '9c5f5d',              // Optional: pin to specific version
  input: {
    prompt: 'A futuristic cityscape at sunrise',
    width: 1024,
    height: 1024,
    num_outputs: 1,
  },
});

The model parameter uses Replicate's standard slug format (owner/name). The version hash is optional but recommended for reproducible outputs.

Step 3: Compare Models for Selection

When multiple models could solve your task, use compareModels to let your agent reason about the best choice.

// Compare two image models and rank by quality
const comparison = await YOUR_AGENT_INSTANCE.runSkill('replicate/compareModels', {
  models: [
    { slug: 'stability-ai/sdxl' },
    { slug: 'playgroundai/playground-v2' },
  ],
  criteria: 'image_quality',  // Guides agent's reasoning
});

This action fetches metadata for all specified models, enabling side-by-side evaluation before committing to a specific model run.

Step 4: Chain with Other Skills

A key advantage of building AI applications with Replicate agent skills is seamless integration with other capabilities. The example below chains image generation with Cloudflare KV storage.

// Generate image then store the result
const generationResult = await YOUR_AGENT_INSTANCE.runSkill('replicate/runModel', {
  model: 'stability-ai/sdxl',
  input: {
    prompt: 'Abstract neural network visualization',
    num_outputs: 1,
  },
});

// Store generated image URL in Cloudflare KV
await YOUR_AGENT_INSTANCE.runSkill('cloudflare/kv-put', {
  key: `image-${Date.now()}.png`,
  value: generationResult.output[0].url,
});

This pattern enables complete AI workflows without leaving the VoltAgent skill framework.

Source Files and Implementation Details

File Purpose Location
README.md Lists Replicate skill and links to official implementation README.md#L210-L211
replicate/replicate skill Contains listModels, runModel, compareModels implementations officialskills.sh/replicate/skills/replicate

The skill implementation handles:

  • Authentication: API token retrieval from agent secret store
  • Request formatting: JSON payload construction per Replicate API spec
  • Response parsing: Extraction of model outputs, URLs, and metadata
  • Error handling: Graceful failure modes for API errors or invalid parameters

Best Practices for Building AI Applications with Replicate Agent Skills

  1. Pin model versions when reproducibility matters. Omit version only when you want automatic updates to latest releases.

  2. Use listModels filters to reduce payload size and improve discovery performance for domain-specific applications.

  3. Implement retry logic at the workflow level for transient Replicate API failures, though the skill handles basic error propagation.

  4. Chain skills strategically to minimize data movement—process outputs directly within the agent environment before external storage.

Summary

  • The Replicate skill in VoltAgent provides listModels, runModel, and compareModels actions for integrating thousands of hosted AI models.
  • Build AI applications with Replicate agent skills by discovering models, running them with typed inputs, comparing alternatives, and chaining with other skills.
  • Authentication and API handling are abstracted—the skill retrieves tokens from the agent secret store and manages all HTTP interactions.
  • Source references: README.md#L210-L211 in VoltAgent/awesome-agent-skills and the official replicate/replicate skill implementation.

Frequently Asked Questions

How do I authenticate with Replicate when using the skill?

The skill automatically retrieves your Replicate API token from the agent's secret store. Configure this token once in your agent environment, and all Replicate skill actions will use it for authenticated requests. No credentials appear in your application code.

What models can I access through the Replicate skill?

You can access any public or private model hosted on the Replicate platform, including thousands of open-source models (Stable Diffusion, Llama, Whisper, etc.) and commercial offerings. Use listModels with category filters to discover models matching your use case.

How does the compareModels action work?

compareModels fetches metadata for multiple specified models—including capability descriptions, input schemas, and performance characteristics—then presents this information to your agent with a reasoning criterion (e.g., "image_quality"). The agent uses this data to select the optimal model before invocation.

Can I use Replicate skills alongside other VoltAgent capabilities?

Yes. Replicate skills chain seamlessly with other skills in the ecosystem. Common patterns include: generating images with Replicate then storing in Cloudflare KV, transcribing audio with Replicate Whisper then summarizing with a text model, or comparing Replicate models against other providers' offerings through unified skill interfaces.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →