executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
model-managementManage BentoML model stores, model references, framework save/load helpers, optional dependencies, and model troubleshooting for services and builds.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when an agent needs to save, inspect, package, load, import/export, or diagnose BentoML models. Keep service endpoint design in ../service-authoring/SKILL.md; keep Bento build/container packaging mechanics in ../packaging-and-containerization/SKILL.md; keep BentoCloud deployment in ../cli-and-cloud/SKILL.md.
BentoModel("name:version"), BentoModel("name:latest"), or HuggingFaceModel("org/model") as a Service class variable so BentoML can include/resolve it during build and deployment.bentoml.models.create(name) as a context manager for arbitrary model directories, or a framework helper such as bentoml.sklearn.save_model() when that framework helper is appropriate and installed.bentoml models list/get/export/import/delete or the Python equivalents under bentoml.models.bentoml.sklearn.load_model, bentoml.pytorch.load_model, etc.) only when the stored model's module matches that helper and its optional dependencies are present.name:version) and supports :latest resolution. bentoml.models.get(tag) returns a bentoml.Model; bentoml.models.list(name_or_none) returns stored model objects.bentoml.models.create(name) yields a model reference with path and path_of(...); write or copy model files inside that directory, then let the context manager flush and save on successful exit.bentoml.models.import_model() expects an exported BentoML model archive or folder.bentoml models list --output json before assuming the tag is wrong.Declare model dependencies at Service class scope, then load the framework object in __init__ or a method:
import bentoml
from bentoml.models import BentoModel
@bentoml.service
class IrisService:
model_ref = BentoModel("iris_sklearn:latest")
def __init__(self):
import joblib
self.model = joblib.load(self.model_ref.path_of("model.pkl"))
Class-scope declaration is important: BentoML records the model dependency for build, push, and deployment. Creating BentoModel(...) only inside __init__ can produce a Bento that starts without the referenced model and later fails with a model not found error.
For Hugging Face Hub models, use HuggingFaceModel("org/model") as a class variable and pass the resolved path to transformers loaders in __init__. Private or gated Hub models require the appropriate token in the runtime/build environment; do not bake secrets into skill content or service source.
bentoml models list or bentoml.models.list().bentoml models get MODEL_TAG, bentoml models get MODEL_TAG --output json, bentoml models get MODEL_TAG --output path, or bentoml.models.get("MODEL_TAG").bentoml models export MODEL_TAG OUT_PATH, bentoml models import MODEL_PATH, bentoml.models.export_model(tag, path), and bentoml.models.import_model(path).bentoml models delete MODEL_TAG --yes or bentoml.models.delete(tag). Deletion can fail if a local Bento references the model.bentoml models push MODEL_TAG and bentoml models pull MODEL_TAG require BentoCloud auth; keep deployment/cloud workflow in ../cli-and-cloud/SKILL.md.scripts/inspect_model_store.py lists model tags, modules, locations, metadata keys, context, and optional tag details. It is read-only.scripts/check_framework_extra.py checks whether a framework helper's Python modules are importable and warns about deprecated helper-module usage. It does not install packages or download models.references/model-store.md.references/frameworks.md.references/troubleshooting.md.