Documentation ¶
Index ¶
- Constants
- Variables
- func CopyModel(src, dest string) error
- func CopyModelHandler(c *gin.Context)
- func CreateManifest(name string, cfg *LayerReader, layers []*Layer) error
- func CreateModel(ctx context.Context, name string, path string, ...) error
- func CreateModelHandler(c *gin.Context)
- func DeleteModel(name string) error
- func DeleteModelHandler(c *gin.Context)
- func EmbeddingHandler(c *gin.Context)
- func GenerateHandler(c *gin.Context)
- func GetBlobsPath(digest string) (string, error)
- func GetManifestPath() (string, error)
- func GetModelInfo(name string) (*api.ShowResponse, error)
- func GetSHA256Digest(r io.Reader) (string, int64)
- func ListModelsHandler(c *gin.Context)
- func LoadPluginHandler(c *gin.Context)
- func PruneDirectory(path string) error
- func PruneLayers() error
- func PullModel(ctx context.Context, name string, regOpts *RegistryOptions, ...) error
- func PullModelHandler(c *gin.Context)
- func PushModel(ctx context.Context, name string, regOpts *RegistryOptions, ...) error
- func PushModelHandler(c *gin.Context)
- func SaveLayers(layers []*LayerReader, fn func(resp api.ProgressResponse), force bool) error
- func Serve(ln net.Listener, allowOrigins []string) error
- func ShowModelHandler(c *gin.Context)
- func ShowModelfile(model *Model) (string, error)
- type AuthRedirect
- type ConfigV2
- type Layer
- type LayerReader
- type ManifestV2
- type Model
- type ModelPath
- type ProgressWriter
- type RegistryOptions
- type RootFS
- type SignatureData
Constants ¶
View Source
const ( DefaultRegistry = "registry.ollama.ai" DefaultNamespace = "library" DefaultTag = "latest" DefaultProtocolScheme = "https" )
Variables ¶
Functions ¶
func CopyModelHandler ¶
func CreateManifest ¶
func CreateManifest(name string, cfg *LayerReader, layers []*Layer) error
func CreateModel ¶
func CreateModelHandler ¶
func DeleteModel ¶
func DeleteModelHandler ¶
func EmbeddingHandler ¶
func GenerateHandler ¶
func GetBlobsPath ¶
func GetManifestPath ¶
func GetModelInfo ¶
func GetModelInfo(name string) (*api.ShowResponse, error)
func GetSHA256Digest ¶
GetSHA256Digest returns the SHA256 hash of a given buffer and returns it, and the size of buffer
func ListModelsHandler ¶
func LoadPluginHandler ¶
func PruneDirectory ¶
func PruneLayers ¶
func PruneLayers() error
func PullModel ¶
func PullModel(ctx context.Context, name string, regOpts *RegistryOptions, fn func(api.ProgressResponse)) error
func PullModelHandler ¶
func PushModel ¶
func PushModel(ctx context.Context, name string, regOpts *RegistryOptions, fn func(api.ProgressResponse)) error
func PushModelHandler ¶
func SaveLayers ¶
func SaveLayers(layers []*LayerReader, fn func(resp api.ProgressResponse), force bool) error
func ShowModelHandler ¶
func ShowModelfile ¶
Types ¶
type AuthRedirect ¶
func ParseAuthRedirectString ¶
func ParseAuthRedirectString(authStr string) AuthRedirect
type LayerReader ¶
func CreateLayer ¶
func CreateLayer(f io.ReadSeeker) (*LayerReader, error)
CreateLayer creates a Layer object from a given file
func GetLayerWithBufferFromLayer ¶
func GetLayerWithBufferFromLayer(layer *Layer) (*LayerReader, error)
type ManifestV2 ¶
type ManifestV2 struct { SchemaVersion int `json:"schemaVersion"` MediaType string `json:"mediaType"` Config Layer `json:"config"` Layers []*Layer `json:"layers"` }
func GetManifest ¶
func GetManifest(mp ModelPath) (*ManifestV2, string, error)
func (*ManifestV2) GetTotalSize ¶
func (m *ManifestV2) GetTotalSize() (total int64)
type Model ¶
type ModelPath ¶
type ModelPath struct { ProtocolScheme string Registry string Namespace string Repository string Tag string }
func ParseModelPath ¶
func (ModelPath) GetFullTagname ¶
func (ModelPath) GetManifestPath ¶
GetManifestPath returns the path to the manifest file for the given model path, it is up to the caller to create the directory if it does not exist.
func (ModelPath) GetNamespaceRepository ¶
func (ModelPath) GetShortTagname ¶
type ProgressWriter ¶
type ProgressWriter struct {
// contains filtered or unexported fields
}
type RegistryOptions ¶
type SignatureData ¶
func (SignatureData) Bytes ¶
func (s SignatureData) Bytes() []byte
Bytes returns a byte slice of the data to sign for the request
Click to show internal directories.
Click to hide internal directories.