Developing a model
Data and storage
Load model weights without Hugging Face or S3
Model files, such as weights, can be large (often multiple GBs). Truss supports multiple ways to load them efficiently:
- Public Hugging Face models (default)
- Bundled directly in Truss
1. Bundling Model Weights in Truss
Store model files inside Truss using the data/
directory.
Example: Stable Diffusion 2.1 Truss structure
Access bundled files in model.py
:
Limitation: Large weights increase deployment size, making it slower. Consider cloud storage instead.
2. Loading Private Model Weights from S3
If using private S3 storage, first configure secure authentication.
Step 1: Define AWS Secrets in config.yaml
Do not store actual credentials here. Add them securely to Baseten secrets manager.