Documentation
¶
Index ¶
- type Client
- type ClientCallback
- type ClientModel
- type PullCallbackFunc
- type Store
- func (s *Store) DeleteModel(ctx context.Context, name string) error
- func (s *Store) GetModel(ctx context.Context, name string) (*schema.Model, error)
- func (s *Store) ListModels(ctx context.Context) ([]*schema.Model, error)
- func (s *Store) Path() string
- func (s *Store) PullModel(ctx context.Context, url string, callback ClientCallback) (*schema.Model, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) GetDestPath ¶
GetDestPath returns the suggested destination path for a model URL without downloading.
func (*Client) GetModelSize ¶
GetModelSize returns the remote file size by making a HEAD request.
func (*Client) PullModel ¶
func (c *Client) PullModel(ctx context.Context, w io.Writer, url string, fn ClientCallback, additionalOpts ...client.RequestOpt) (destPath string, err error)
PullModel downloads a model from the given URL and returns the suggested destination path. Supports HuggingFace URLs with hf:// scheme and regular HTTP(S) URLs. If a callback is provided, it first makes a HEAD request and calls the callback with (filename, 0, total_size). If the callback returns an error, the download is aborted.
type ClientCallback ¶
type ClientModel ¶
type ClientModel struct {
// contains filtered or unexported fields
}
func NewClientModel ¶
func NewClientModel(w io.Writer, fn ClientCallback) *ClientModel
type PullCallbackFunc ¶
type Store ¶
Store manages a collection of GGUF models in a directory.
func (*Store) DeleteModel ¶
DeleteModel deletes a model from the store by name. It matches against the full relative path, filename, or model name. Returns ErrNotFound if the model doesn't exist.
func (*Store) GetModel ¶
GetModel returns a model by name. It matches against the full relative path or the filename (last element of the path). Returns ErrNotFound if not found.
func (*Store) ListModels ¶
ListModels scans the store directory for GGUF models and returns their metadata. Hidden files and directories are skipped. Invalid GGUF files are silently skipped.
func (*Store) PullModel ¶
func (s *Store) PullModel(ctx context.Context, url string, callback ClientCallback) (*schema.Model, error)
PullModel downloads a model from the given URL into the store and returns the loaded model. Supports HuggingFace URLs with hf:// scheme and regular HTTP(S) URLs. The callback receives progress updates during download.