A quickstart guide for model deployment.
You'll need to do two things before deploying a model:
This is a quickstart guide, so let's work with a simple model: an sklearn Iris classifier. But the following steps will work for any model built with Hugging Face, LightGBM, MLflow, PyTorch, scikit-learn, Tensorflow, or XGBoost.
Sample model training code:
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris
iris = load_iris()
data_x = iris['data']
data_y = iris['target']
model = RandomForestClassifier()
Using your API key and the Baseten Python client, run the following code to deploy your model:
model_name="My wonderful model"
Once deployment is complete, you'll receive an email. Your model will be deployed as a draft, which you can invoke and test to make sure everything is working as expected.
Once you're happy with your deployed model, it's time to publish it to production. From the model's page in the Baseten UI, click on the three-dot menu next to "Draft" and select "Publish model version."
Your model will rebuild onto production infrastructure and you will receive an email when the process is complete.
Workspaces on the free Personal plan are limited to a single published model version. To increase the number of models for your workspace, upgrade to a paid Baseten plan.
Baseten offers over two dozen pre-trained models that can be deployed for free to your account to explore Baseten's features.