Replicate
Run official models, versions and deployments as predictions (waits for the job, downloads outputs), search and browse models (paid per run)
Beta v0.1.0 Node.js 16 actions
About
A Graphrt plugin for the Replicate HTTP API: run any model (official models, specific versions or your deployments) as a prediction, wait for it, and download the output files, browse and search models, versions and collections. Built with the declarative REST layer.
What it can do
- Run: run_model (official models, no version, e.g. black-forest-labs/flux-schnell), create_prediction (any model version), run_deployment (your deployments). They wait for the prediction (polling urls.get) and save output URLs into a folder. wait: false returns the prediction at once.
- Predictions: get_prediction, list_predictions, cancel_prediction
- Models: search (beta), list_models, get_model (with the latest version's input schema), list_model_versions, get_model_version, list_collections, get_collection, list_hardware
- Account: get_account
- api_request: any other endpoint, e.g. /v1/files (GET only when called by an agent)
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Get account
replicate.get_account - Search models
replicate.search - List models
replicate.list_models - Get model
replicate.get_model - List model versions
replicate.list_model_versions - Get model version
replicate.get_model_version - List collections
replicate.list_collections - Get collection
replicate.get_collection - List hardware
replicate.list_hardware - Run official model
replicate.run_model
Show all 16 actions
- Create prediction
replicate.create_prediction - Run deployment
replicate.run_deployment - Get prediction
replicate.get_prediction - List predictions
replicate.list_predictions - Cancel prediction
replicate.cancel_prediction - Replicate HTTP API request
replicate.api_request
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
REPLICATE_API_TOKENRequiredAPI token from <https://replicate.com/account/api-tokens> (sent as Authorization: Bearer) -
REPLICATE_OUTPUT_DIRFor filesAbsolute directory where output files are saved. Unset: nothing is downloaded and output keeps the URLs (they expire after about an hour) -
REPLICATE_EXTRA_DOWNLOAD_HOSTSOptionalComma-separated extra hosts output files may be downloaded from (exact host names), for models that return files elsewhere
How to use it
In Graphrt Desktop
- Open Plugins and search for Replicate.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install replicate workflow.yaml
- id: image
type: replicate.run_model
model_owner: black-forest-labs
model_name: flux-schnell
input: { prompt: "a watercolor fox in the snow", num_outputs: 1, output_format: png }
cancel_after: 2m
- id: answer
type: answer
answer: "Saved {{#image.data.saved_files.0.path#}}"