Skip to main content

deployment

Manage deployments in your Modelbit workspace.

Parameters

modelbit deployment {action} [parameters]
  • {action}: Can be one of: create, restart, list-keep-warms, enable-keep-warm, disable-keep-warm.
  • --branch or -b: Optional[str] Sets the git branch for the command. If run from outside of a Modelbit git directory the default value is main. If run from within a Modelbit git directory then the current branch is used.

Additional parameters are documented within each action:

create

Creates a simple deployment (including a source.py, metadata.yaml, and requirements.txt) in the current Modelbit git repo.

Additional parameters

  • --name or -n: str Name of the deployment to create

Examples

Create a new deployment named example_deployment:

modelbit deployment create --name example_deployment

See also

restart

Deployments can be restarted to ensure their initialization code (e.g. imports and code outside the inference function) are re-executed.

Additional parameters

  • --name or -n: str Name of the deployment to restart
  • --version or -v: Optional[int|'latest'] The version to restart. The version can be the integer version of the deployment, or latest. If no version is specified then latest is used.

Examples

Restart the latest version of a deployment:

modelbit deployment restart --name example_deployment

Restart a specific version on a branch:

modelbit deployment restart --name example_deployment --version 5 --branch dev

See also

list-keep-warms

Prints a table showing which deployments have Keep Warm enabled.

Example

List all Keep Warm deployments on branch main:

modelbit deployment list-keep-warms --branch=main

See also

enable-keep-warm

Enable one or more warm instances for a deployment. Deployments already using Keep Warm will get their settings updated.

Additional parameters

  • --name, -n: str The name of the deployment to enable, or update, using Keep Warm
  • --version, -v: int The version of the deployment using Keep Warm
  • --count, -c: Optional[int] The number of warm instances to use. If unspecified, the default is 1.

Examples

Enable one Keep Warm instance for a deployment on branch foo:

modelbit deployment enable-keep-warm --name=my_deployment --version=20 --branch=foo

Enable 3 Keep Warm instances for a deployment on the current branch:

modelbit deployment enable-keep-warm --name=my_deployment --version=20 --count=3

See also

disable-keep-warm

Remove Keep Warm from a deployment.

Additional parameters

  • --name, -n: str The name of the deployment to stop using Keep Warm
  • --version, -v: int The version of the deployment to stop using Keep Warm

Examples

Stop using Keep Warm with a deployment:

modelbit deployment disable-keep-warm --name=my_deployment --version=20

See also