bundle

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModelSubdir is the subdirectory within a bundle where model files are stored
	ModelSubdir = "model"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	// contains filtered or unexported fields
}

Bundle represents a runtime bundle containing a model and runtime config

func Parse

func Parse(rootDir string) (*Bundle, error)

Parse returns the Bundle at the given rootDir

func Unpack

func Unpack(dir string, model types.Model) (*Bundle, error)

Unpack creates and return a Bundle by unpacking files and config from model into dir. It auto-detects the packaging version:

  • V0.2 (layer-per-file with annotations): Uses UnpackFromLayers for full path preservation
  • V0.1 (legacy): Uses the original unpacking logic based on GGUFPaths(), SafetensorsPaths(), etc.

func UnpackFromLayers added in v1.0.14

func UnpackFromLayers(dir string, model types.ModelArtifact) (*Bundle, error)

UnpackFromLayers unpacks a model that was packaged using the layer-per-file approach. Each file is stored as an individual layer with its filepath preserved in annotations. This is the approach used by builder.FromDirectory and preserves nested directory structure.

Unlike the standard Unpack function which uses model.GGUFPaths(), model.SafetensorsPaths(), etc., this function iterates directly over layers and uses their filepath annotations.

func (*Bundle) ChatTemplatePath

func (b *Bundle) ChatTemplatePath() string

ChatTemplatePath return the path to a Jinja chat template file or "" if none is present.

func (*Bundle) DDUFPath added in v1.0.12

func (b *Bundle) DDUFPath() string

DDUFPath returns the path to the DDUF file (Diffusers Unified Format) or "" if none is present.

func (*Bundle) GGUFPath

func (b *Bundle) GGUFPath() string

GGUFPath return the path to model GGUF file. If the model is sharded this will be the path to the first shard, containing metadata headers.

func (*Bundle) MMPROJPath

func (b *Bundle) MMPROJPath() string

MMPROJPath returns the path to a multi-modal projector file or "" if none is present.

func (*Bundle) RootDir

func (b *Bundle) RootDir() string

RootDir return the path to the bundle root directory

func (*Bundle) RuntimeConfig

func (b *Bundle) RuntimeConfig() types.ModelConfig

RuntimeConfig returns config that should be respected by the backend at runtime. Can return either Docker format (*types.Config) or ModelPack format (*modelpack.Model).

func (*Bundle) SafetensorsPath

func (b *Bundle) SafetensorsPath() string

SafetensorsPath returns the path to model safetensors file. If the model is sharded this will be the path to the first shard.

Jump to

Keyboard shortcuts

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