bentoml

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelYAMLFileName = "model.yaml"
)

Variables

This section is empty.

Functions

func CopyModelFile

func CopyModelFile(src, dst string) error

CopyModelFile copies a model file to a temporary location

func CreateArchiveWithProgress

func CreateArchiveWithProgress(srcDir, modelName, version string, progressWriter io.Writer) (string, error)

func DeleteModel

func DeleteModel(homePath, modelName, version string) error

DeleteModel deletes a model from BentoML store

func ExportModel

func ExportModel(homePath, modelName, version, outputPath string) error

ExportModel exports a model from BentoML store to a file

func FillMinimalModelYAML

func FillMinimalModelYAML(y *ModelYAML, name, version, hfRepo string, size int64) error

func GenerateVersion

func GenerateVersion() (*string, error)

GenerateVersion returns a 16‑char, lowercase base‑32 string identical to BentoML's default.

func GetModelPath

func GetModelPath(homePath, modelName, version string) (string, error)

GetModelPath returns the path where a model is stored in BentoML home

func ImportModel

func ImportModel(homePath string, reader io.Reader, name, version string, force bool, progress io.Writer) error

ImportModel imports a model from reader to BentoML store

Types

type Model

type Model struct {
	Tag          string `json:"tag"`
	Module       string `json:"module"`
	Size         string `json:"size"`
	CreationTime string `json:"creation_time"`
}

func ListModels

func ListModels(homePath string) ([]Model, error)

ListModels traverses $homePath/bentoml/models and aggregates model.yaml / model.json files. It is API‑compatible with the original CLI‑based ListModels but avoids forking Python.

type ModelMeta

type ModelMeta struct {
	Name         string `yaml:"name" json:"name"`
	Version      string `yaml:"version" json:"version"`
	Module       string `yaml:"module" json:"module"`
	Size         string `yaml:"size" json:"size"`
	CreationTime string `yaml:"creation_time" json:"creation_time"`
}

func GetModelDetail

func GetModelDetail(homePath, modelName, version string) (*ModelMeta, error)

GetModelDetail gets detailed information about a specific model

type ModelYAML

type ModelYAML struct {
	Name       string                 `yaml:"name"`
	Version    string                 `yaml:"version"`
	Module     string                 `yaml:"module"`
	Size       string                 `yaml:"size,omitempty"`
	APIVersion string                 `yaml:"api_version"`
	Signatures map[string]interface{} `yaml:"signatures"`
	Labels     map[string]string      `yaml:"labels"`
	Options    map[string]interface{} `yaml:"options"`
	Metadata   map[string]interface{} `yaml:"metadata"`
	Context    struct {
		FrameworkName    string            `yaml:"framework_name"`
		FrameworkVersion map[string]string `yaml:"framework_versions"`
		BentoVersion     string            `yaml:"bentoml_version"`
		PythonVersion    string            `yaml:"python_version"`
	} `yaml:"context"`
	CreationTime string `yaml:"creation_time"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL