config.yaml
.
Adding System Packages
Specify system dependencies undersystem_packages
:
config.yaml
Example: LayoutLM Document QA
LayoutLM Document QA is a model that requirestesseract-ocr
for text recognition. Below is a minimal setup for deploying it with Truss.
1. Initialize Truss
2. Implement the Model Class
Define the model in model/model.py:model/model.py
3. Set Dependencies
Add Python and system dependencies inconfig.yaml
:
config.yaml
TIP: Always pin exact package versions to avoid breaking changes.
4. Configure Model Resources
One of the Python dependencies,pytesseract
, also requires a system package to operate.
Adding system packages works just like adding Python requirements. You can specify any package that’s available via apt
on Debian.
config.yaml
5. Deploy and Invoke
config.yaml
You’ll need a Baseten API key for this step.