Truss allows you to include custom modules or third-party packages not available on PyPi using two methods:Documentation Index
Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
Use this file to discover all available pages before exploring further.
- The
packagesdirectory: For bundling small, Truss-specific packages. - The
external_package_dirsconfiguration: For sharing packages across multiple Trusses.
1. Using the packages directory
Each Truss includes a packages/ directory where you can place Python modules to be included at build time.
Example directory structure:
model.py:
model.py
2. Using external_package_dirs
If multiple Trusses need access to the same external package, define external_package_dirs in config.yaml:
Note: Package here refers to an importable directory with Python source code.
Example directory structure:
config.yaml
model.py:
model.py