Deploying your Kaggle models to Baseten

đ Introduction
Hi yâall! Iâm Jesse Mostipak, a Developer Advocate here at Baseten. Before joining Baseten I was a Developer Advocate at RStudio, and before RStudio I had my first ever Developer Advocate role at Kaggle. And while there are about a million things Iâd love to talk with you all about, I wanted to focus my first blog post on Truss, an open source solution for model deployment, created here at Baseten.
Why a Kaggle notebook
I really like using Kaggle notebooks because they connect readily to Kaggle datasets, and then I can take advantage of GPU and TPU accelerators for my model training. I also really enjoy being able to see what other people have created, and then fork their notebooks and adapt them to my own projects. Â
And so when I started working with Truss, I wondered how easy it would be to use it to get a model from Kaggle and deploy it to the Baseten platform. It worked perfectly the first time I tried it, which made me so excited that I wanted to share it with everyone!Â
You can access the full notebook here, or follow along with the code and information below!
đ» Letâs code!
From within your Kaggle notebook, weâll start by adding Truss:
And then setting up our environment:
From there weâll load the iris dataset and train a Random Forest Classifier model:
And now for Truss! Truss works by serializing and packaging our model as a Docker image, and all you need is one line of code đ Weâll create a Truss like this:
đ Deploying our model from Kaggle to Baseten
While you can deploy your model to any service that uses Docker (such as Google Cloud Run or AWS ECS), weâre going to deploy to Baseten.Â
For this little adventure, youâll need:
- A Baseten account (sign up here!)
- Your API key, which you can generate here.
And you wonât need:
- Your wallet. Baseten allows all users to have one (1) free model and one (1) free application! Oh, did I not mention this? Baseten is also a platform where you can monitor your modelâs health, build or connect to data tables, and quickly and efficiently build entire web applications for your end users.Â

When you run the above code youâll see the output in your Kaggle notebook, similar to the image above. To see your model (and work with it on the Baseten platform) log in to Baseten, and click on Models. If you go to Baseten right away youâll likely see that your model is still being built, but within a few minutes it should be active, allowing you to call the model as well as start building out an application.
đ Learn more about Baseten + TrussÂ
If youâd like to learn more about Truss you can check out our Truss documentation here. And feel free to check out the Truss GitHub repo, where you can keep an eye on things by starring the repo, as well as file issues and provide feedback.
If youâd like to explore what to do with your model now that itâs been deployed to Baseten, follow along with our very own Philip Kiely as he walks you through building a starter application! And if youâre more of the âchoose your own adventureâ type, our Docs are a great way to get started, while our Gallery is the perfect place to find some inspiration.Â
â