modelmetadata

package
v0.9.78 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirName      = "cache"
	DatabaseFile = "model-metadata.db"
)
View Source
const DerivationVersion = 2

DerivationVersion invalidates cached derivations when the logic that computes them changes rather than when the model files change. Fingerprint hashes file identity only, so an untouched model directory would otherwise keep a pipeline tag derived by an older build: a text-to-speech model cached as "text-generation" before DetectPipelineTag learned to recognise codec-token TTS models would stay misclassified after an upgrade. Bump this whenever DetectPipelineTag or any other cached derivation changes.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(modelDir string) (string, error)

Fingerprint hashes file identity metadata without reading model contents. Any add, remove, resize, or modification invalidates the cached derivations, as does a DerivationVersion bump.

Types

type Metadata

type Metadata struct {
	PipelineTag   string
	HasMMProj     bool
	ContextWindow int64
	MaxModelLen   int64
}

type Store

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

func Open

func Open(storageRoot string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Get

func (s *Store) Get(ctx context.Context, storageID, fingerprint string) (Metadata, bool, error)

func (*Store) Path

func (s *Store) Path() string

func (*Store) Put

func (s *Store) Put(ctx context.Context, storageID, fingerprint string, metadata Metadata) error

Jump to

Keyboard shortcuts

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