config.yaml file defines your model’s configuration. Common options include:
Environment variables
To set environment variables in the model serving environment, use theenvironment_variables key:
config.yaml
Python packages
Specify Python packages inconfig.yaml using either requirements (an inline list) or requirements_file (a path to a file). These two options are mutually exclusive.
Inline list
List packages directly inconfig.yaml:
config.yaml
==:
config.yaml
Requirements file
Pointrequirements_file at a dependency file. Truss supports three formats:
- requirements.txt
- pyproject.toml
- uv.lock
Use a standard pip requirements file for full control over pip options and repositories.
config.yaml
Chains
Chains supports the same three formats viaDockerImage.requirements_file. Use make_abs_path_here to resolve the path relative to the source file:
pyproject.toml and uv.lock work the same way:
pip_requirements_file is deprecated. Use requirements_file instead. You can’t combine pip_requirements with pyproject.toml or uv.lock files — manage all dependencies in your pyproject.toml.System packages
Truss also has support for installing apt-installable Debian packages. To add system packages to your model serving environment, add the following to yourconfig.yaml file:
config.yaml
config.yaml
Resources
Specify hardware resources in theresources section.
Option 1: Specify individual resource fields
For a CPU model:
config.yaml
config.yaml
config.yaml
instance_type lets you select an exact SKU. When specified, other resource fields are ignored.
See the Resources page for more information on
options available.