Deploying Custom Generators

Deploying Custom Generators

This page covers how to deploy and check the status of your custom generators through the REST API. If you're not a developer, deploy your generator through the web interface.

Note that the Standard Generator is always set to deploy, so you don't need to deploy it yourself.

Once your generator is deployed, it will begin to consume deployment credits (5 minutes minimum) and you can use it to generate text.

Endpoints
GET 
/v1/models/:id
POST 
/v1/models/:id/deploy
POST 
/v1/models/:id/undeploy

The generator object

A custom generator. Currently only has a few attributes for indicating its deployment status.

Attributes
id
string

The generator's unique identifier. Can be retrieved by finding the generator in the app and then appending /api to its URL (or clicking "Get Your API Key"). It's different from the ID in the app URL.

name
string
The generator's name.
deploymentStage
enum

The generator's deployment state.

One of: Undeployed, Deploying, Deployed, Undeploying

undeployAt
timestamp (ISO 8601), nullable

A time at which to automatically undeploy the generator. Will be null when automatic undeployment is disabled or deploymentStage is Undeployed or Undeploying.

Used to cap usage of deployment hours in case the generator is erroneously left deployed.

The Generator Object
{
  "id": "e9172fea-bea9-4ad7-9e54-376fcbd6e689",
  "name": "novels",
  "deploymentStage": "Deployed",
  "undeployAt": "2021-01-03T21:10:00Z"
}

Retrieve a generator

Gets a generator's model object, for checking its deployment status.

Parameters

No parameters.

Returns

The generator object.

GET /v1/models/:id
$ curl https://api.inferkit.com/v1/models/e9172fea-bea9-4ad7-9e54-376fcbd6e689 \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "id": "e9172fea-bea9-4ad7-9e54-376fcbd6e689",
  "name": "novels",
  "deploymentStage": "Undeployed",
  "undeployAt": null
}

Deploy a generator

Deploys a custom generator so that it can be used to generate text.

Can be called in any deploymentStage. If the generator is already Deployed or Deploying, this will just update the undeployAt value of the existing deployment.

Parameters
undeployAt
timestamp (ISO 8601), nullable

A time at which to automatically undeploy your generator. Specify null to keep it deployed until you manually undeploy it.

Used to cap usage of deployment hours in case the generator is erroneously left deployed.

Even if using null, this parameter must be specified explicitly.

Returns

The updated generator object.

POST /v1/models/:id/deploy
$ curl https://api.inferkit.com/v1/models/e9172fea-bea9-4ad7-9e54-376fcbd6e689/deploy \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"undeployAt": "2021-01-03T21:10:00Z"}'
Response
{
  "id": "e9172fea-bea9-4ad7-9e54-376fcbd6e689",
  "name": "novels",
  "deploymentStage": "Deploying",
  "undeployAt": "2021-01-03T21:10:00Z"
}

Undeploy a generator

Undeploys a custom generator if it's deployed.

Can be called in any deploymentStage. Has no effect if the generator is already Undeployed or Undeploying.

Equivalent to deploying a generator with an undeployAt in the past.

Parameters

No parameters.

Returns

The updated generator object.

POST /v1/models/:id/undeploy
$ curl https://api.inferkit.com/v1/models/e9172fea-bea9-4ad7-9e54-376fcbd6e689/undeploy \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "id": "e9172fea-bea9-4ad7-9e54-376fcbd6e689",
  "name": "novels",
  "deploymentStage": "Undeploying",
  "undeployAt": null
}