Replicate (Independent Publisher) (#2019)

* Add files via upload

* Add files via upload
This commit is contained in:
Troy Taylor 2022-10-11 21:54:55 -04:00 коммит произвёл GitHub
Родитель 6f481d7438
Коммит ec366a4db6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 996 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,946 @@
{
"swagger": "2.0",
"info": {
"title": "Replicate",
"description": "Use Replicate to run machine learning models in the cloud from your own code, without having to set up any servers. The community has published hundreds of open-source models that you can run, or you can run your own models.",
"version": "1.0",
"contact": {
"name": "Troy Taylor",
"url": "https://www.hitachisolutions.com",
"email": "ttaylor@hitachisolutions.com"
}
},
"host": "api.replicate.com",
"basePath": "/v1/",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/predictions": {
"get": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"previous": {
"type": "string",
"description": "The previous result link.",
"title": "Previous"
},
"next": {
"type": "string",
"description": "The next result link.",
"title": "Next"
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"version": {
"type": "string",
"description": "The version (or model).",
"title": "Version"
},
"urls": {
"type": "object",
"properties": {
"get": {
"type": "string",
"description": "The GET URL address.",
"title": "GET"
},
"cancel": {
"type": "string",
"description": "The Cancel URL address.",
"title": "Cancel"
}
},
"title": "URLs"
},
"created_at": {
"type": "string",
"description": "When created at.",
"title": "Created At"
},
"completed_at": {
"type": "string",
"description": "When completed at.",
"title": "Completed At"
},
"source": {
"type": "string",
"description": "The source.",
"title": "Source"
},
"status": {
"type": "string",
"description": "The status.",
"title": "Status"
}
}
},
"title": "Results"
}
}
}
}
},
"summary": "Get a list of predictions",
"description": "Retrieve a paginated list of predictions that you've created with your account. This includes predictions created from the API and the Replicate website.",
"operationId": "PredictionList",
"parameters": []
},
"post": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"version": {
"type": "string",
"description": "The version (or model).",
"title": "Version"
},
"urls": {
"type": "object",
"properties": {
"get": {
"type": "string",
"description": "The GET URL address.",
"title": "Get"
},
"cancel": {
"type": "string",
"description": "The Cancel URL address.",
"title": "Cancel"
}
},
"title": "URLs"
},
"created_at": {
"type": "string",
"description": "When created at.",
"title": "Created At"
},
"completed_at": {
"type": "string",
"description": "When completed at.",
"title": "Completed At"
},
"status": {
"type": "string",
"description": "The status.",
"title": "Status"
},
"input": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text.",
"title": "Text"
},
"prompt": {
"type": "string",
"description": "The prompt.",
"title": "Prompt"
},
"prompt_strength": {
"type": "string",
"description": "The prompt strength.",
"title": "Prompt Strength"
},
"width": {
"type": "integer",
"format": "int32",
"description": "The width.",
"title": "Width"
},
"height": {
"type": "integer",
"format": "int32",
"description": "The height.",
"title": "Height"
},
"scale": {
"type": "string",
"description": "The scale.",
"title": "Scale"
},
"num_outputs": {
"type": "integer",
"format": "int32",
"description": "The number of outputs.",
"title": "Number of Outputs"
},
"num_inference_steps": {
"type": "integer",
"format": "int32",
"description": "The number of inference steps.",
"title": "Number of Inference Steps"
},
"guidance_scale": {
"type": "string",
"description": "The guidance scale.",
"title": "Guidance Scale"
},
"seed": {
"type": "integer",
"format": "int32",
"description": "The seed number. Leave blank for random.",
"title": "Seed"
}
},
"title": "Input"
},
"output": {
"type": "string",
"description": "The output.",
"title": "Output"
},
"error": {
"type": "string",
"description": "The error.",
"title": "Error"
},
"logs": {
"type": "string",
"description": "The logs.",
"title": "Logs"
}
}
}
}
},
"summary": "Create a prediction",
"description": "Creates a prediction based on a model and input.",
"operationId": "PredictionPost",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "The version (or model).",
"title": "Version"
},
"input": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text.",
"title": "Text"
},
"prompt": {
"type": "string",
"description": "The prompt.",
"title": "Prompt"
},
"prompt_strength": {
"type": "string",
"description": "The prompt strength.",
"title": "Prompt Strength"
},
"width": {
"type": "integer",
"format": "int32",
"description": "The width.",
"title": "Width"
},
"height": {
"type": "integer",
"format": "int32",
"description": "The height.",
"title": "Height"
},
"scale": {
"type": "string",
"description": "The scale.",
"title": "Scale"
},
"num_outputs": {
"type": "integer",
"format": "int32",
"description": "The number of outputs.",
"title": "Number of Outputs"
},
"num_inference_steps": {
"type": "integer",
"format": "int32",
"description": "The number of inference steps.",
"title": "Number of Inference Steps"
},
"guidance_scale": {
"type": "string",
"description": "The guidance scale.",
"title": "Guidance Scale"
},
"seed": {
"type": "integer",
"format": "int32",
"description": "The seed number. Leave blank for random.",
"title": "Seed"
}
},
"title": "Input"
},
"webhook_completed": {
"type": "string",
"description": "The webhook to call when completed.",
"title": "Completed Webhook"
}
},
"required": [
"version"
]
}
}
]
}
},
"/predictions/{prediction_id}": {
"get": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"version": {
"type": "string",
"description": "The version (or model).",
"title": "Version"
},
"urls": {
"type": "object",
"properties": {
"get": {
"type": "string",
"description": "The GET URL address.",
"title": "Get"
},
"cancel": {
"type": "string",
"description": "The Cancel URL address.",
"title": "Cancel"
}
},
"title": "URLs"
},
"created_at": {
"type": "string",
"description": "When created at.",
"title": "Created At"
},
"completed_at": {
"type": "string",
"description": "When completed at.",
"title": "Completed At"
},
"status": {
"type": "string",
"description": "The status.",
"title": "Status"
},
"input": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text.",
"title": "Text"
},
"prompt": {
"type": "string",
"description": "The prompt.",
"title": "Prompt"
},
"prompt_strength": {
"type": "string",
"description": "The prompt strength.",
"title": "Prompt Strength"
},
"width": {
"type": "integer",
"format": "int32",
"description": "The width.",
"title": "Width"
},
"height": {
"type": "integer",
"format": "int32",
"description": "The height.",
"title": "Height"
},
"scale": {
"type": "string",
"description": "The scale.",
"title": "Scale"
},
"num_outputs": {
"type": "integer",
"format": "int32",
"description": "The number of outputs.",
"title": "Number of Outputs"
},
"num_inference_steps": {
"type": "integer",
"format": "int32",
"description": "The number of inference steps.",
"title": "Number of Inference Steps"
},
"guidance_scale": {
"type": "string",
"description": "The guidance scale.",
"title": "Guidance Scale"
},
"seed": {
"type": "integer",
"format": "int32",
"description": "The seed number. Leave blank for random.",
"title": "Seed"
}
},
"title": "Input"
},
"output": {
"type": "array",
"items": {
"type": "string"
},
"title": "Output"
},
"error": {
"type": "string",
"description": "The error.",
"title": "Error"
},
"logs": {
"type": "string",
"description": "The logs.",
"title": "Logs"
},
"metrics": {
"type": "object",
"properties": {
"predict_time": {
"type": "number",
"format": "float",
"description": "The predict time.",
"title": "Predict Time"
}
},
"title": "Metrics"
}
}
}
}
},
"summary": "Get a prediction",
"description": "Retrieve a started prediction.",
"operationId": "PredictionGet",
"parameters": [
{
"name": "prediction_id",
"in": "path",
"x-ms-summary": "Prediction ID",
"x-ms-url-encoding": "single",
"description": "The prediction identifier.",
"required": true,
"type": "string",
"x-ms-dynamic-values": {
"operationId": "PredictionList",
"value-path": "id",
"value-collection": "results",
"value-title": "id"
}
}
]
}
},
"/predictions/{prediction_id}/cancel": {
"post": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"version": {
"type": "string",
"description": "The version (or model).",
"title": "Version"
},
"urls": {
"type": "object",
"properties": {
"get": {
"type": "string",
"description": "The GET URL address.",
"title": "Get"
},
"cancel": {
"type": "string",
"description": "The Cancel URL address.",
"title": "Cancel"
}
},
"title": "URLs"
},
"created_at": {
"type": "string",
"description": "When created at.",
"title": "Created At"
},
"completed_at": {
"type": "string",
"description": "When completed at.",
"title": "Completed At"
},
"status": {
"type": "string",
"description": "The status.",
"title": "Status"
},
"input": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text.",
"title": "Text"
},
"prompt": {
"type": "string",
"description": "The prompt.",
"title": "Prompt"
},
"prompt_strength": {
"type": "string",
"description": "The prompt strength.",
"title": "Prompt Strength"
},
"width": {
"type": "integer",
"format": "int32",
"description": "The width.",
"title": "Width"
},
"height": {
"type": "integer",
"format": "int32",
"description": "The height.",
"title": "Height"
},
"scale": {
"type": "string",
"description": "The scale.",
"title": "Scale"
},
"num_outputs": {
"type": "integer",
"format": "int32",
"description": "The number of outputs.",
"title": "Number of Outputs"
},
"num_inference_steps": {
"type": "integer",
"format": "int32",
"description": "The number of inference steps.",
"title": "Number of Inference Steps"
},
"guidance_scale": {
"type": "string",
"description": "The guidance scale.",
"title": "Guidance Scale"
},
"seed": {
"type": "integer",
"format": "int32",
"description": "The seed number. Leave blank for random.",
"title": "Seed"
}
},
"title": "Input"
},
"output": {
"type": "array",
"items": {
"type": "string"
},
"title": "Output"
},
"error": {
"type": "string",
"description": "The error.",
"title": "Error"
},
"logs": {
"type": "string",
"description": "The logs.",
"title": "Logs"
},
"metrics": {
"type": "object",
"properties": {
"predict_time": {
"type": "number",
"format": "float",
"description": "The predict time.",
"title": "Predict Time"
}
},
"title": "Metrics"
}
}
}
}
},
"summary": "Cancel a prediction",
"description": "Cancel a started prediction.",
"operationId": "PredictionCancel",
"parameters": [
{
"name": "prediction_id",
"in": "path",
"x-ms-summary": "Prediction ID",
"x-ms-url-encoding": "single",
"description": "The prediction identifier.",
"required": true,
"type": "string"
}
]
}
},
"/models/{model_owner}/{model_name}": {
"get": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The URL address.",
"title": "URL"
},
"owner": {
"type": "string",
"description": "The owner.",
"title": "Owner"
},
"name": {
"type": "string",
"description": "The name.",
"title": "Name"
},
"description": {
"type": "string",
"description": "The description.",
"title": "Description"
},
"visibility": {
"type": "string",
"description": "The visibility.",
"title": "Visibility"
},
"github_url": {
"type": "string",
"description": "The GitHub URL address.",
"title": "GitHub URL"
},
"paper_url": {
"type": "string",
"description": "The Paper URL address.",
"title": "Paper URL"
},
"license_url": {
"type": "string",
"description": "The license URL address.",
"title": "License URL"
},
"latest_version": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"created_at": {
"type": "string",
"description": "When created at.",
"title": "Created At"
},
"cog_version": {
"type": "string",
"description": "The Cog version.",
"title": "Cog Version"
},
"openapi_schema": {
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title.",
"title": "Title"
},
"version": {
"type": "string",
"description": "The version.",
"title": "Version"
}
},
"title": "Info"
},
"openapi": {
"type": "string",
"description": "The OpenAPI version.",
"title": "OpenAPI"
}
},
"title": "OpenAPI Schema"
}
},
"title": "Latest Version"
}
}
}
}
},
"summary": "Get a model",
"description": "Retrieve a model based on the owner and name.",
"operationId": "ModelGet",
"parameters": [
{
"name": "model_owner",
"in": "path",
"x-ms-summary": "Model Owner",
"x-ms-url-encoding": "single",
"description": "The model owner.",
"required": true,
"type": "string"
},
{
"name": "model_name",
"in": "path",
"x-ms-summary": "Model Name",
"x-ms-url-encoding": "single",
"description": "The model name.",
"required": true,
"type": "string"
}
]
}
},
"/collections/{collection_slug}": {
"get": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name.",
"title": "Name"
},
"slug": {
"type": "string",
"description": "The slug.",
"title": "Slug"
},
"description": {
"type": "string",
"description": "The description.",
"title": "Description"
},
"models": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The URL address.",
"title": "URL"
},
"owner": {
"type": "string",
"description": "The owner.",
"title": "Owner"
},
"name": {
"type": "string",
"description": "The name.",
"title": "Name"
},
"description": {
"type": "string",
"description": "The description.",
"title": "Description"
},
"visibility": {
"type": "string",
"description": "The visibility.",
"title": "Visibility"
},
"github_url": {
"type": "string",
"description": "The GitHub URL address.",
"title": "GitHub URL"
},
"paper_url": {
"type": "string",
"description": "The Paper URL address.",
"title": "Paper URL"
},
"license_url": {
"type": "string",
"description": "The license URL address.",
"title": "License URL"
},
"latest_version": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
},
"created_at": {
"type": "string",
"description": "When created at.",
"title": "Created At"
},
"cog_version": {
"type": "string",
"description": "The Cog version.",
"title": "Cog Version"
},
"openapi_schema": {
"type": "object",
"properties": {
"info": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title.",
"title": "Title"
},
"version": {
"type": "string",
"description": "The Version.",
"title": "Version"
}
},
"title": "Info"
},
"openapi": {
"type": "string",
"description": "The OpenAPI.",
"title": "OpenAPI"
}
},
"title": "OpenAPI Schema"
}
},
"title": "Latest Version"
}
}
},
"title": "Models"
}
}
}
}
},
"summary": "Get a collection of models",
"description": "Retrieves a list of models based on a collection slug.",
"operationId": "ModelList",
"parameters": [
{
"name": "collection_slug",
"in": "path",
"x-ms-summary": "Collection Slug",
"x-ms-url-encoding": "single",
"description": "The collection slug.",
"required": true,
"type": "string"
}
]
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {
"API Key": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
},
"security": [
{
"API Key": []
}
],
"tags": [],
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://replicate.com/"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://replicate.com/privacy"
},
{
"propertyName": "Categories",
"propertyValue": "AI;Lifestyle and Entertainment"
}
]
}

Просмотреть файл

@ -0,0 +1,23 @@
{
"properties": {
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"displayName": "Token (in the form 'Token YourAPIToken')",
"description": "The Token (in the form 'Token YourAPIToken') for this api",
"tooltip": "Provide your Token (in the form 'Token YourAPIToken')",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"iconBrandColor": "#da3b01",
"capabilities": [],
"publisher": "Troy Taylor",
"stackOwner": "Replicate"
}
}

Просмотреть файл

@ -0,0 +1,27 @@
# Replicate
Use Replicate to run machine learning models in the cloud from your own code, without having to set up any servers. The community has published hundreds of open-source models that you can run, or you can run your own models.
## Publisher: Troy Taylor, Hitachi Solutions
## Prerequisites
You will need to sign up for an account with [Replicate](https://replicate.com/).
## Obtaining Credentials
In your Replicate dashboard, select the Account tab to retrieve your API token.
## Supported Operations
### Get a list of predictions
Retrieve a paginated list of predictions that you've created with your account. This includes predictions created from the API and the Replicate website.
### Create a prediction
Creates a prediction based on a model and input.
### Get a prediction
Retrieve a started prediction.
### Cancel a prediction
Cancel a started prediction.
### Get a model
Retrieve a model based on the owner and name.
### Get a collection of models
Retrieves a list of models based on a collection slug.
## Known Issues and Limitations
There are no known issues at this time.