Use code-first development tools to streamline model production.
yaml
configuration filetruss init
functionality with a new flag to create the directory structure:
baseten.ModelBase
, which will serve as the entrypoint when invoking /predict
predict
method with type hintspush
(as well as all other commands below) will require that you pass the path to the file containing the model as the final argument.
This new workflow also supports patching, so you can quickly iterate during development without building new images every time.
remote_config
class variable within the model:
DeploymentContext
object as an optional final argument to the __init__
-method of a Model. This allows you to use secrets within your Model, but note that they’ll also need to be added to the assets
.
We only expose secrets to the model that were explicitly requested in assets
to comply with best security practices.
my_model.py
as follows:
config.yaml
. If you’re excited about this new development experience but need a specific feature ported over, please reach out to us!preprocess
or postprocess
hooks. We typically recommend inlining functionality from those functions if easy, or utilizing chains
if the needs are more complex.