Documentation
¶
Index ¶
- Constants
- Variables
- type Index
- type IndexEntry
- type Layout
- type LocalStore
- func (s *LocalStore) AddTags(ref string, newTags []string) error
- func (s *LocalStore) BundleForModel(ref string) (types.ModelBundle, error)
- func (s *LocalStore) Delete(ref string) (string, []string, error)
- func (s *LocalStore) List() ([]IndexEntry, error)
- func (s *LocalStore) Read(reference string) (*Model, error)
- func (s *LocalStore) RemoveTags(tags []string) ([]string, error)
- func (s *LocalStore) Reset() error
- func (s *LocalStore) RootPath() string
- func (s *LocalStore) Version() string
- func (s *LocalStore) Write(mdl v1.Image, tags []string, w io.Writer) (err error)
- func (s *LocalStore) WriteBlob(diffID v1.Hash, r io.Reader) error
- func (s *LocalStore) WriteLightweight(mdl v1.Image, tags []string) (err error)
- func (s *LocalStore) WriteManifest(hash v1.Hash, raw []byte) error
- type Model
- func (m *Model) ChatTemplatePath() (string, error)
- func (m *Model) Config() (mdtypes.Config, error)
- func (m *Model) ConfigArchivePath() (string, error)
- func (m *Model) ConfigFile() (*v1.ConfigFile, error)
- func (m *Model) ConfigName() (v1.Hash, error)
- func (m *Model) Descriptor() (mdtypes.Descriptor, error)
- func (m *Model) Digest() (v1.Hash, error)
- func (m *Model) GGUFPaths() ([]string, error)
- func (m *Model) ID() (string, error)
- func (m *Model) LayerByDiffID(hash v1.Hash) (v1.Layer, error)
- func (m *Model) LayerByDigest(hash v1.Hash) (v1.Layer, error)
- func (m *Model) Layers() ([]v1.Layer, error)
- func (m *Model) MMPROJPath() (string, error)
- func (m *Model) Manifest() (*v1.Manifest, error)
- func (m *Model) MediaType() (types.MediaType, error)
- func (m *Model) RawConfigFile() ([]byte, error)
- func (m *Model) RawManifest() ([]byte, error)
- func (m *Model) SafetensorsPaths() ([]string, error)
- func (m *Model) Size() (int64, error)
- func (m *Model) Tags() []string
- type Options
Constants ¶
const (
// CurrentVersion is the current version of the store layout
CurrentVersion = "1.0.0"
)
Variables ¶
var ErrModelNotFound = errors.New("model not found")
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
Models []IndexEntry `json:"models"`
}
Index represents the index of all models in the store
func (Index) Add ¶
func (i Index) Add(entry IndexEntry) Index
type IndexEntry ¶
type IndexEntry struct {
// ID is the globally unique model identifier.
ID string `json:"id"`
// Tags are the list of tags associated with the model.
Tags []string `json:"tags"`
// Files are the files associated with the model.
Files []string `json:"files"`
}
IndexEntry represents a model with its metadata and tags
func (IndexEntry) HasTag ¶
func (e IndexEntry) HasTag(tag string) bool
func (IndexEntry) MatchesReference ¶
func (e IndexEntry) MatchesReference(reference string) bool
func (IndexEntry) Tag ¶
func (e IndexEntry) Tag(tag name.Tag) IndexEntry
func (IndexEntry) UnTag ¶
func (e IndexEntry) UnTag(tag name.Tag) IndexEntry
type Layout ¶
type Layout struct {
Version string `json:"version"`
}
Layout represents the layout information of the store
type LocalStore ¶
type LocalStore struct {
// contains filtered or unexported fields
}
LocalStore implements the Store interface for local storage
func (*LocalStore) AddTags ¶
func (s *LocalStore) AddTags(ref string, newTags []string) error
AddTags adds tags to an existing model
func (*LocalStore) BundleForModel ¶
func (s *LocalStore) BundleForModel(ref string) (types.ModelBundle, error)
BundleForModel returns a runtime bundle for the given model
func (*LocalStore) Delete ¶
func (s *LocalStore) Delete(ref string) (string, []string, error)
Delete deletes a model by reference
func (*LocalStore) List ¶
func (s *LocalStore) List() ([]IndexEntry, error)
List lists all models in the store
func (*LocalStore) Read ¶
func (s *LocalStore) Read(reference string) (*Model, error)
Read reads a model from the store by reference (either tag or ID)
func (*LocalStore) RemoveTags ¶
func (s *LocalStore) RemoveTags(tags []string) ([]string, error)
RemoveTags removes tags from models
func (*LocalStore) Reset ¶
func (s *LocalStore) Reset() error
Reset clears all contents of the store directory and reinitializes the store. It removes all files and subdirectories within the store's root path, but preserves the root directory itself. This allows the method to work correctly when the store directory is a mounted volume (e.g., in Docker Engine).
func (*LocalStore) RootPath ¶
func (s *LocalStore) RootPath() string
RootPath returns the root path of the store
func (*LocalStore) Version ¶
func (s *LocalStore) Version() string
Version returns the store version
func (*LocalStore) WriteBlob ¶
WriteBlob writes the blob to the store, reporting progress to the given channel. If the blob is already in the store, it is a no-op and the blob is not consumed from the reader.
func (*LocalStore) WriteLightweight ¶
func (s *LocalStore) WriteLightweight(mdl v1.Image, tags []string) (err error)
WriteLightweight writes only the manifest and config for a model, assuming layers already exist in the store. This is used for config-only modifications where the layer data hasn't changed.
func (*LocalStore) WriteManifest ¶
func (s *LocalStore) WriteManifest(hash v1.Hash, raw []byte) error
WriteManifest writes the model's manifest to the store
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) ChatTemplatePath ¶
func (*Model) ConfigArchivePath ¶
func (*Model) ConfigFile ¶
func (m *Model) ConfigFile() (*v1.ConfigFile, error)
func (*Model) Descriptor ¶
func (m *Model) Descriptor() (mdtypes.Descriptor, error)