Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Replicate

connector.replicate · connector.replicate_trigger · ai

Run models on Replicate, manage predictions, trainings, deployments and files, and react to finished predictions.

Vendor API documentation: https://replicate.com/docs/reference/http

Authentication

MethodCredential kindAuth kindFieldsTest request
API tokenreplicate/api_tokenbearertoken (secret)yes

Actions

Node type connector.replicate. Choose a resource and an operation; each operation has its own parameters.

Prediction

OperationIDEffectPaginatedCassette tests
Create a predictionprediction.createwrites4
Run a model and waitprediction.runwrites2
Get a predictionprediction.getreads1
Cancel a predictionprediction.cancelwrites1
List predictionsprediction.listreadsyes1

Create a prediction

Operation prediction.create. Starts a model run. With “Wait up to” set, Replicate holds the request open until the prediction finishes or the time runs out (max 60 s); otherwise the starting prediction is returned at once.

NameTypeDefaultRequiredShown whenDescription
targetoptions"model"Run. One of model, version, deployment.
modelresource_locatoryestarget = model, versionValues from lookup models.
versionresource_locatoryestarget = versionDepends on model. Values from lookup model_versions.
deploymentresource_locatoryestarget = deploymentValues from lookup deployments.
inputjsonyesThe model’s input object, for example {“prompt”: “a red fox”}.
wait_secondsnumber60Wait up to (seconds). 1 to 60. 0 returns immediately.
optionscollection
options.webhookstringWebhook URL. Replicate POSTs the prediction here as it progresses (use the Replicate trigger’s URL).
options.webhook_events_filtermulti_optionsWebhook events. One of start, output, logs, completed.
options.cancel_afterstringMaximum run time, for example 30s, 5m or 1h (minimum 5s).

Run a model and wait

Operation prediction.run. Creates a prediction and polls it until it succeeds, fails or is canceled, for runs longer than the 60-second synchronous window. Optionally downloads file outputs into binary fields.

NameTypeDefaultRequiredShown whenDescription
targetoptions"model"Run. One of model, version, deployment.
modelresource_locatoryestarget = model, versionValues from lookup models.
versionresource_locatoryestarget = versionDepends on model. Values from lookup model_versions.
deploymentresource_locatoryestarget = deploymentValues from lookup deployments.
inputjsonyes
poll_interval_secondsnumber2Poll every (seconds).
timeout_secondsnumber900Give up after (seconds).
cancel_on_timeoutbooleantrue
fail_on_errorbooleantrueFail the node when the prediction fails.
download_outputbooleanfalseDownload output files.
output_propertystring"data"download_output = trueOutput binary field prefix.

Get a prediction

Operation prediction.get.

NameTypeDefaultRequiredShown whenDescription
prediction_idresource_locatoryesPrediction. Values from lookup predictions.

Cancel a prediction

Operation prediction.cancel.

NameTypeDefaultRequiredShown whenDescription
prediction_idresource_locatoryesPrediction. Values from lookup predictions.

List predictions

Operation prediction.list. Newest first.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false
created_afterdatetime
created_beforedatetime
sourceoptionsCreated from. One of api, web.

Model

OperationIDEffectPaginatedCassette tests
Get a modelmodel.getreads1
Search modelsmodel.searchreads1
List public modelsmodel.listreadsyes1
List model versionsmodel.list_versionsreadsyes1
Get a model versionmodel.get_versionreads1

Get a model

Operation model.get.

NameTypeDefaultRequiredShown whenDescription
modelresource_locatoryesValues from lookup models.

Search models

Operation model.search.

NameTypeDefaultRequiredShown whenDescription
querystringyes
max_resultsnumber201 to 50.

List public models

Operation model.list.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false
sort_byoptions"latest_version_created_at"One of model_created_at, latest_version_created_at.
sort_directionoptions"desc"Direction. One of asc, desc.

List model versions

Operation model.list_versions.

NameTypeDefaultRequiredShown whenDescription
modelresource_locatoryesValues from lookup models.
return_allbooleanfalse
limitnumber50return_all = false

Get a model version

Operation model.get_version.

NameTypeDefaultRequiredShown whenDescription
modelresource_locatoryesValues from lookup models.
versionresource_locatoryesDepends on model. Values from lookup model_versions.

Collection

OperationIDEffectPaginatedCassette tests
List collectionscollection.listreadsyes1
Get a collectioncollection.getreads1

List collections

Operation collection.list.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false

Get a collection

Operation collection.get. Returns the collection with its models.

NameTypeDefaultRequiredShown whenDescription
collectionresource_locatoryesValues from lookup collections.

Deployment

OperationIDEffectPaginatedCassette tests
List deploymentsdeployment.listreadsyes1
Get a deploymentdeployment.getreads1

List deployments

Operation deployment.list.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false

Get a deployment

Operation deployment.get.

NameTypeDefaultRequiredShown whenDescription
deploymentresource_locatoryesValues from lookup deployments.

Training

OperationIDEffectPaginatedCassette tests
Create a trainingtraining.createwrites1
Get a trainingtraining.getreads1
List trainingstraining.listreadsyes1
Cancel a trainingtraining.cancelwrites1

Create a training

Operation training.create.

NameTypeDefaultRequiredShown whenDescription
modelresource_locatoryesValues from lookup models.
versionresource_locatoryesBase version. Depends on model. Values from lookup model_versions.
destinationstringyesDestination model.
inputjsonyesTraining input.
webhookstringWebhook URL.
webhook_events_filtermulti_optionsWebhook events. One of start, output, logs, completed.

Get a training

Operation training.get.

NameTypeDefaultRequiredShown whenDescription
training_idresource_locatoryesTraining. Values from lookup trainings.

List trainings

Operation training.list.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false

Cancel a training

Operation training.cancel.

NameTypeDefaultRequiredShown whenDescription
training_idresource_locatoryesTraining. Values from lookup trainings.

File

Files up to 100 MB that can be passed to model inputs by URL.

OperationIDEffectPaginatedCassette tests
Upload a filefile.uploadwrites1
List filesfile.listreadsyes1
Get a filefile.getreads1
Delete a filefile.deletewrites1

Upload a file

Operation file.upload.

NameTypeDefaultRequiredShown whenDescription
binary_propertybinary_property"data"yesInput binary field.
metadatajson

List files

Operation file.list.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false

Get a file

Operation file.get.

NameTypeDefaultRequiredShown whenDescription
file_idresource_locatoryesFile. Values from lookup files.

Delete a file

Operation file.delete.

NameTypeDefaultRequiredShown whenDescription
file_idresource_locatoryesFile. Values from lookup files.

Account

OperationIDEffectPaginatedCassette tests
Get the current accountaccount.getreads1

Get the current account

Operation account.get.

This node has no parameters.

Hardware

OperationIDEffectPaginatedCassette tests
List hardwarehardware.listreads1

List hardware

Operation hardware.list.

This node has no parameters.

Lookups

Lookups fill dropdowns and resource pickers in the editor from the vendor API.

LookupDepends onSearchDescription
modelsserver-side{{ item.model.description }}
model_versionsmodelclient-side
deploymentsclient-side
predictionsclient-side
trainingsclient-side
filesclient-side
collectionsclient-side{{ item.description }}

Triggers

Node type connector.replicate_trigger.

TriggerIDKindDeduplication keySignatureWebhook registrationCassette tests
On prediction finishedprediction_completedpoll{{ item.id }}:{{ item.status }}0
On prediction webhookprediction_webhookwebhookhmac_sha256automatic0

Trigger: On prediction finished

Polls recent predictions and emits each one once it has finished.

NameTypeDefaultRequiredShown whenDescription
statusesmulti_options["succeeded","failed","canceled"]One of succeeded, failed, canceled.
modelstringOnly this model.

Trigger: On prediction webhook

Receives prediction updates that Replicate sends to this trigger’s URL. Pass the URL as the Webhook URL when creating predictions. Signatures are verified with the account’s signing secret.

NameTypeDefaultRequiredShown whenDescription
eventsmulti_options["succeeded","failed","canceled"]Statuses to accept. One of starting, processing, succeeded, failed, canceled.

Import

No exported node type imports to this node.

Provenance

Written from the vendor’s documentation: