Skip to main content
truss predict [OPTIONS] [TARGET_DIRECTORY]
Calls the packaged model with the provided input data. Use this to test your model locally or remotely.

Options

-d, --data
TEXT
JSON string representing the request payload.
-f, --file
PATH
Path to a JSON file containing the request payload.
--remote
TEXT
Name of the remote in .trussrc to invoke.
--model
TEXT
ID of the model to invoke.
--model_version
TEXT
ID of the model version to invoke.
--published
Invoke the published (production) deployment.

Arguments

TARGET_DIRECTORY
TEXT
A Truss directory. Defaults to current directory.
Example: To call a model with inline JSON data, use the following:
truss predict -d '{"prompt": "What is the meaning of life?"}'
To call a model using a JSON file, use the following:
truss predict -f request.json
To call the production deployment, use the following:
truss predict --published -d '{"prompt": "Hello, world!"}'