truss push but without a Python dependency. Use it from a service or CI pipeline that can’t run the Python Truss CLI, such as a Go or JavaScript backend. If you’re already working in Python, truss push is the simpler path.
Deploying over REST follows the same path each time:
- Prepare:
POST /v1/prepare_model_uploadvalidates the payload and returns temporary credentials scoped to an S3 location. - Upload: push your Truss archive to that location.
- Create:
POST /v1/modelscommits the upload as a new model.
Prepare the upload
Send a Truss config as a JSON object with a modelname. Add a weights block to load weights through the Baseten Delivery Network. Set dry_run to true to validate without issuing credentials. The response carries the upload credentials and the S3 location to upload to:
Upload the archive
Package your Truss as a gzipped tar archive, then upload it to the returneds3_bucket and s3_key using the temporary credentials:
upload.py
boto3 raises an exception if the temporary credentials have expired or the s3_key doesn’t match the one from the prepare step.
Create the model
Commit the upload withsource.kind set to model_archive, the same deployment payload you validated, and the s3_key from the prepare step. The response returns the created model and its first deployment:
BUILDING and isn’t ready when the call returns. Poll GET /v1/models/{model_id}/deployments/{deployment_id} until its status is ACTIVE:
Call the model
Once the deployment isACTIVE, send inference requests to the model’s predict endpoint, using the model id from the create response and your API key. The request and response shapes match whatever your model’s predict method accepts and returns:
Next steps
Call your model
Stream responses, send async requests, and use the other inference transports.
Add a deployment
Push a new deployment to the model you created.