context to be initialized
(for authentication).
The following Chainlet wraps a deployed model with a Stub:
my_chainlet.py
- Input as JSON dict (like above) or pydantic model.
- Automatic parsing of the response into a pydantic model using the
output_modelargument. predict_async(recommended) orpredict_sync.- Streaming responses using
predict_async_streamwhich returns an async bytes iterator. - Customized with
RPCOptions.
Stubs or TrussChainlets
A stub calls a model that’s deployed and scaled separately from the chain. To instead deploy an existing Truss directory as part of the chain and call it from other chainlets, wrap it in aTrussChainlet. See Add an existing Truss model to a Chain.