truss.login

Authenticates with Baseten.

Parameters:

NameTypeDescription
api_keystrBaseten API Key.

truss.push

Pushes a Truss to Baseten.

Parameters:

NameTypeDescription
target_directorystrDirectory of Truss to push.
remoteOptional[str]The name of the remote in .trussrc to patch changes to.
model_nameOptional[str]The name of the model, if different from the one in the config.yaml.
publishboolPush the truss as a published deployment. If no production deployment exists, promote the truss to production after deploy completes.
promoteboolPush the truss as a published deployment. Even if a production deployment exists, promote the truss to production after deploy completes.
preserve_previous_production_deploymentboolPreserve the previous production deployment’s autoscaling setting. When not specified, the previous production deployment will be updated to allow it to scale to zero. Can only be use in combination with promote option.
trustedboolGive Truss access to secrets on remote host.
deployment_nameOptional[str]Name of the deployment created by the push. Can only be used in combination with publish or promote. Deployment name must only contain alphanumeric, ’.’, ’-’ or ’_’ characters.

class truss.api.definitions.ModelDeployment

Represents a deployed model. Not to be instantiated directly, but returned by truss.push.

Fields:

  • model_id: ID of the deployed model
  • model_deployment_id: ID of the model deployment

wait_for_active()

Waits for the deployment to be in an active. Returns True when complete, and raises if there is an error in deployment.

  • Return type: bool