Truss Python SDK
Truss Python SDK Reference
Python SDK Reference for Truss
truss.login
Authenticates with Baseten.
Parameters:
Name | Type | Description |
---|---|---|
api_key | str | Baseten API Key. |
truss.push
Pushes a Truss to Baseten.
Parameters:
Name | Type | Description |
---|---|---|
target_directory | str | Directory of Truss to push. |
remote | Optional[str] | The name of the remote in .trussrc to patch changes to. |
model_name | Optional[str] | The name of the model, if different from the one in the config.yaml. |
publish | bool | Push the truss as a published deployment. If no production deployment exists, promote the truss to production after deploy completes. |
promote | bool | Push the truss as a published deployment. Even if a production deployment exists, promote the truss to production after deploy completes. |
preserve_previous_production_deployment | bool | Preserve 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. |
trusted | bool | Give Truss access to secrets on remote host. |
deployment_name | Optional[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. |
- Return type: ModelDeployment
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 modelmodel_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