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

Options

--target-directory
TEXT
A Truss directory. Defaults to current directory.
-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-deployment
TEXT
ID of the model deployment to invoke.
--model-version
TEXT
Deprecated: Use --model-deployment instead. ID of the model deployment to invoke.
--published
Invoke the published (production) deployment.
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!"}'