pip install baseten
. We recommend using the latest version of the Python client. To update your existing installation, run pip install --upgrade baseten
.baseten
moduleconfigure()
server_url
(str): The base URL of the servercreate_artifact()
deploy()
model
(an in-memory model object): A model object to be deployed (e.g. a RandomForestClassifier object).model_name
(str, optional): The name of the model to be created, if necessary.model_files
(List[str], optional): Additional files required for model definition, e.g class definitions for pytorch models.feature_names
(List[str], optional): The list of feature names. If not provided, a list of feature names that match the model's input dimensions will be automatically generated. If the model's input has multiple dimensions, feature_names should be a flattened list of names.class_labels
(List[str], optional): The list of target class labels, if applicable.version_bump
(str, optional): The version bump for this deployment, one of 'MAJOR', 'MINOR', 'PATCH'.deploy_custom()
model_name
(str): The name of the model to be created.model_class
(str): The name of the model class which implements load
and predict
methods, defined in one of the model_files
.model_files
(List[str]): A list of files — which must include the file containing model_class
— to include with the model deployment, including serialized models, python files, data, embeddings, etc. Files will match based on pathname patterns, eg *.py will match all python files in the current working directory.requirements_file
(str, optional): A requirements.txt file specifying requirements to be installed alongside the model.version_bump
(str, optional): The version bump for this deployment, one of 'MAJOR'
, 'MINOR'
, 'PATCH'
. Defaults to 'MINOR'
.deployed_artifact_id()
deployed_model_id()
deployed_model_version_id()
login()
api_key
(str): an API key on your account.models_summary()
artifact
objectmodel
objectdeployed_model_id()
or deployed_model_version_id()
, you get back an object that represents a deployed model on baseten. Let's run down the essential functions:install_requirements()
predict()