Skip to main content
The truss CLI is your primary interface for everything from packaging and deploying AI models to building and orchestrating multi-step chains to launching and managing training jobs. Use the following commands to manage your models, chains, and training jobs:
  • Models: Package and deploy individual model servers.
  • Chains: Build and deploy multi-step inference pipelines.
  • Training: Launch and manage training jobs.
To use Truss, install a recent Truss version and ensure pydantic is v2:
pip install --upgrade truss 'pydantic>=2.0.0'
Truss requires python >=3.8,<3.13. To set up a fresh development environment, you can use the following commands, creating a environment named truss_env using pyenv:
curl https://pyenv.run | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
pyenv install 3.11.0
ENV_NAME="truss_env"
pyenv virtualenv 3.11.0 $ENV_NAME
pyenv activate $ENV_NAME
pip install --upgrade truss 'pydantic>=2.0.0'
To deploy Truss remotely, you also need a Baseten account. It is handy to export your API key to the current shell session or permanently in your .bashrc:
~/.bashrc
export BASETEN_API_KEY="nPh8..."

CLI structure

The truss CLI organizes commands by workflow:
truss [OPTIONS] COMMAND [ARGS]...

Model commands

Use these commands to package, deploy, and iterate on individual models.
CommandDescription
truss loginAuthenticate with Baseten
truss initCreate a new Truss project
truss pushDeploy a model to Baseten
truss watchLive reload during development
truss predictCall the packaged model
truss model-logsFetch logs for the packaged model

Chain commands

Use these commands to build multi-model pipelines with shared dependencies.
CommandDescription
truss chains initInitialize a new Chain project
truss chains pushDeploy a Chain to Baseten
truss chains watchLive reload Chain development

Training commands

Use these commands to launch, monitor, and manage training jobs.
CommandDescription
truss train initInitialize a training project
truss train pushDeploy and run a training job
truss train logsStream logs from a training job
truss train viewList and inspect training jobs

Authentication

After installing Truss, authenticate with Baseten using either method: Option 1: Environment variable (recommended for CI/CD)
export BASETEN_API_KEY="YOUR_API_KEY"
Option 2: Interactive login
truss login
This opens a browser window to authenticate and stores your credentials locally.

Next steps