Integrations
Replicate
Run machine learning tasks easily at scale
Getting started
If you have not yet set up Trigger.dev in your project, go to the quick start guide.
Installation
To get started with the Replicate integration on Trigger.dev, you need to install the @trigger.dev/replicate
package.
You can do this using npm, pnpm, or yarn:
Authentication
To use the Replicate API with Trigger.dev, you have to provide an API Key.
API Key
You can create an API Key in your Account Settings.
Usage
Include the Replicate integration in your Trigger.dev job.
Pagination
You can paginate responses:
- Using the
getAll
helper - Using the
paginate
helper
Tasks
Collections
Function Name | Description |
---|---|
collections.get | Gets a collection. |
collections.list | Returns the first page of all collections. Use with pagination helper. |
Deployments
Function Name | Description |
---|---|
deployments.predictions.create | Creates a new prediction with a deployment. |
deployments.predictions.createAndAwait | Creates and waits for a new prediction with a deployment. |
Models
Function Name | Description |
---|---|
models.get | Gets a model. |
models.versions | Gets a model version. |
models.versions | Gets all model versions. |
Predictions
Function Name | Description |
---|---|
predictions.cancel | Cancels a prediction. |
predictions.create | Creates a prediction. |
predictions.createAndAwait | Creates and waits for a prediction. |
predictions.get | Gets a prediction. |
predictions.list | Returns the first page of all predictions. Use with pagination helper. |
Trainings
Function Name | Description |
---|---|
trainings.cancel | Cancels a training. |
trainings.create | Creates a training. |
trainings.createAndAwait | Creates and waits for a training. |
trainings.get | Gets a training. |
trainings.list | Returns the first page of all trainings. Use with pagination helper. |
Misc
Function Name | Description |
---|---|
getAll | Pagination helper that returns an array of results. |
paginate | Pagination helper that returns an async generator. |
request | Sends authenticated requests to the Replicate API. |
run | Creates and waits for a prediction. |
Example jobs
Code examples
Check out pre-built jobs using Replicate in our API section.
Was this page helpful?