Documentation
¶
Index ¶
- Variables
- func GetSupportedFormats() []types.Format
- type Client
- func (c *Client) DeleteModel(reference string, force bool) (*DeleteModelResponse, error)
- func (c *Client) GetBundle(ref string) (types.ModelBundle, error)
- func (c *Client) GetModel(reference string) (types.Model, error)
- func (c *Client) GetStorePath() string
- func (c *Client) IsModelInStore(reference string) (bool, error)
- func (c *Client) ListModels() ([]types.Model, error)
- func (c *Client) LoadModel(r io.Reader, progressWriter io.Writer) (string, error)
- func (c *Client) PullModel(ctx context.Context, reference string, progressWriter io.Writer) error
- func (c *Client) PushModel(ctx context.Context, tag string, progressWriter io.Writer) (err error)
- func (c *Client) ResetStore() error
- func (c *Client) Tag(source string, target string) error
- func (c *Client) WriteLightweightModel(mdl types.ModelArtifact, tags []string) error
- type DeleteModelAction
- type DeleteModelResponse
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidReference = registry.ErrInvalidReference ErrModelNotFound = store.ErrModelNotFound // model not found in store ErrUnsupportedMediaType = errors.New(fmt.Sprintf( "client supports only models of type %q and older - try upgrading", types.MediaTypeModelConfigV01, )) ErrUnsupportedFormat = errors.New("safetensors models are not currently supported - this runner only supports GGUF format models") ErrConflict = errors.New("resource conflict") )
Functions ¶
func GetSupportedFormats ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides model distribution functionality
func (*Client) DeleteModel ¶
func (c *Client) DeleteModel(reference string, force bool) (*DeleteModelResponse, error)
DeleteModel deletes a model
func (*Client) GetBundle ¶
func (c *Client) GetBundle(ref string) (types.ModelBundle, error)
GetBundle returns a types.Bundle containing the model, creating one as necessary
func (*Client) GetStorePath ¶
GetStorePath returns the root path where models are stored
func (*Client) IsModelInStore ¶
IsModelInStore checks if a model with the given reference is in the local store
func (*Client) ListModels ¶
ListModels returns all available models
func (*Client) ResetStore ¶
func (*Client) WriteLightweightModel ¶
func (c *Client) WriteLightweightModel(mdl types.ModelArtifact, tags []string) error
WriteLightweightModel writes a model to the store without transferring layer data. This is used for config-only modifications where the layer data hasn't changed. The layers must already exist in the store.
type DeleteModelAction ¶
type DeleteModelResponse ¶
type DeleteModelResponse []DeleteModelAction
type Option ¶
type Option func(*options)
Option represents an option for creating a new Client
func WithRegistryAuth ¶
WithRegistryAuth sets the registry authentication credentials
func WithStoreRootPath ¶
WithStoreRootPath sets the store root path
func WithTransport ¶
func WithTransport(transport http.RoundTripper) Option
WithTransport sets the HTTP transport to use when pulling and pushing models.
func WithUserAgent ¶
WithUserAgent sets the User-Agent header to use when pulling and pushing models.