Run Models
ReplicateOfficialPublished by Replicate
- Skill
- Tool integration
- Automation and integrations
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The run-models skill provides a structured approach to interacting with the Replicate API. It covers the lifecycle of AI model predictions, from fetching model metadata and schema validation to executing predictions, handling webhooks, and managing streaming outputs. The skill emphasizes best practices for input validation, concurrent execution, and file handling, ensuring reliable integration with both official and community-hosted models.
What it does
- Fetches model metadata and input/output schemas via the Replicate API
- Executes AI model predictions using the POST /v1/predictions endpoint
- Supports asynchronous polling, synchronous blocking requests, and webhook notifications
- Manages streaming responses for language models using Server-Sent Events
- Facilitates multi-model chaining by passing output URLs between prediction steps
- Provides guidance on validating inputs against model-specific schema constraints
When to use it
- When you need to programmatically trigger AI models hosted on Replicate
- When building pipelines that chain multiple AI models together
- When you need to handle model outputs via webhooks or streaming
- When you need to validate input parameters against specific model schemas before execution
Advantages
- Standardizes the process for interacting with diverse AI models
- Supports flexible output retrieval methods including webhooks and streaming
- Enables efficient parallel execution of multiple model predictions
- Provides clear patterns for chaining models in complex workflows
Usage examples
- “Run the latest version of the Llama 3 model on Replicate with a specific prompt.”
- The agent fetches the model schema, validates the input, creates a prediction, and returns the generated text output.
- “Chain an image generation model with an image upscaler.”
- The agent runs the first model, retrieves the output URL, and passes it as an input to the upscaling model.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/replicate/run-models/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip run-models.zip -d .agents/skills
Documentation by Replicate
Docs
Reference: https://replicate.com/docs/llms.txt
OpenAPI schema: https://api.replicate.com/openapi.json
MCP server: https://mcp.replicate.com
Per-model docs:
https://replicate.com/{owner}/{model}/llms.txtSet
Accept: text/markdownwhen requesting docs pages for Markdown responses.
Workflow
Choose the right model - Search with the API or ask the user.
Get model metadata - Fetch input and output schema via API.
Create prediction - POST to /v1/predictions.
Poll for results - GET prediction until status is "succeeded".
Return output - Usually URLs to generated content.
Three ways to get output
Create a prediction, store its id from the response, and poll until completion.
Set a
Prefer: waitheader when creating a prediction for a blocking synchronous response. Only recommended for very fast models. Max 60 seconds.Set an HTTPS webhook URL when creating a prediction, and Replicate will POST to that URL when the prediction completes.
Guidelines
Use the
POST /v1/predictionsendpoint, as it supports both official and community models.Every model has its own OpenAPI schema. Always fetch and check model schemas to make sure you're setting valid inputs. Even popular models change their schemas.
Validate input parameters against schema constraints (
minimum,maximum,enumvalues). Don't generate values that violate them.When unsure about a parameter value, use the model's default example or omit the optional parameter.
Don't set optional inputs unless you have a reason to. Stick to the required inputs and let the model's defaults do the work.
Use HTTPS URLs for file inputs whenever possible. You can also send base64-encoded files, but they should be avoided.
Fire off multiple predictions concurrently. Don't wait for one to finish before starting the next.
Output file URLs expire after 1 hour, so back them up if you need to keep them, using a service like Cloudflare R2.
Webhooks are a good mechanism for receiving and storing prediction output.
Predictions
A prediction goes through these states:
starting->processing->succeeded/failed/canceled.Official models use
owner/nameformat. Community models requireowner/name:version_id.The
POST /v1/predictionsendpoint handles both.
Webhooks
Set
webhookto an HTTPS URL when creating a prediction. Replicate POSTs the full prediction object when it completes.Filter events with
webhook_events_filter:start,output,logs,completed.Validate webhook signatures using the
Webhook-ID,Webhook-Timestamp, andWebhook-Signatureheaders. Get the signing secret fromGET /v1/webhooks/default/secret.
Prediction lifetime
Set
lifetimeto auto-cancel predictions that run too long (e.g.30s,5m,1h). Measured from creation time.
Streaming
Language models that support streaming include a
streamURL in the response. Use SSE to receive incremental output.
File handling
Prefer HTTPS URLs for file inputs. Output URLs from one prediction can be passed directly as file inputs to the next model.
Output file URLs expire after 1 hour. Download and store them immediately if you need to keep them.
Multi-model workflows
Chain models by passing output URLs as file inputs to the next model.
Start all independent predictions in parallel, then collect results.
Output URLs are valid for 1 hour, which is enough for pipeline steps.
Files
- ATTRIBUTION.mdAdded by AutoGineer850 B
- LICENSELicence file added by AutoGineer10.5 KiB
- SKILL.md3.5 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Replicate
- Publisher
- Replicate (Official)
- Source
- replicate/skills · skills/run-models · commit 2f36e41
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Replicate.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download run-models.zip