Salvare un modello nel Bento Store
Registri un artefatto del modello con BentoML.
Salvare un modello nel Bento Store è una lezione MLOps Academy gratuita su CoddyKit. Questa è la lezione 1 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento MLOps Academy, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso MLOps Academy include 4 lezioni in totale.
Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.
Meet BentoML
BentoML is a Python framework that packages and serves models with batching and scaling built in, so you skip a lot of boilerplate. 🚀
Install It
Getting started takes one command. You install bentoml from pip just like any other Python package.
pip install bentomlThe Bento Store
The Bento Store is a local registry on your machine. Every model you save lands there with a name and an automatic version tag.
Train Something First
You need a model before you can save one. Here you fit a simple scikit-learn classifier on some data.
from sklearn.svm import SVC
clf = SVC()
clf.fit(X, y)Save with the Framework API
BentoML ships a helper per framework. For scikit-learn you call bentoml.sklearn.save_model with a name and the fitted model.
import bentoml
bentoml.sklearn.save_model("iris_clf", clf)Names and Tags
Each save creates a tag like iris_clf:abc123. The name stays the same while the version after the colon changes every save.
Other Frameworks Too
The same pattern works everywhere. Swap the module to match your framework, like bentoml.pytorch or bentoml.xgboost.
bentoml.pytorch.save_model("net", model)List Your Models
You can see everything in the store from your terminal. The bentoml models list command shows names, tags, and sizes.
bentoml models listLoad It Back
To use a saved model you load it by tag. Passing latest grabs the newest version without hardcoding a hash.
model = bentoml.sklearn.load_model("iris_clf:latest")Attach Custom Metadata
You can stash extra info at save time. Adding metadata like accuracy travels with the model so teammates know what it is.
bentoml.sklearn.save_model("iris_clf", clf, metadata={"acc": 0.96})Clean Up Old Versions
The store can fill up over time. You prune anything you no longer need with the bentoml models delete command and a tag.
bentoml models delete iris_clf:abc123Quick Check
You just ran save_model twice for the same name. What identifies the two saves apart?
Recap
You installed BentoML, saved a model to the Bento Store with a framework helper, listed it, and loaded it back by tag. The model is now managed! 🙌
Domande Frequenti
La lezione «Salvare un modello nel Bento Store» è gratuita?
Sì — il testo completo di «Salvare un modello nel Bento Store» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso MLOps Academy, passa a CoddyKit PRO. Il corso MLOps Academy include 4 lezioni in totale.
Cosa imparerò in «Salvare un modello nel Bento Store»?
Registri un artefatto del modello con BentoML. Eserciti MLOps Academy con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.
Ho bisogno di esperienza per iniziare MLOps Academy?
Non è richiesta alcuna esperienza precedente. MLOps Academy su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 1 di 4.
Quanto tempo richiede la lezione «Salvare un modello nel Bento Store»?
La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.
Posso scrivere ed eseguire codice in questa lezione MLOps Academy?
Sì. Ogni lezione MLOps Academy include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.
Tutte le lezioni di questo corso
- Salvare un modello nel Bento Store
- Definire un servizio e la relativa API
- Abilitare il micro-batching adattivo
- Creare un Bento e containerizzarlo