builder

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder builds a model artifact

func FromGGUF

func FromGGUF(path string) (*Builder, error)

FromGGUF returns a *Builder that builds a model artifacts from a GGUF file

func FromModel

func FromModel(mdl types.ModelArtifact) (*Builder, error)

FromModel returns a *Builder that builds model artifacts from an existing model artifact

func FromSafetensors

func FromSafetensors(safetensorsPaths []string) (*Builder, error)

FromSafetensors returns a *Builder that builds model artifacts from safetensors files

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, target Target, pw io.Writer) error

Build finalizes the artifact and writes it to the given target, reporting progress to the given writer

func (*Builder) HasOnlyConfigChanges

func (b *Builder) HasOnlyConfigChanges() bool

HasOnlyConfigChanges returns true if the builder was created from an existing model and only configuration changes were made (no layers added or removed). This is useful for determining if lightweight repackaging optimizations can be used.

func (*Builder) Model

func (b *Builder) Model() types.ModelArtifact

Model returns the underlying model artifact

func (*Builder) WithChatTemplateFile

func (b *Builder) WithChatTemplateFile(path string) (*Builder, error)

WithChatTemplateFile adds a Jinja chat template file to the artifact which takes precedence over template from GGUF.

func (*Builder) WithConfigArchive

func (b *Builder) WithConfigArchive(path string) (*Builder, error)

WithConfigArchive adds a config archive (tar) file to the artifact

func (*Builder) WithContextSize

func (b *Builder) WithContextSize(size int32) *Builder

func (*Builder) WithDirTar

func (b *Builder) WithDirTar(path string) (*Builder, error)

WithDirTar adds a directory tar archive to the artifact. Multiple directory tar archives can be added by calling this method multiple times.

func (*Builder) WithLicense

func (b *Builder) WithLicense(path string) (*Builder, error)

WithLicense adds a license file to the artifact

func (*Builder) WithMultimodalProjector

func (b *Builder) WithMultimodalProjector(path string) (*Builder, error)

WithMultimodalProjector adds a Multimodal projector file to the artifact

type Target

type Target interface {
	Write(context.Context, types.ModelArtifact, io.Writer) error
}

Target represents a build target

Jump to

Keyboard shortcuts

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